aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/avcodec.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2018-10-11 16:03:10 +0300
committerMartin Storsjö <martin@martin.st>2018-11-05 15:52:14 +0200
commit882ae091d48b112004b977314884176841f12cef (patch)
tree2c6874736b576b6c434581d43fcaf6c333891f3a /libavcodec/avcodec.h
parent4e9cff2824769e792c7867b09e1efb67278abe79 (diff)
downloadffmpeg-882ae091d48b112004b977314884176841f12cef.tar.gz
libx264: Pass the reordered_opaque field through the encoder
libx264 does have a field for opaque data to pass along with frames through the encoder, but it is a pointer, while the libavcodec reordered_opaque field is an int64_t. Therefore, allocate an array within the libx264 wrapper, where reordered_opaque values in flight are stored, and pass a pointer to this array to libx264. Update the public libavcodec documentation for the AVCodecContext field to explain this usage, and add a codec capability that allows detecting whether an encoder handles this field. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7ffef768dc..80fa469f26 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1072,6 +1072,13 @@ typedef struct RcOverride{
#define AV_CODEC_CAP_HYBRID (1 << 19)
/**
+ * This codec takes the reordered_opaque field from input AVFrames
+ * and returns it in the corresponding field in AVCodecContext after
+ * encoding.
+ */
+#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20)
+
+/**
* Pan Scan area.
* This specifies the area which should be displayed.
* Note there may be multiple such areas for one frame.
@@ -2677,7 +2684,10 @@ typedef struct AVCodecContext {
/**
* opaque 64-bit number (generally a PTS) that will be reordered and
* output in AVFrame.reordered_opaque
- * - encoding: unused
+ * - encoding: Set by libavcodec to the reordered_opaque of the input
+ * frame corresponding to the last returned packet. Only
+ * supported by encoders with the
+ * AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability.
* - decoding: Set by user.
*/
int64_t reordered_opaque;