]> git.sesse.net Git - ffmpeg/commitdiff
avcodec: add an AVCodecContext flag to export PRFT side data on demand
authorJames Almer <jamrial@gmail.com>
Sun, 2 Feb 2020 22:12:08 +0000 (19:12 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 23 Feb 2020 02:19:07 +0000 (23:19 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
doc/APIchanges
doc/codecs.texi
libavcodec/avcodec.h
libavcodec/options_table.h
libavcodec/version.h

index aba4f5fd7ab8100cf28a4f1c29d170b9a5f5da47..5bfb0a654e12f958ac477f4259abdb52261443f6 100644 (file)
@@ -15,6 +15,9 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2020-02-21 - xxxxxxxxxx - lavc 58.73.101 - avcodec.h
+  Add AV_CODEC_EXPORT_DATA_PRFT.
+
 2020-02-21 - xxxxxxxxxx - lavc 58.73.100 - avcodec.h
   Add AVCodecContext.export_side_data and AV_CODEC_EXPORT_DATA_MVS.
 
index 62090b3d51d6410c4b439b85970df0db44bbc5ef..2112ce5f4673d6325ec50a8cf987c9b5bb6c1650 100644 (file)
@@ -795,6 +795,9 @@ Possible values:
 @item 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}.
+@item prft
+Export encoder Producer Reference Time into packet side-data (see @code{AV_PKT_DATA_PRFT})
+for codecs that support it.
 @end table
 
 @item error @var{integer} (@emph{encoding,video})
index ba0fdd34934122cb040c4f64f41d697df3fdcf9d..82dce38bb8f88b79cd7e159a852b83030d78a7bc 100644 (file)
@@ -1110,6 +1110,10 @@ typedef struct RcOverride{
  * Export motion vectors through frame side data
  */
 #define AV_CODEC_EXPORT_DATA_MVS         (1 << 0)
+/**
+ * Export encoder Producer Reference Time through packet side data
+ */
+#define AV_CODEC_EXPORT_DATA_PRFT        (1 << 1)
 
 /**
  * Pan Scan area.
@@ -1430,7 +1434,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,
+     * usually exported by some encoders (on demand through the prft flag set in the
+     * AVCodecContext export_side_data field).
      */
     AV_PKT_DATA_PRFT,
 
index 3f278d5c6830b0a0f6a4a520103e99c2d64bca5e..3265889b8e74ec8a71a2caadf5204e3f9ee5c7ad 100644 (file)
@@ -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, A|V|S|D|E, "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|S|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},
index c2b5864e5f41fc6d719a96ab64d3e6b27d673178..a35644559660169846081f64790efbd8e1aa09ba 100644 (file)
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  73
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \