Prepared code in VideoFFmpegComponent.cpp for how to handle the deprecated AVFrame::pkt_pos and AVFrame::pkt_size fields

This commit is contained in:
Leon Styhre 2024-03-10 16:48:26 +01:00
parent 4260ecdbfc
commit 28c91d1c0e

View file

@ -744,13 +744,23 @@ void VideoFFmpegComponent::readFrames()
destFrame->pict_type = mVideoFrame->pict_type;
destFrame->chroma_location =
mVideoFrame->chroma_location;
#if LIBAVUTIL_VERSION_MAJOR > 58 || (LIBAVUTIL_VERSION_MAJOR == 58 && LIBAVUTIL_VERSION_MINOR >= 29)
// TODO: Figure out how this should be done in >= 6.1
destFrame->pkt_pos = mVideoFrame->pkt_pos;
#else
destFrame->pkt_pos = mVideoFrame->pkt_pos;
#endif
#if LIBAVUTIL_VERSION_MAJOR < 58
destFrame->pkt_duration = mVideoFrame->pkt_duration;
#else
destFrame->duration = mVideoFrame->duration;
#endif
#if LIBAVUTIL_VERSION_MAJOR > 58 || (LIBAVUTIL_VERSION_MAJOR == 58 && LIBAVUTIL_VERSION_MINOR >= 29)
// TODO: Figure out how this should be done in >= 6.1
destFrame->pkt_size = mVideoFrame->pkt_size;
#else
destFrame->pkt_size = mVideoFrame->pkt_size;
#endif
}
}
else {