[FFmpeg-devel] [PATCH 1/2] libavutil: Undeprecate the AVFrame reordered_opaque field
Martin Storsjö
martin at martin.st
Mon Oct 29 16:10:28 EET 2018
On Mon, 29 Oct 2018, Derek Buitenhuis wrote:
> On 25/10/2018 13:58, Martin Storsjö wrote:
>> This was marked as deprecated (but only in the doxygen, not with an
>> actual deprecation attribute) in 81c623fae05 in 2011, but was
>> undeprecated in ad1ee5fa7.
>> ---
>> libavutil/frame.h | 1 -
>> libavutil/version.h | 2 +-
>> 2 files changed, 1 insertion(+), 2 deletions(-)
>
> I don't understand why this is being used in favour of a proper
> pointer field? An integer field is just ascting to be misused.
> Even the doxygen is really sketchy on it.
It's essentially meant to be used as union { ptr; int64_t } assuming you
don't have pointers larger than 64 bits.
> I also don't understand why this is at the AVCodecContext level
> and not packet/frame?
It is on the frame level, but not in the packet struct (probably for
historical reasons) - instead of in the packet, it's in AVCodecContext.
For decoding, you set the value in AVCodecContext before feeding packets
to it, and get the corresponding value reordered into the output AVFrame.
If things were to be redone from scratch, moving it into AVPacket would
probably make more sense, but there's not much point in doing that right
now.
At some point, the doxygen got markers saying this mechanism was
deprecated and one should use the new pkt_pts instead. Before that,
reordered_opaque was mainly used for getting reordered pts as there
was no other mechanism for it.
But even with the proper pkt_pts field, having a generic opaque field that
travels along with the reordering is useful, which is why the deprecation
doxygen comments were removed in ad1ee5fa7. But that commit just missed to
remove one of the doxygen deprecation.
// Martin
More information about the ffmpeg-devel
mailing list