From 32c8359093d1ff4f45ed19518b449b3ac3769d27 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 19 Mar 2016 21:45:24 +0100 Subject: 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. --- libavutil/frame.c | 4 ++++ libavutil/frame.h | 4 ++++ libavutil/version.h | 3 +++ 3 files changed, 11 insertions(+) (limited to 'libavutil') 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 /** -- cgit v1.2.3