diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-03-19 21:45:24 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-06-21 19:54:42 +0200 |
commit | 32c8359093d1ff4f45ed19518b449b3ac3769d27 (patch) | |
tree | 59886a4e26a0931902e6f6bb14a0319d111a7383 /libavcodec | |
parent | ac7bfd69678f3966e38debdb27f4bde94dc0345c (diff) | |
download | ffmpeg-32c8359093d1ff4f45ed19518b449b3ac3769d27.tar.gz |
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 'libavcodec')
-rw-r--r-- | libavcodec/libschroedingerdec.c | 7 | ||||
-rw-r--r-- | libavcodec/mmaldec.c | 7 | ||||
-rw-r--r-- | libavcodec/qsvdec.c | 7 | ||||
-rw-r--r-- | libavcodec/utils.c | 10 | ||||
-rw-r--r-- | libavcodec/version.h | 2 |
5 files changed, 29 insertions, 4 deletions
diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c index fb0781ed5c..f173f92f04 100644 --- a/libavcodec/libschroedingerdec.c +++ b/libavcodec/libschroedingerdec.c @@ -326,7 +326,12 @@ static int libschroedinger_decode_frame(AVCodecContext *avctx, framewithpts->frame->components[2].length); /* Fill frame with current buffer data from Schroedinger. */ - avframe->pkt_pts = framewithpts->pts; + avframe->pts = framewithpts->pts; +#if FF_API_PKT_PTS +FF_DISABLE_DEPRECATION_WARNINGS + avframe->pkt_pts = avframe->pts; +FF_ENABLE_DEPRECATION_WARNINGS +#endif avframe->linesize[0] = framewithpts->frame->components[0].stride; avframe->linesize[1] = framewithpts->frame->components[1].stride; avframe->linesize[2] = framewithpts->frame->components[2].stride; diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c index 193df7e07d..69258a2eb6 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -631,7 +631,12 @@ static int ffmal_copy_frame(AVCodecContext *avctx, AVFrame *frame, avctx->pix_fmt, avctx->width, avctx->height); } - frame->pkt_pts = buffer->pts == MMAL_TIME_UNKNOWN ? AV_NOPTS_VALUE : buffer->pts; + frame->pts = buffer->pts == MMAL_TIME_UNKNOWN ? AV_NOPTS_VALUE : buffer->pts; +#if FF_API_PKT_PTS +FF_DISABLE_DEPRECATION_WARNINGS + frame->pkt_pts = frame->pts; +FF_ENABLE_DEPRECATION_WARNINGS +#endif frame->pkt_dts = AV_NOPTS_VALUE; done: diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index ac7a1e60b9..0215761335 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -352,7 +352,12 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, outsurf = out_frame->surface; - frame->pkt_pts = frame->pts = outsurf->Data.TimeStamp; +#if FF_API_PKT_PTS +FF_DISABLE_DEPRECATION_WARNINGS + frame->pkt_pts = outsurf->Data.TimeStamp; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + frame->pts = outsurf->Data.TimeStamp; frame->repeat_pict = outsurf->Info.PicStruct & MFX_PICSTRUCT_FRAME_TRIPLING ? 4 : diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 8f8efecbea..bc1beee462 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -551,11 +551,21 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) frame->reordered_opaque = avctx->reordered_opaque; if (!pkt) { +#if FF_API_PKT_PTS +FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_pts = AV_NOPTS_VALUE; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + frame->pts = AV_NOPTS_VALUE; return 0; } +#if FF_API_PKT_PTS +FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_pts = pkt->pts; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + frame->pts = pkt->pts; for (i = 0; i < FF_ARRAY_ELEMS(sd); i++) { int size; diff --git a/libavcodec/version.h b/libavcodec/version.h index 9b495e9a44..3b154f84e3 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -28,7 +28,7 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 57 -#define LIBAVCODEC_VERSION_MINOR 23 +#define LIBAVCODEC_VERSION_MINOR 24 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |