Skip to content

Commit

Permalink
skipping ffmpeggrabber device for ffmpeg version >=5
Browse files Browse the repository at this point in the history
  • Loading branch information
randaz81 committed Sep 16, 2024
1 parent 2e9ac9f commit 0bd9e43
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/devices/ffmpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ yarp_prepare_plugin(ffmpeg_writer
DEPENDS "YARP_HAS_FFMPEG;FFMPEG_avcodec_FOUND;FFMPEG_avformat_FOUND;FFMPEG_avdevice_FOUND;FFMPEG_avutil_FOUND;FFMPEG_swscale_FOUND"
)

if (FFmpeg_VERSION VERSION_LESS "4.0.0")
set(FFMPEG_VERSIONS_IS_OK TRUE)
message(WARNING "ffmpeg <4")
elseif (FFmpeg_VERSION VERSION_LESS "5.0.0")
set(FFMPEG_VERSIONS_IS_OK TRUE)
message(WARNING "ffmpeg >=4 <5")
else()
set(FFMPEG_VERSIONS_IS_OK FALSE)
message(WARNING "ffmpeg >=5")
endif()

if(NOT FFMPEG_VERSIONS_IS_OK AND (NOT SKIP_ffmpeg_grabber OR NOT SKIP_ffmpeg_writer))
message(WARNING "ffmpeg_grabber/ffmpeg_writer devices cannot be currently compiled with FFMPEG library version greater >=5. See issue https://github.com/robotology/yarp/issues/2885")
set (SKIP_ffmpeg_grabber TRUE)
set (SKIP_ffmpeg_writer TRUE)
endif()

if(NOT SKIP_ffmpeg_grabber OR NOT SKIP_ffmpeg_writer)
yarp_add_plugin(yarp_ffmpeg)

Expand Down Expand Up @@ -84,6 +101,3 @@ if(NOT SKIP_ffmpeg_grabber OR NOT SKIP_ffmpeg_writer)

set_property(TARGET yarp_ffmpeg PROPERTY FOLDER "Plugins/Device")
endif()

include(YarpRemoveFile)
yarp_remove_file("${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}/ffmpeg.ini") # YARP_DEPRECATED since YARP 3.2

0 comments on commit 0bd9e43

Please sign in to comment.