summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-11-12 15:15:07 +0100
committerAnton Khirnov <anton@khirnov.net>2021-11-16 10:51:32 +0100
commita4c5d241ec215cfa680c5fa706377e40d18e8040 (patch)
tree6fde470d7a942e31d83e693db0e9e60d3190425f /libavformat/utils.c
parentb731fb5104d06ddbfa6e61ea9451ba77c1c22bce (diff)
downloadffmpeg-a4c5d241ec215cfa680c5fa706377e40d18e8040.tar.gz
lavf: add "disposition" AVOption to AVStream AVClass
Use it to remove custom disposition parsing code from ffmpeg.c
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 55bc7e2019..a8611f5877 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -722,10 +722,34 @@ void avformat_free_context(AVFormatContext *s)
av_free(s);
}
+static const AVOption stream_options[] = {
+ { "disposition", NULL, offsetof(AVStream, disposition), AV_OPT_TYPE_FLAGS, { .i64 = 0 },
+ .flags = AV_OPT_FLAG_ENCODING_PARAM, .unit = "disposition" },
+ { "default", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEFAULT }, .unit = "disposition" },
+ { "dub", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DUB }, .unit = "disposition" },
+ { "original", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ORIGINAL }, .unit = "disposition" },
+ { "comment", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_COMMENT }, .unit = "disposition" },
+ { "lyrics", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_LYRICS }, .unit = "disposition" },
+ { "karaoke", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_KARAOKE }, .unit = "disposition" },
+ { "forced", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_FORCED }, .unit = "disposition" },
+ { "hearing_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_HEARING_IMPAIRED }, .unit = "disposition" },
+ { "visual_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_VISUAL_IMPAIRED }, .unit = "disposition" },
+ { "clean_effects", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CLEAN_EFFECTS }, .unit = "disposition" },
+ { "attached_pic", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ATTACHED_PIC }, .unit = "disposition" },
+ { "timed_thumbnails", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_TIMED_THUMBNAILS }, .unit = "disposition" },
+ { "captions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS }, .unit = "disposition" },
+ { "descriptions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS }, .unit = "disposition" },
+ { "metadata", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA }, .unit = "disposition" },
+ { "dependent", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEPENDENT }, .unit = "disposition" },
+ { "still_image", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_STILL_IMAGE }, .unit = "disposition" },
+ { NULL }
+};
+
static const AVClass stream_class = {
.class_name = "AVStream",
.item_name = av_default_item_name,
.version = LIBAVUTIL_VERSION_INT,
+ .option = stream_options,
};
const AVClass *av_stream_get_class(void)