aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/frame.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-07-11 10:04:17 +0200
committerAnton Khirnov <anton@khirnov.net>2022-07-19 12:27:17 +0200
commit4397f9a5a09d82846bf787295c60f1104cf7de9e (patch)
treeafb4c8b8e6a9ad0d872e71b0edaba3ab576d08a8 /libavutil/frame.h
parent0a6bb7da55709d82b1cbb12d420db2d1fbb867d7 (diff)
downloadffmpeg-4397f9a5a09d82846bf787295c60f1104cf7de9e.tar.gz
lavu/frame: add a duration field to AVFrame
The only duration field currently present in AVFrame is pkt_duration, which is semantically restricted to those frames that are output by decoders. Add a new field that stores the frame's duration without regard for how that frame was produced. Deprecate pkt_duration.
Diffstat (limited to 'libavutil/frame.h')
-rw-r--r--libavutil/frame.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 33fac2054c..856959f979 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -604,13 +604,18 @@ typedef struct AVFrame {
*/
int64_t pkt_pos;
+#if FF_API_PKT_DURATION
/**
* duration of the corresponding packet, expressed in
* AVStream->time_base units, 0 if unknown.
* - encoding: unused
* - decoding: Read by user.
+ *
+ * @deprecated use duration instead
*/
+ attribute_deprecated
int64_t pkt_duration;
+#endif
/**
* metadata.
@@ -702,6 +707,11 @@ typedef struct AVFrame {
* Channel layout of the audio data.
*/
AVChannelLayout ch_layout;
+
+ /**
+ * Duration of the frame, in the same units as pts. 0 if unknown.
+ */
+ int64_t duration;
} AVFrame;