diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index a53b3b2f6c3ab..ed73f7eedbab0 100644 --- a/recipes/ffmpeg/all/conanfile.py +++ b/recipes/ffmpeg/all/conanfile.py @@ -52,6 +52,7 @@ class FFMpegConan(ConanFile): "with_harfbuzz": [True, False], "with_openjpeg": [True, False], "with_openh264": [True, False], + "with_openvino": [True, False], "with_opus": [True, False], "with_vorbis": [True, False], "with_zeromq": [True, False], @@ -141,6 +142,7 @@ class FFMpegConan(ConanFile): "with_harfbuzz": False, "with_openjpeg": True, "with_openh264": True, + "with_openvino": True, "with_opus": True, "with_vorbis": True, "with_zeromq": False, @@ -227,6 +229,7 @@ def _dependencies(self): "with_libxml2": ["avcodec"], "with_openjpeg": ["avcodec"], "with_openh264": ["avcodec"], + "with_openvino": ["avfilter"], "with_vorbis": ["avcodec"], "with_opus": ["avcodec"], "with_libx264": ["avcodec"], @@ -252,6 +255,10 @@ def _dependencies(self): "with_xlib": ["avdevice"], } + @property + def _version_supports_openvino(self): + return Version(self.version) >= "6.1.0" + @property def _version_supports_libsvtav1(self): return Version(self.version) >= "5.1.0" @@ -284,6 +291,8 @@ def config_options(self): del self.options.with_videotoolbox if not is_apple_os(self): del self.options.with_avfoundation + if not self._version_supports_openvino: + del self.options.with_openvino if not self.settings.os == "Android": del self.options.with_jni del self.options.with_mediacodec @@ -326,6 +335,8 @@ def requirements(self): self.requires("openjpeg/2.5.2") if self.options.with_openh264: self.requires("openh264/2.4.1") + if self.options.get_safe("with_openvino"): + self.requires("openvino/2024.5.0") if self.options.with_vorbis: self.requires("vorbis/1.3.7") if self.options.with_opus: @@ -577,6 +588,9 @@ def opt_append_disable_if_set(args, what, v): opt_enable_disable("gpl", self.options.with_libx264 or self.options.with_libx265 or self.options.postproc) ] + if self._version_supports_openvino: + args.append(opt_enable_disable("libopenvino", self.options.get_safe("with_openvino"))) + # Individual Component Options opt_append_disable_if_set(args, "everything", self.options.disable_everything) opt_append_disable_if_set(args, "encoders", self.options.disable_all_encoders) @@ -969,6 +983,8 @@ def _add_component(name, dependencies): avfilter.frameworks.append("CoreImage") if Version(self.version) >= "5.0" and is_apple_os(self): avfilter.frameworks.append("Metal") + if self.options.get_safe("with_openvino"): + avfilter.requires.append("openvino::Runtime_C") if self.options.get_safe("with_libdrm"): avutil.requires.append("libdrm::libdrm_libdrm") diff --git a/recipes/ffmpeg/all/test_package/CMakeLists.txt b/recipes/ffmpeg/all/test_package/CMakeLists.txt index e8b19851e2f49..c96c34ee35ce0 100644 --- a/recipes/ffmpeg/all/test_package/CMakeLists.txt +++ b/recipes/ffmpeg/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) find_package(ffmpeg REQUIRED CONFIG) diff --git a/recipes/ffmpeg/all/test_v1_package/CMakeLists.txt b/recipes/ffmpeg/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 0d20897301b68..0000000000000 --- a/recipes/ffmpeg/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package - ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/ffmpeg/all/test_v1_package/conanfile.py b/recipes/ffmpeg/all/test_v1_package/conanfile.py deleted file mode 100644 index eab3ab98cce15..0000000000000 --- a/recipes/ffmpeg/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,20 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self): - if self.options["ffmpeg"].with_programs: - self.run("ffmpeg --help", run_environment=True) - - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True)