diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-03-10 10:48:34 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-03-20 10:42:09 +0100 |
commit | 27f8c9b27bce42a4a6a4c64e03fab769579c8683 (patch) | |
tree | 4c7d7bce3e4f99a9b864eae726d2280b7b415044 /libavcodec/av1dec.c | |
parent | 2fb3ee17877415fde76a7582797349484844b74d (diff) | |
download | ffmpeg-27f8c9b27bce42a4a6a4c64e03fab769579c8683.tar.gz |
lavu/frame: deprecate AVFrame.pkt_{pos,size}
These fields are supposed to store information about the packet the
frame was decoded from, specifically the byte offset it was stored at
and its size.
However,
- the fields are highly ad-hoc - there is no strong reason why
specifically those (and not any other) packet properties should have a
dedicated field in AVFrame; unlike e.g. the timestamps, there is no
fundamental link between coded packet offset/size and decoded frames
- they only make sense for frames produced by decoding demuxed packets,
and even then it is not always the case that the encoded data was
stored in the file as a contiguous sequence of bytes (in order for pos
to be well-defined)
- pkt_pos was added without much explanation, apparently to allow
passthrough of this information through lavfi in order to handle byte
seeking in ffplay. That is now implemented using arbitrary user data
passthrough in AVFrame.opaque_ref.
- several filters use pkt_pos as a variable available to user-supplied
expressions, but there seems to be no established motivation for using them.
- pkt_size was added for use in ffprobe, but that too is now handled
without using this field. Additonally, the values of this field
produced by libavcodec are flawed, as described in the previous
ffprobe conversion commit.
In summary - these fields are ill-defined and insufficiently motivated,
so deprecate them.
Diffstat (limited to 'libavcodec/av1dec.c')
-rw-r--r-- | libavcodec/av1dec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 4d3b559b96..5c14756a57 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1074,7 +1074,11 @@ static int set_output_frame(AVCodecContext *avctx, AVFrame *frame, frame->pts = pkt->pts; frame->pkt_dts = pkt->dts; +#if FF_API_FRAME_PKT +FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_size = pkt->size; +FF_ENABLE_DEPRECATION_WARNINGS +#endif *got_frame = 1; |