summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-03-19 21:45:24 +0100
committerAnton Khirnov <anton@khirnov.net>2016-06-21 19:54:42 +0200
commit32c8359093d1ff4f45ed19518b449b3ac3769d27 (patch)
tree59886a4e26a0931902e6f6bb14a0319d111a7383 /libavutil
parentac7bfd69678f3966e38debdb27f4bde94dc0345c (diff)
lavc: export the timestamps when decoding in AVFrame.pts
Currently it's exported as AVFrame.pkt_pts, which is also the only use for that field. The reason it is done like this is that lavc used to export various codec-specific "timing" information in AVFrame.pts, which is not done anymore. Since it is confusing to the callers to have a separate field which is used only for decoder timestamps and nothing else, deprecate pkt_pts and use just AVFrame.pts everywhere.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/frame.c4
-rw-r--r--libavutil/frame.h4
-rw-r--r--libavutil/version.h3
3 files changed, 11 insertions, 0 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c
index ae80cee062..1c14f5f03f 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -397,7 +397,11 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
dst->palette_has_changed = src->palette_has_changed;
dst->sample_rate = src->sample_rate;
dst->opaque = src->opaque;
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
dst->pkt_pts = src->pkt_pts;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
dst->pkt_dts = src->pkt_dts;
dst->reordered_opaque = src->reordered_opaque;
dst->quality = src->quality;
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 7c55225a45..12624d797f 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -210,10 +210,14 @@ typedef struct AVFrame {
*/
int64_t pts;
+#if FF_API_PKT_PTS
/**
* PTS copied from the AVPacket that was decoded to produce this frame.
+ * @deprecated use the pts field instead
*/
+ attribute_deprecated
int64_t pkt_pts;
+#endif
/**
* DTS copied from the AVPacket that triggered returning this frame.
diff --git a/libavutil/version.h b/libavutil/version.h
index d13794cc50..40745da216 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -102,6 +102,9 @@
#ifndef FF_API_VAAPI
#define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
+#ifndef FF_API_PKT_PTS
+#define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 56)
+#endif
/**