FFmpeg version support for 5.1 and 6.1 (#646)
* add support for ffmpeg versions 5.1 & 6.1 * avcodec variable version support * update for ffmpeg 6.1 * edit comments --------- Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2e38f502ab
Коммит
ab64ac38fa
@@ -75,11 +75,16 @@ if(HIP_FOUND AND Threads_FOUND AND FFMPEG_FOUND)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARY_LIST})
|
||||
# FFMPEG multi-version support
|
||||
if(_FFMPEG_AVCODEC_VERSION VERSION_LESS_EQUAL 58.134.100)
|
||||
if(_FFMPEG_AVCODEC_VERSION VERSION_LESS_EQUAL 58.134.100) #FFmpeg version <= 4.4
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_GREATER_THAN_58_134=0)
|
||||
else()
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_GREATER_THAN_60_31=0)
|
||||
elseif(_FFMPEG_AVCODEC_VERSION VERSION_GREATER 58.134.100 AND _FFMPEG_AVCODEC_VERSION VERSION_LESS_EQUAL 60.31.100) #FFmpeg version >= 4.4 && version < 6.1
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_GREATER_THAN_58_134=1)
|
||||
endif()
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_GREATER_THAN_60_31=0)
|
||||
else()
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_GREATER_THAN_58_134=0) #FFmpeg version >= 6.1
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_GREATER_THAN_60_31=1)
|
||||
endif() #FFMpeg version >= 7.1
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
message("-- ${White}AMD ROCm ${PROJECT_NAME} -- CMAKE_CXX_FLAGS:${CMAKE_CXX_FLAGS}${ColourReset}")
|
||||
|
||||
@@ -387,10 +387,10 @@ rocDecStatus AvcodecVideoDecoder::NotifyNewSequence(AVFrame *p_frame) {
|
||||
p_video_format->frame_rate.denominator = dec_context_->framerate.den;
|
||||
p_video_format->bit_depth_luma_minus8 = BitDepthFromPixelFormat(dec_context_->pix_fmt) - 8;
|
||||
p_video_format->bit_depth_chroma_minus8 = p_video_format->bit_depth_luma_minus8;
|
||||
#if USE_AVCODEC_GREATER_THAN_58_134
|
||||
#if USE_AVCODEC_GREATER_THAN_60_31
|
||||
p_video_format->progressive_sequence = !(p_frame->flags & AV_FRAME_FLAG_INTERLACED);
|
||||
#else
|
||||
p_video_format->progressive_sequence = !!p_frame->interlaced_frame;;
|
||||
#elif USE_AVCODEC_GREATER_THAN_58_134
|
||||
p_video_format->progressive_sequence = !p_frame->interlaced_frame;
|
||||
#endif
|
||||
//number of decode surfaces are internal and not exposed in avcodec based decoding. Setting some value for sanity
|
||||
p_video_format->min_num_decode_surfaces = dec_frames_.size();
|
||||
|
||||
@@ -156,7 +156,7 @@ private:
|
||||
// Variables for FFMpeg decoding
|
||||
AVCodecContext * dec_context_ = nullptr;
|
||||
AVPixelFormat decoder_pixel_format_;
|
||||
#if USE_AVCODEC_GREATER_THAN_58_134
|
||||
#if USE_AVCODEC_GREATER_THAN_58_134 || USE_AVCODEC_GREATER_THAN_60_31
|
||||
const AVCodec *decoder_ = nullptr;
|
||||
#else
|
||||
AVCodec *decoder_ = nullptr;
|
||||
|
||||
Ссылка в новой задаче
Block a user