[FFmpeg-devel] [PATCH 1/2] avcodec: add an AVCodecContext flag to export PRFT side data on demand
Anton Khirnov
anton at khirnov.net
Wed Jan 29 17:12:05 EET 2020
Quoting James Almer (2020-01-23 21:25:34)
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> doc/APIchanges | 3 +++
> doc/codecs.texi | 2 ++
> libavcodec/avcodec.h | 8 +++++++-
> libavcodec/options_table.h | 1 +
> libavcodec/version.h | 2 +-
> 5 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 2977b00b60..2433083d55 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>
> API changes, most recent first:
>
> +2020-01-xx - xxxxxxxxxx - lavc 58.66.101 - avcodec.h
> + Add AV_CODEC_FLAG2_EXPORT_PRFT.
> +
> 2020-01-15 - xxxxxxxxxx - lavc 58.66.100 - avcodec.h
> Add AV_PKT_DATA_PRFT and AVProducerReferenceTime.
>
> diff --git a/doc/codecs.texi b/doc/codecs.texi
> index 15e55cca39..ebf7bab0fb 100644
> --- a/doc/codecs.texi
> +++ b/doc/codecs.texi
> @@ -779,6 +779,8 @@ Place global headers at every keyframe instead of in extradata.
> Frame data might be split into multiple chunks.
> @item showall
> Show all frames before the first keyframe.
> + at item export_prft
> +Export Producer Reference Time into packet side-data (see @code{AV_PKT_DATA_PRFT})
> @item export_mvs
> Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS})
> for codecs that support it. See also @file{doc/examples/export_mvs.c}.
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 774ed1e641..aae6e83568 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -955,6 +955,10 @@ typedef struct RcOverride{
> * Show all frames before the first keyframe
> */
> #define AV_CODEC_FLAG2_SHOW_ALL (1 << 22)
> +/**
> + * Export Producer Reference Time through packet side data
> + */
> +#define AV_CODEC_FLAG2_EXPORT_PRFT (1 << 27)
I wonder if we couldn't figure out a better place for this toggle.
flags/flags2 are currently a hot mess of everything and the kitchensink
squashed together. Perhaps we could add a new field for "flags to
indicate to the codec that it should export this optional kind of
metadata". It might make things clearer and better organized. Just a
random thought though - feel free to ignore me.
--
Anton Khirnov
More information about the ffmpeg-devel
mailing list