mirror of
https://github.com/opencv/opencv.git
synced 2025-07-31 18:07:08 +08:00

cv::UMat output/input in VideoCapture/VideoWriter (data stays in GPU memory) * FFMPEG with UMat input/output * OpenCL_D3D* context * fix Linux build * cosmetic changes * fix build if USE_AV_HW_CODECS=0 * simplify how child context pointer stored in parent context * QSV interop with OpenCL on Windows * detect_msdk.cmake via pkg-config * fix av_buffer_ref() usage * revert windows-decode-mfx whitelisting; remove debug msg * address review comments * rename property to HW_ACCELERATION_USE_OPENCL * fix issue with "cl_khr_d3d11_sharing" extension not reported by OpenCL GPU+CPU platform * core(ocl): add OpenCL stubs for configurations without OpenCL * videoio(ffmpeg): update #if guards * Put OpenCL related code under HAVE_OPENCL; simplify reuse of media context from OpenCL context * videoio(test): skip unsupported tests - plugins don't support OpenCL/UMat yet - change handling of *_USE_OPENCL flag * videoio(ffmpeg): OpenCL dependency * videoio(ffmpeg): MediaSDK/oneVPL dependency * cleanup, logging * cmake: fix handling of 3rdparty interface targets Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
75 lines
2.1 KiB
CMake
75 lines
2.1 KiB
CMake
set(MFX_DEFS "")
|
|
|
|
if(NOT HAVE_MFX)
|
|
find_package(VPL QUIET)
|
|
if(VPL_FOUND)
|
|
set(MFX_INCLUDE_DIRS "")
|
|
set(MFX_LIBRARIES "${VPL_IMPORTED_TARGETS}")
|
|
set(HAVE_MFX TRUE)
|
|
list(APPEND MFX_DEFS "HAVE_ONEVPL")
|
|
endif()
|
|
endif()
|
|
|
|
|
|
if(NOT HAVE_MFX)
|
|
set(paths "${MFX_HOME}" ENV "MFX_HOME" ENV "INTELMEDIASDKROOT")
|
|
if(MSVC)
|
|
if(MSVC_VERSION LESS 1900)
|
|
set(vs_suffix)
|
|
else()
|
|
set(vs_suffix "_vs2015")
|
|
endif()
|
|
if(X86_64)
|
|
set(vs_arch "x64")
|
|
else()
|
|
set(vs_arch "win32")
|
|
endif()
|
|
endif()
|
|
find_path(MFX_INCLUDE mfxdefs.h
|
|
PATHS ${paths}
|
|
PATH_SUFFIXES "include" "include/mfx"
|
|
NO_DEFAULT_PATH)
|
|
find_library(MFX_LIBRARY NAMES mfx libmfx${vs_suffix}
|
|
PATHS ${paths}
|
|
PATH_SUFFIXES "lib64" "lib/lin_x64" "lib/${vs_arch}"
|
|
NO_DEFAULT_PATH)
|
|
if(MFX_INCLUDE AND MFX_LIBRARY)
|
|
set(HAVE_MFX TRUE)
|
|
set(MFX_INCLUDE_DIRS "${MFX_INCLUDE}")
|
|
set(MFX_LIBRARIES "${MFX_LIBRARY}")
|
|
list(APPEND MFX_DEFS "HAVE_MFX_PLUGIN")
|
|
endif()
|
|
endif()
|
|
|
|
if(NOT HAVE_MFX AND PKG_CONFIG_FOUND)
|
|
ocv_check_modules(MFX mfx)
|
|
endif()
|
|
|
|
if(HAVE_MFX AND UNIX)
|
|
foreach(mode NO_DEFAULT_PATH "")
|
|
find_path(MFX_va_INCLUDE va/va.h PATHS ${paths} PATH_SUFFIXES "include" ${mode})
|
|
find_library(MFX_va_LIBRARY va PATHS ${paths} PATH_SUFFIXES "lib64" "lib/lin_x64" ${mode})
|
|
find_library(MFX_va_drm_LIBRARY va-drm PATHS ${paths} PATH_SUFFIXES "lib64" "lib/lin_x64" ${mode})
|
|
if(MFX_va_INCLUDE AND MFX_va_LIBRARY AND MFX_va_drm_LIBRARY)
|
|
list(APPEND MFX_INCLUDE_DIRS "${MFX_va_INCLUDE}")
|
|
list(APPEND MFX_LIBRARIES "${MFX_va_LIBRARY}" "${MFX_va_drm_LIBRARY}")
|
|
# list(APPEND MFX_LIBRARIES "-Wl,--exclude-libs=libmfx")
|
|
break()
|
|
endif()
|
|
unset(MFX_va_INCLUDE CACHE)
|
|
unset(MFX_va_LIBRARY CACHE)
|
|
unset(MFX_va_drm_LIBRARY CACHE)
|
|
endforeach()
|
|
if(NOT(MFX_va_INCLUDE AND MFX_va_LIBRARY AND MFX_va_drm_LIBRARY))
|
|
set(HAVE_MFX FALSE)
|
|
endif()
|
|
|
|
endif()
|
|
|
|
if(HAVE_MFX)
|
|
list(APPEND MFX_DEFS "HAVE_MFX")
|
|
ocv_add_external_target(mediasdk "${MFX_INCLUDE_DIRS}" "${MFX_LIBRARIES}" "${MFX_DEFS}")
|
|
endif()
|
|
|
|
set(HAVE_MFX ${HAVE_MFX} PARENT_SCOPE)
|