[FFmpeg-devel] [PATCH 5/6] lavc: Add VP9 metadata bitstream filter
James Almer
jamrial at gmail.com
Wed May 2 01:49:18 EEST 2018
On 4/30/2018 8:26 PM, Mark Thompson wrote:
> Can adjust the colour information.
> ---
> configure | 1 +
> doc/bitstream_filters.texi | 26 +++++++
> libavcodec/Makefile | 1 +
> libavcodec/bitstream_filters.c | 1 +
> libavcodec/vp9_metadata_bsf.c | 162 +++++++++++++++++++++++++++++++++++++++++
> 5 files changed, 191 insertions(+)
> create mode 100644 libavcodec/vp9_metadata_bsf.c
>
[...]
> +static const AVOption vp9_metadata_options[] = {
> + { "color_space", "Set colour space (section 7.2.2)",
> + OFFSET(color_space), AV_OPT_TYPE_INT,
> + { .i64 = -1 }, -1, VP9_CS_RGB, FLAGS, "cs" },
> + { "unknown", "Unknown/unspecified", 0, AV_OPT_TYPE_CONST,
> + { .i64 = VP9_CS_UNKNOWN }, .flags = FLAGS, .unit = "cs" },
> + { "bt601", "ITU-R BT.601-7", 0, AV_OPT_TYPE_CONST,
> + { .i64 = VP9_CS_BT_601 }, .flags = FLAGS, .unit = "cs" },
> + { "bt709", "ITU-R BT.709-6", 0, AV_OPT_TYPE_CONST,
> + { .i64 = VP9_CS_BT_709 }, .flags = FLAGS, .unit = "cs" },
> + { "smpte170", "SMPTE-170", 0, AV_OPT_TYPE_CONST,
> + { .i64 = VP9_CS_SMPTE_170 }, .flags = FLAGS, .unit = "cs" },
> + { "smpte240", "SMPTE-240", 0, AV_OPT_TYPE_CONST,
> + { .i64 = VP9_CS_SMPTE_240 }, .flags = FLAGS, .unit = "cs" },
> + { "bt2020", "ITU-R BT.2020-2", 0, AV_OPT_TYPE_CONST,
> + { .i64 = VP9_CS_BT_2020 }, .flags = FLAGS, .unit = "cs" },
> + { "rgb", "sRGB / IEC 61966-2-1", 0, AV_OPT_TYPE_CONST,
> + { .i64 = VP9_CS_RGB }, .flags = FLAGS, .unit = "cs" },
> +
> + { "color_range", "Set colour range (section 7.2.2)",
> + OFFSET(color_range), AV_OPT_TYPE_INT,
> + { .i64 = -1 }, -1, 1, FLAGS, "cr" },
> + { "tv", "TV (limited) range", 0, AV_OPT_TYPE_CONST,
> + { .i64 = 0 }, .flags = FLAGS, .unit = "cr" },
> + { "pc", "PC (full) range", 0, AV_OPT_TYPE_CONST,
> + { .i64 = 1 }, .flags = FLAGS, .unit = "cr" },
> +
> + { NULL }
Options look great now, so LGTM.
> +};
> +
> +static const AVClass vp9_metadata_class = {
> + .class_name = "vp9_metadata_bsf",
> + .item_name = av_default_item_name,
> + .option = vp9_metadata_options,
> + .version = LIBAVUTIL_VERSION_INT,
> +};
> +
> +static const enum AVCodecID vp9_metadata_codec_ids[] = {
> + AV_CODEC_ID_VP9, AV_CODEC_ID_NONE,
> +};
> +
> +const AVBitStreamFilter ff_vp9_metadata_bsf = {
> + .name = "vp9_metadata",
> + .priv_data_size = sizeof(VP9MetadataContext),
> + .priv_class = &vp9_metadata_class,
> + .init = &vp9_metadata_init,
> + .close = &vp9_metadata_close,
> + .filter = &vp9_metadata_filter,
> + .codec_ids = vp9_metadata_codec_ids,
> +};
>
More information about the ffmpeg-devel
mailing list