aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/options.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-08-20 13:56:48 -0300
committerJames Almer <jamrial@gmail.com>2024-09-19 10:01:02 -0300
commitba0ef0860f0018c6e8fda7b378d69b011575fdaf (patch)
tree1d896bbdbad665cb6ca7a7c8a788948033966389 /libavformat/options.c
parent58963182294cfcb2c6a87a1b870b336a3ed55f36 (diff)
downloadffmpeg-ba0ef0860f0018c6e8fda7b378d69b011575fdaf.tar.gz
avformat: add an LCEVC stream group
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/options.c')
-rw-r--r--libavformat/options.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/libavformat/options.c b/libavformat/options.c
index 485265df52..039f1eea42 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -348,7 +348,6 @@ static const AVOption tile_grid_options[] = {
{ "vertical_offset", NULL, OFFSET(vertical_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
{ NULL },
};
-#undef FLAGS
#undef OFFSET
static const AVClass tile_grid_class = {
@@ -357,6 +356,20 @@ static const AVClass tile_grid_class = {
.option = tile_grid_options,
};
+#define OFFSET(x) offsetof(AVStreamGroupLCEVC, x)
+static const AVOption lcevc_options[] = {
+ { "video_size", "size of video after LCEVC enhancement has been applied", OFFSET(width),
+ AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, INT_MAX, FLAGS },
+ { NULL },
+};
+#undef OFFSET
+
+static const AVClass lcevc_class = {
+ .class_name = "AVStreamGroupLCEVC",
+ .version = LIBAVUTIL_VERSION_INT,
+ .option = lcevc_options,
+};
+
static void *stream_group_child_next(void *obj, void *prev)
{
AVStreamGroup *stg = obj;
@@ -368,6 +381,8 @@ static void *stream_group_child_next(void *obj, void *prev)
return stg->params.iamf_mix_presentation;
case AV_STREAM_GROUP_PARAMS_TILE_GRID:
return stg->params.tile_grid;
+ case AV_STREAM_GROUP_PARAMS_LCEVC:
+ return stg->params.lcevc;
default:
break;
}
@@ -375,6 +390,8 @@ static void *stream_group_child_next(void *obj, void *prev)
return NULL;
}
+#undef FLAGS
+
static const AVClass *stream_group_child_iterate(void **opaque)
{
uintptr_t i = (uintptr_t)*opaque;
@@ -393,6 +410,9 @@ static const AVClass *stream_group_child_iterate(void **opaque)
case AV_STREAM_GROUP_PARAMS_TILE_GRID:
ret = &tile_grid_class;
break;
+ case AV_STREAM_GROUP_PARAMS_LCEVC:
+ ret = &lcevc_class;
+ break;
default:
break;
}
@@ -462,6 +482,13 @@ AVStreamGroup *avformat_stream_group_create(AVFormatContext *s,
stg->params.tile_grid->av_class = &tile_grid_class;
av_opt_set_defaults(stg->params.tile_grid);
break;
+ case AV_STREAM_GROUP_PARAMS_LCEVC:
+ stg->params.lcevc = av_mallocz(sizeof(*stg->params.lcevc));
+ if (!stg->params.lcevc)
+ goto fail;
+ stg->params.lcevc->av_class = &lcevc_class;
+ av_opt_set_defaults(stg->params.lcevc);
+ break;
default:
goto fail;
}