Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2019 20:14:57 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r520396 - in head/graphics/opencv: . files
Message-ID:  <201912182014.xBIKEvuW051665@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Wed Dec 18 20:14:57 2019
New Revision: 520396
URL: https://svnweb.freebsd.org/changeset/ports/520396

Log:
  graphics/opencv: expose Intel Quick Sync Video support

Added:
  head/graphics/opencv/files/patch-cmake_OpenCVDetectMediaSDK.cmake   (contents, props changed)
  head/graphics/opencv/files/patch-modules_videoio_src_cap__mfx__reader.cpp   (contents, props changed)
  head/graphics/opencv/files/patch-modules_videoio_src_cap__mfx__writer.cpp   (contents, props changed)
Modified:
  head/graphics/opencv/Makefile   (contents, props changed)

Modified: head/graphics/opencv/Makefile
==============================================================================
--- head/graphics/opencv/Makefile	Wed Dec 18 20:14:47 2019	(r520395)
+++ head/graphics/opencv/Makefile	Wed Dec 18 20:14:57 2019	(r520396)
@@ -90,7 +90,6 @@ CMAKE_ARGS+=	-DWITH_1394:BOOL=OFF \
 		-DWITH_MATLAB:BOOL=OFF \
 		-DWITH_VA:BOOL=OFF \
 		-DWITH_VA_INTEL:BOOL=OFF \
-		-DWITH_MFX:BOOL=OFF \
 		-DWITH_GDAL:BOOL=OFF \
 		-DWITH_GPHOTO2:BOOL=OFF \
 		-DWITH_LAPACK:BOOL=OFF \
@@ -158,7 +157,7 @@ OPTIONS_DEFINE=		EXAMPLES EXTRA_MODULES OPENGL GTK2
 OPTIONS_GROUP=		PERFORMANCE IMAGE VIDEO
 OPTIONS_GROUP_PERFORMANCE=	EIGEN3 OPENCL TBB
 OPTIONS_GROUP_IMAGE=	GDAL GDCM JASPER JPEG OPENEXR PNG TIFF WEBP
-OPTIONS_GROUP_VIDEO=	ARAVIS DC1394 FFMPEG GPHOTO2 GSTREAMER V4L XINE
+OPTIONS_GROUP_VIDEO=	ARAVIS DC1394 FFMPEG GPHOTO2 GSTREAMER MFX V4L XINE
 # EXTRA_MODULES required for libopencv_dnn which is required by py-opencv
 OPTIONS_DEFAULT=	EIGEN3 EXTRA_MODULES FFMPEG JASPER JPEG PNG TIFF WEBP V4L \
 			${MACHINE_CPU:tu}
@@ -207,6 +206,12 @@ GDAL_CMAKE_BOOL=	WITH_GDAL
 GDCM_DESC=		Open source DICOM library
 GDCM_LIB_DEPENDS=	libgdcmMSFF.so:devel/gdcm
 GDCM_CMAKE_BOOL=	WITH_GDCM
+
+MFX_DESC=		Intel MediaSDK (aka Quick Sync Video)
+MFX_LIB_DEPENDS=	libmfx.so:multimedia/intel-media-sdk \
+			libva-drm.so:multimedia/libva
+MFX_CONFIGURE_ENV=	MFX_HOME="${LOCALBASE}"
+MFX_CMAKE_BOOL=		WITH_MFX
 
 OPENEXR_LIB_DEPENDS=	libIlmImf.so:graphics/openexr
 OPENEXR_CMAKE_BOOL=	WITH_OPENEXR

Added: head/graphics/opencv/files/patch-cmake_OpenCVDetectMediaSDK.cmake
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/opencv/files/patch-cmake_OpenCVDetectMediaSDK.cmake	Wed Dec 18 20:14:57 2019	(r520396)
@@ -0,0 +1,14 @@
+--- cmake/OpenCVDetectMediaSDK.cmake.orig	2018-02-23 08:38:33 UTC
++++ cmake/OpenCVDetectMediaSDK.cmake
+@@ -19,9 +19,9 @@ else()
+     # ???
+ endif()
+ 
+-find_path(MFX_INCLUDE mfxdefs.h PATHS "${root}/include" NO_DEFAULT_PATH)
++find_path(MFX_INCLUDE mfxdefs.h PATHS "${root}" PATH_SUFFIXES "include" "include/mfx" NO_DEFAULT_PATH)
+ message(STATUS "MFX_INCLUDE: ${MFX_INCLUDE} (${root}/include)")
+-find_library(MFX_LIBRARY NAMES mfx PATHS "${root}/lib/${arch}" NO_DEFAULT_PATH)
++find_library(MFX_LIBRARY NAMES mfx PATHS "${root}" PATH_SUFFIXES "lib" "lib/${arch}" NO_DEFAULT_PATH)
+ if(MSVC)
+     if(MSVC14)
+         find_library(MFX_LIBRARY NAMES libmfx_vs2015.lib PATHS "${root}/lib/${arch}" NO_DEFAULT_PATH)

Added: head/graphics/opencv/files/patch-modules_videoio_src_cap__mfx__reader.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/opencv/files/patch-modules_videoio_src_cap__mfx__reader.cpp	Wed Dec 18 20:14:57 2019	(r520396)
@@ -0,0 +1,12 @@
+--- modules/videoio/src/cap_mfx_reader.cpp.orig	2018-02-23 08:38:33 UTC
++++ modules/videoio/src/cap_mfx_reader.cpp
+@@ -6,6 +6,9 @@
+ #include "opencv2/core/base.hpp"
+ #include "cap_mfx_common.hpp"
+ #include "opencv2/imgproc/hal/hal.hpp"
++#ifndef _WIN32
++#include <unistd.h> // sleep
++#endif
+ 
+ using namespace cv;
+ using namespace std;

Added: head/graphics/opencv/files/patch-modules_videoio_src_cap__mfx__writer.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/opencv/files/patch-modules_videoio_src_cap__mfx__writer.cpp	Wed Dec 18 20:14:57 2019	(r520396)
@@ -0,0 +1,12 @@
+--- modules/videoio/src/cap_mfx_writer.cpp.orig	2018-02-23 08:38:33 UTC
++++ modules/videoio/src/cap_mfx_writer.cpp
+@@ -6,6 +6,9 @@
+ #include "opencv2/core/base.hpp"
+ #include "cap_mfx_common.hpp"
+ #include "opencv2/imgproc/hal/hal.hpp"
++#ifndef _WIN32
++#include <unistd.h> // sleep
++#endif
+ 
+ using namespace std;
+ using namespace cv;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912182014.xBIKEvuW051665>