gstavviddec: Deprecated usage of reordered_opaque (ffmpeg 6.0)
- Since 6.0:
AVFrame->reordered_opaque
is deprecated andAV_CODEC_FLAG_COPY_OPAQUE
can be used on decoders- Instead that original "opaque" value is transferred from/to the corresponding
AVPacket->opaque
(andAVPacket->opaque_ref
) field in decoders and encoders
- Instead that original "opaque" value is transferred from/to the corresponding
-
AVPacket.opaque{_ref}
were added in libavcodec 59.4.100
Solution for usage with 6.0:
- Use
AV_CODEC_FLAG_COPY_OPAQUE
on the context:
* @par decoding
* Request the decoder to propagate each packet's AVPacket.opaque and
* AVPacket.opaque_ref to its corresponding output AVFrame.
- In
gst_ffmpegviddec_handle_frame()
: SetGstVideoCodecFrame->system_frame_number
onAVPacket->opaque
. It's a 32bit field, it fits in avoid*
- In
gst_ffmpegviddec_get_buffer2()
: UseAVFrame->opaque
instead ofAVFrame->reordered_opaque
to get the original frame number.
But ...
The above is obvious, but the problem is that AVFrame->opaque
is currently being used in gstavviddec
for transferring our "internal information" (GstFFMpegVidDecVideoFrame
) through ffmpeg.
-
Use AVFrame->opaque_ref
for that field, which is properly refcounted and meant for that.