[FFmpeg-devel] [PATCH 2/3] avcodec: add an AVCodecContext flag to export PRFT side data on demand

James Almer jamrial at gmail.com
Mon Feb 3 00:23:06 EET 2020


Signed-off-by: James Almer <jamrial at gmail.com>
---
TODO: Version bump and APIChanges entry.

 libavcodec/avcodec.h       | 8 +++++++-
 libavcodec/options_table.h | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index edd22f3cbe..ba3d756fa7 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1109,6 +1109,10 @@ typedef struct RcOverride{
  * Export motion vectors through frame side data
  */
 #define AV_CODEC_EXPORT_DATA_MVS         (1 << 0)
+/**
+ * Export Producer Reference Time through packet side data
+ */
+#define AV_CODEC_EXPORT_DATA_PRFT        (1 << 1)
 
 /**
  * Pan Scan area.
@@ -1429,7 +1433,9 @@ enum AVPacketSideDataType {
     AV_PKT_DATA_AFD,
 
     /**
-     * Producer Reference Time data corresponding to the AVProducerReferenceTime struct.
+     * Producer Reference Time data corresponding to the AVProducerReferenceTime struct
+     * exported by some encoders (on demand through the export_prft flag set in the
+     * AVCodecContext flags2 field).
      */
     AV_PKT_DATA_PRFT,
 
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index ec17b20078..98dc7c66d6 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -80,6 +80,7 @@ static const AVOption avcodec_options[] = {
 {"ass_ro_flush_noop", "do not reset ASS ReadOrder field on flush", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_RO_FLUSH_NOOP}, INT_MIN, INT_MAX, S|D, "flags2"},
 {"export_side_data", "Export metadata as side data", OFFSET(export_side_data), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D|S, "export_side_data"},
 {"mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_MVS}, INT_MIN, INT_MAX, V|D, "export_side_data"},
+{"prft", "export Producer Reference Time through packet side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_PRFT}, INT_MIN, INT_MAX, A|V|E, "export_side_data"},
 {"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, INT_MAX},
 {"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
 {"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
-- 
2.25.0



More information about the ffmpeg-devel mailing list