Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2019 06:13:53 +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: r520364 - in head/multimedia: . ffmpeg gstreamer1-plugins gstreamer1-plugins-msdk intel-media-sdk intel-media-sdk/files
Message-ID:  <201912180613.xBI6DrA4055395@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Wed Dec 18 06:13:52 2019
New Revision: 520364
URL: https://svnweb.freebsd.org/changeset/ports/520364

Log:
  multimedia/intel-media-sdk: add new port
  
  Intel(R) Media SDK provides a plain C API to access hardware-accelerated
  video decode, encode and filtering on Intel(R) Gen graphics hardware
  platforms. Implementation written in C++ 11 with parts in C-for-Media (CM).
  
  Supported video encoders: HEVC, AVC, MPEG-2, JPEG, VP9 Supported video
  decoders: HEVC, AVC, VP8, VP9, MPEG-2, VC1, JPEG Supported video
  pre-processing filters: Color Conversion, Deinterlace, Denoise, Resize,
  Rotate, Composition
  
  http://mediasdk.intel.com/

Added:
  head/multimedia/gstreamer1-plugins-msdk/
  head/multimedia/gstreamer1-plugins-msdk/Makefile   (contents, props changed)
  head/multimedia/intel-media-sdk/
  head/multimedia/intel-media-sdk/Makefile   (contents, props changed)
  head/multimedia/intel-media-sdk/distinfo   (contents, props changed)
  head/multimedia/intel-media-sdk/files/
  head/multimedia/intel-media-sdk/files/patch-includes   (contents, props changed)
  head/multimedia/intel-media-sdk/files/patch-libc++   (contents, props changed)
  head/multimedia/intel-media-sdk/files/patch-memalign   (contents, props changed)
  head/multimedia/intel-media-sdk/files/patch-sched   (contents, props changed)
  head/multimedia/intel-media-sdk/files/patch-sysinfo   (contents, props changed)
  head/multimedia/intel-media-sdk/files/patch-unix   (contents, props changed)
  head/multimedia/intel-media-sdk/pkg-descr   (contents, props changed)
  head/multimedia/intel-media-sdk/pkg-plist   (contents, props changed)
Modified:
  head/multimedia/Makefile   (contents, props changed)
  head/multimedia/ffmpeg/Makefile   (contents, props changed)
  head/multimedia/gstreamer1-plugins/Makefile.common   (contents, props changed)

Modified: head/multimedia/Makefile
==============================================================================
--- head/multimedia/Makefile	Wed Dec 18 05:42:09 2019	(r520363)
+++ head/multimedia/Makefile	Wed Dec 18 06:13:52 2019	(r520364)
@@ -136,6 +136,7 @@
     SUBDIR += gstreamer1-plugins-mpeg2dec
     SUBDIR += gstreamer1-plugins-mpeg2enc
     SUBDIR += gstreamer1-plugins-mplex
+    SUBDIR += gstreamer1-plugins-msdk
     SUBDIR += gstreamer1-plugins-openh264
     SUBDIR += gstreamer1-plugins-resindvd
     SUBDIR += gstreamer1-plugins-rtmp
@@ -162,6 +163,7 @@
     SUBDIR += handbrake
     SUBDIR += harvid
     SUBDIR += imagination
+    SUBDIR += intel-media-sdk
     SUBDIR += iriverter
     SUBDIR += iso2mkv
     SUBDIR += jmref

Modified: head/multimedia/ffmpeg/Makefile
==============================================================================
--- head/multimedia/ffmpeg/Makefile	Wed Dec 18 05:42:09 2019	(r520363)
+++ head/multimedia/ffmpeg/Makefile	Wed Dec 18 06:13:52 2019	(r520364)
@@ -85,9 +85,9 @@ OPTIONS_RADIO_SSL=	GNUTLS MBEDTLS OPENSSL
 OPTIONS_GROUP=	LICENSE
 OPTIONS_GROUP_LICENSE=	GPL3 NONFREE
 
-OPTIONS_DEFINE_amd64=	BEIGNET MMX SSE SVTAV1 SVTHEVC SVTVP9
+OPTIONS_DEFINE_amd64=	BEIGNET MFX MMX SSE SVTAV1 SVTHEVC SVTVP9
 OPTIONS_DEFINE_armv6=	VFP NEON
-OPTIONS_DEFINE_i386=	BEIGNET MMX SSE
+OPTIONS_DEFINE_i386=	BEIGNET MFX MMX SSE
 OPTIONS_DEFAULT_amd64=	MMX SSE
 OPTIONS_DEFAULT_i386=	MMX SSE
 
@@ -111,6 +111,7 @@ KLVANC_DESC=	Kernel Labs VANC processing
 KVAZAAR_DESC=	H.265 video codec support via Kvazaar
 LICENSE_DESC=	Licensing options
 LV2_DESC=	LV2 audio filtering
+MFX_DESC=	Intel MediaSDK (aka Quick Sync Video)
 MYSOFA_DESC=	SOFAlizer binaural filter
 NEON_DESC=	Media Processing Engine instructions
 NONFREE_DESC=	Allow use of nonfree code
@@ -329,6 +330,10 @@ V4L_CONFIGURE_OFF=		--disable-indev=v4l2 \
 # mbedtls
 MBEDTLS_LIB_DEPENDS=	libmbedtls.so:security/mbedtls
 MBEDTLS_CONFIGURE_ENABLE=	mbedtls
+
+# mfx
+MFX_LIB_DEPENDS=	libmfx.so:multimedia/intel-media-sdk
+MFX_CONFIGURE_ENABLE=	libmfx
 
 # mmx support
 MMX_CONFIGURE_ENABLE=	mmx

Added: head/multimedia/gstreamer1-plugins-msdk/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/gstreamer1-plugins-msdk/Makefile	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+PORTREVISION=	0
+CATEGORIES=	multimedia
+
+COMMENT=	GStreamer (Intel MediaSDK) plugin
+
+GST_PLUGIN=	msdk
+DIST=		bad
+
+MASTERDIR=	${.CURDIR}/../../multimedia/gstreamer1-plugins
+
+.include "${MASTERDIR}/Makefile"

Modified: head/multimedia/gstreamer1-plugins/Makefile.common
==============================================================================
--- head/multimedia/gstreamer1-plugins/Makefile.common	Wed Dec 18 05:42:09 2019	(r520363)
+++ head/multimedia/gstreamer1-plugins/Makefile.common	Wed Dec 18 06:13:52 2019	(r520364)
@@ -44,6 +44,7 @@ BAD_GST_ALL_PLUGINS+= \
 		modplug \
 		mpeg2enc \
 		mplex \
+		msdk \
 		musepack \
 		neon \
 		ofa \
@@ -83,7 +84,6 @@ BAD_GST_NON_PLUGINS= \
 		--disable-directfb \
 		--disable-direct3d \
 		--disable-directsound \
-		--disable-msdk \
 		--disable-nvenc \
 		--disable-nvdec \
 		--disable-sbc \
@@ -360,6 +360,12 @@ gst_mplex_LIB_DEPENDS=	libmplex2.so:multimedia/mjpegto
 
 # mpg123
 gst_mpg123_LIB_DEPENDS=	libmpg123.so:audio/mpg123
+
+# msdk
+gst_msdk_LIB_DEPENDS=	libgudev-1.0.so:devel/libgudev \
+			libmfx.so:multimedia/intel-media-sdk \
+			libva-drm.so:multimedia/libva
+gst_msdk_GST_PLUGIN_DIR=	sys/msdk
 
 # musepack
 gst_musepack_LIB_DEPENDS=libmpcdec.so:audio/musepack

Added: head/multimedia/intel-media-sdk/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/Makefile	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,69 @@
+# $FreeBSD$
+
+PORTNAME=	intel-media-sdk
+DISTVERSIONPREFIX=	intel-mediasdk-
+DISTVERSION=	19.4.pre2
+CATEGORIES=	multimedia
+
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
+PATCHFILES+=	9d26f179cd95.patch:-p1 # https://github.com/Intel-Media-SDK/MediaSDK/pull/1846
+
+MAINTAINER=	jbeich@FreeBSD.org
+COMMENT=	Hardware video decoding/encoding/filtering on Intel GPUs
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+ONLY_FOR_ARCHS=	amd64 i386
+ONLY_FOR_ARCHS_REASON=	Only Intel GPUs on x86 are supported
+
+LIB_DEPENDS=	libva.so:multimedia/libva
+
+USES=		cmake compiler:c++11-lib pkgconfig
+USE_GITHUB=	yes
+USE_LDCONFIG=	yes
+GH_ACCOUNT=	Intel-Media-SDK
+GH_PROJECT=	MediaSDK
+CMAKE_ON=	BUILD_TOOLS
+PLIST_SUB=	ARCH_SUFX=${ARCH:S/i386/32/:S/amd//:S/x86_//}
+# https://github.com/Intel-Media-SDK/MediaSDK/issues/1844
+LLD_UNSAFE=	yes
+
+OPTIONS_DEFINE=	OPENCL TEST WAYLAND X11
+OPTIONS_DEFAULT=OPENCL WAYLAND X11
+OPTIONS_SUB=	yes
+
+OPENCL_BUILD_DEPENDS=	${LOCALBASE}/include/CL/opencl.h:devel/opencl
+OPENCL_LIB_DEPENDS=	libOpenCL.so:devel/ocl-icd
+OPENCL_CMAKE_BOOL=	ENABLE_OPENCL
+
+X11_BUILD_DEPENDS=	${LOCALBASE}/include/xcb/dri3.h:x11/libxcb
+X11_LIB_DEPENDS=	libva-x11.so:multimedia/libva
+X11_CMAKE_BOOL=		ENABLE_X11 ENABLE_X11_DRI3
+
+WAYLAND_LIB_DEPENDS=	libdrm_intel.so:graphics/libdrm \
+			libwayland-client.so:graphics/wayland
+WAYLAND_CMAKE_BOOL=	ENABLE_WAYLAND
+
+TEST_BUILD_DEPENDS=	googlemock>0:devel/googlemock
+TEST_USES=		localbase:ldflags
+TEST_CMAKE_BOOL=	BUILD_TESTS USE_SYSTEM_GTEST
+TEST_TEST_TARGET=	test
+
+post-patch:
+# Pick git commit from port and use reproducible time
+	@${REINPLACE_CMD} -e "/COMMAND/s/date/& -r `${AWK} '/TIMESTAMP/ \
+			{ print \$$3 }' ${DISTINFO_FILE}`/" \
+		-e '/set( git_commit/s/""/"${DISTVERSIONFULL}"/' \
+		${WRKSRC}/builder/FindFunctions.cmake \
+		${WRKSRC}/builder/FindGlobals.cmake
+# Don't depend on lang/intel-compute-runtime during build
+	@${REINPLACE_CMD} -e 's,/etc[^[:space:]]*,/,' \
+		${WRKSRC}/builder/FindOpenCL.cmake
+# Don't assume GCC and glibc libraries are available
+	@${REINPLACE_CMD} -e 's/ -lstdc++ -ldl//' \
+		${WRKSRC}/api/mfx_dispatch/linux/pkg-config*.cmake
+
+pre-install-TEST-on: do-test
+
+.include <bsd.port.mk>

Added: head/multimedia/intel-media-sdk/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/distinfo	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,5 @@
+TIMESTAMP = 1572465370
+SHA256 (Intel-Media-SDK-MediaSDK-intel-mediasdk-19.4.pre2_GH0.tar.gz) = 4f8817a692c8408ff59df61ad4eaed8a981868a8889fdfd5829894c3755ff0f8
+SIZE (Intel-Media-SDK-MediaSDK-intel-mediasdk-19.4.pre2_GH0.tar.gz) = 9445416
+SHA256 (9d26f179cd95.patch) = c9670dfb46d613ff1ced24c26b6debcdcde9a0fcec84b61da6e30f602d2bc121
+SIZE (9d26f179cd95.patch) = 1477

Added: head/multimedia/intel-media-sdk/files/patch-includes
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/files/patch-includes	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,28 @@
+Add missing includes in various places.
+
+tutorials/common/common_vaapi.cpp:100:17: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
+    std::string adapterPath = DRI_PATH;
+                ^
+/usr/include/c++/v1/iosfwd:209:32: note: template is declared here
+    class _LIBCPP_TEMPLATE_VIS basic_string;
+                               ^
+tutorials/common/common_vaapi.cpp:107:57: error: no member named 'to_string' in namespace 'std'
+        std::string curAdapterPath = adapterPath + std::to_string(nodeIndex + i);
+                                                   ~~~~~^
+tutorials/common/common_vaapi.cpp:107:21: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
+        std::string curAdapterPath = adapterPath + std::to_string(nodeIndex + i);
+                    ^
+/usr/include/c++/v1/iosfwd:209:32: note: template is declared here
+    class _LIBCPP_TEMPLATE_VIS basic_string;
+                               ^
+
+--- tutorials/common/common_vaapi.cpp.orig	2019-10-30 19:56:10 UTC
++++ tutorials/common/common_vaapi.cpp
+@@ -22,6 +22,7 @@
+ #include <drm.h>
+ #include <drm_fourcc.h>
+ #include <map>
++#include <string>
+ 
+ #include "common_vaapi.h"
+ 

Added: head/multimedia/intel-media-sdk/files/patch-libc++
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/files/patch-libc++	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,30 @@
+https://github.com/Intel-Media-SDK/MediaSDK/issues/1843
+
+--- samples/sample_hevc_fei_abr/include/dso/bs_reader2.h.orig	2019-10-30 19:56:10 UTC
++++ samples/sample_hevc_fei_abr/include/dso/bs_reader2.h
+@@ -184,7 +184,11 @@ class File : public BufferUpdater (public)
+ 
+ #define BS2_TRO
+ #define BS2_SET(val, var) { var = (val); }
++#ifdef _LIBCPP_VERSION
++#define BS2_TRACE(val, var) {}
++#else
+ #define BS2_TRACE(val, var) {std::ignore = (val);}
++#endif
+ #define BS2_TRACE_STR(str) {std::ignore = (str);}
+ #define BS2_SET_ARR_F(val, var, sz, split, format) \
+     { for (Bs32u _i = 0; _i < (Bs32u)(sz); _i++) (var)[_i] = (val); }
+--- tools/bs_parser_hevc/include/bs_reader2.h.orig	2019-10-30 19:56:10 UTC
++++ tools/bs_parser_hevc/include/bs_reader2.h
+@@ -184,7 +184,11 @@ class File : public BufferUpdater (public)
+ 
+ #define BS2_TRO
+ #define BS2_SET(val, var) { var = (val); }
++#ifdef _LIBCPP_VERSION
++#define BS2_TRACE(val, var) {}
++#else
+ #define BS2_TRACE(val, var) {std::ignore = (val);}
++#endif
+ #define BS2_TRACE_STR(str) {std::ignore = (str);}
+ #define BS2_SET_ARR_F(val, var, sz, split, format) \
+     { for (Bs32u _i = 0; _i < (Bs32u)(sz); _i++) (var)[_i] = (val); }

Added: head/multimedia/intel-media-sdk/files/patch-memalign
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/files/patch-memalign	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,85 @@
+memalign is Linux-specific, so use C11 aligned_alloc instead.
+
+In file included from _studio/shared/asc/src/tree.cpp:20:
+In file included from _studio/shared/asc/src/../include/tree.h:23:
+In file included from _studio/shared/asc/include/asc_structures.h:34:
+In file included from _studio/shared/asc/../../mfx_lib/cmrt_cross_platform/include/cmrt_cross_platform.h:151:
+/usr/include/malloc.h:3:2: error: "<malloc.h> has been replaced by <stdlib.h>"
+#error "<malloc.h> has been replaced by <stdlib.h>"
+ ^
+In file included from _studio/shared/asc/src/tree.cpp:20:
+In file included from _studio/shared/asc/src/../include/tree.h:23:
+In file included from _studio/shared/asc/include/asc_structures.h:34:
+_studio/shared/asc/../../mfx_lib/cmrt_cross_platform/include/cmrt_cross_platform.h:264:12: error: use of undeclared identifier 'memalign'
+    return memalign(alignment, size);
+           ^
+
+--- _studio/mfx_lib/cmrt_cross_platform/include/cmrt_cross_platform.h.orig	2019-10-30 19:56:10 UTC
++++ _studio/mfx_lib/cmrt_cross_platform/include/cmrt_cross_platform.h
+@@ -148,7 +148,6 @@ struct ID3D11Device;
+ #include <stdlib.h>
+ #include <stdint.h>
+ #include <math.h>
+-#include <malloc.h>
+ #include <string.h>
+ #include <sys/time.h>
+ #include <pthread.h>
+@@ -261,7 +260,7 @@ template<> inline const char * CM_TYPE_NAME_UNMANGLED<
+ 
+ inline void * CM_ALIGNED_MALLOC(size_t size, size_t alignment)
+ {
+-    return memalign(alignment, size);
++    return aligned_alloc(alignment, size);
+ }
+ 
+ inline void CM_ALIGNED_FREE(void * memory)
+--- _studio/shared/asc/src/asc.cpp.orig	2019-10-30 19:56:10 UTC
++++ _studio/shared/asc/src/asc.cpp
+@@ -103,12 +103,12 @@ mfxStatus ASCimageData::InitFrame(ASCImDetails *pDetai
+     Image.U = NULL;
+     Image.V = NULL;
+     //Memory Allocation
+-    Image.data = (mfxU8*)memalign(0x1000, imageSpaceSize);
+-    SAD = (mfxU16 *)memalign(0x1000, sizeof(mfxU16) * mvSpaceSize);
+-    Rs = (mfxU16 *)memalign(0x1000, sizeof(mfxU16) * texSpaceSize);
+-    Cs = (mfxU16 *)memalign(0x1000, sizeof(mfxU16) * texSpaceSize);
+-    RsCs = (mfxU16 *)memalign(0x1000, sizeof(mfxU16) * texSpaceSize);
+-    pInteger = (ASCMVector *)memalign(0x1000, sizeof(ASCMVector)  * mvSpaceSize);
++    Image.data = (mfxU8*)aligned_alloc(0x1000, imageSpaceSize);
++    SAD = (mfxU16 *)aligned_alloc(0x1000, sizeof(mfxU16) * mvSpaceSize);
++    Rs = (mfxU16 *)aligned_alloc(0x1000, sizeof(mfxU16) * texSpaceSize);
++    Cs = (mfxU16 *)aligned_alloc(0x1000, sizeof(mfxU16) * texSpaceSize);
++    RsCs = (mfxU16 *)aligned_alloc(0x1000, sizeof(mfxU16) * texSpaceSize);
++    pInteger = (ASCMVector *)aligned_alloc(0x1000, sizeof(ASCMVector)  * mvSpaceSize);
+     if (Image.data == NULL)
+         return MFX_ERR_MEMORY_ALLOC;
+     //Pointer conf.
+@@ -145,7 +145,7 @@ mfxStatus ASCimageData::InitAuxFrame(ASCImDetails *pDe
+     Image.U = NULL;
+     Image.V = NULL;
+     //Memory Allocation
+-    Image.data = (mfxU8*)memalign(0x1000, imageSpaceSize);
++    Image.data = (mfxU8*)aligned_alloc(0x1000, imageSpaceSize);
+     if (Image.data == NULL)
+         return MFX_ERR_MEMORY_ALLOC;
+     //Pointer conf.
+@@ -415,7 +415,7 @@ mfxStatus ASC::VidSample_Alloc() {
+         res = m_device->GetSurface2DInfo(m_gpuwidth, m_gpuheight, CM_SURFACE_FORMAT_NV12, m_gpuImPitch, physicalSize);
+         SCD_CHECK_CM_ERR(res, MFX_ERR_DEVICE_FAILED);
+         m_frameBkp = nullptr;
+-        m_frameBkp = (mfxU8*)memalign(0x1000, physicalSize);
++        m_frameBkp = (mfxU8*)aligned_alloc(0x1000, physicalSize);
+         if (m_frameBkp == nullptr)
+             return MFX_ERR_MEMORY_ALLOC;
+         memset(m_frameBkp, 0, physicalSize);
+--- tutorials/common/ocl_process.cpp.orig	2019-10-30 19:56:10 UTC
++++ tutorials/common/ocl_process.cpp
+@@ -21,7 +21,7 @@
+ #include "ocl_process.h"
+ 
+ #include <stdio.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ 
+ #include <CL/opencl.h>
+ #include <CL/cl_dx9_media_sharing.h>

Added: head/multimedia/intel-media-sdk/files/patch-sched
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/files/patch-sched	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,33 @@
+Disable non-POSIX scheduling policies if not supported
+
+samples/sample_common/src/vm/thread_linux.cpp:257:16: error: use of undeclared identifier 'SCHED_BATCH'
+        type = SCHED_BATCH;
+               ^
+samples/sample_common/src/vm/thread_linux.cpp:260:16: error: use of undeclared identifier 'SCHED_IDLE'
+        type = SCHED_IDLE;
+               ^
+
+--- samples/sample_common/src/vm/thread_linux.cpp.orig	2019-10-30 19:56:10 UTC
++++ samples/sample_common/src/vm/thread_linux.cpp
+@@ -253,15 +253,21 @@ mfxStatus msdk_thread_get_schedtype(const msdk_char* s
+     else if (!msdk_strcmp(str, MSDK_STRING("other"))) {
+         type = SCHED_OTHER;
+     }
++#ifdef SCHED_BATCH
+     else if (!msdk_strcmp(str, MSDK_STRING("batch"))) {
+         type = SCHED_BATCH;
+     }
++#endif
++#ifdef SCHED_IDLE
+     else if (!msdk_strcmp(str, MSDK_STRING("idle"))) {
+         type = SCHED_IDLE;
+     }
++#endif
++//#ifdef SCHED_DEADLINE
+ //    else if (!msdk_strcmp(str, MSDK_STRING("deadline"))) {
+ //        type = SCHED_DEADLINE;
+ //    }
++//#endif
+     else {
+         return MFX_ERR_UNSUPPORTED;
+     }

Added: head/multimedia/intel-media-sdk/files/patch-sysinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/files/patch-sysinfo	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,17 @@
+sysinfo doesn't exist outside of Linux unlike sysconf.
+
+_studio/shared/umc/core/vm/src/vm_sys_info_linux32.c:28:10: fatal error: 'sys/sysinfo.h' file not found
+#include <sys/sysinfo.h>
+         ^~~~~~~~~~~~~~~
+
+--- _studio/shared/umc/core/vm/src/vm_sys_info_linux32.c.orig	2019-10-30 19:56:10 UTC
++++ _studio/shared/umc/core/vm/src/vm_sys_info_linux32.c
+@@ -25,8 +25,6 @@
+ #include <sys/utsname.h>
+ #include <unistd.h>
+ 
+-#include <sys/sysinfo.h>
+-
+ uint32_t vm_sys_info_get_cpu_num(void)
+ {
+ #if defined(ANDROID)

Added: head/multimedia/intel-media-sdk/files/patch-unix
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/files/patch-unix	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,147 @@
+Relax Linux checks for the code works on any non-Windows platform.
+
+In file included from _studio/shared/umc/core/umc/src/umc_va_base.cpp:21:
+In file included from _studio/shared/umc/core/umc/include/umc_va_base.h:25:
+In file included from _studio/shared/include/mfx_common.h:27:
+In file included from _studio/shared/include/mfx_utils.h:29:
+_studio/shared/umc/core/umc/include/umc_structures.h:658:11: error: unknown type name 'vm_char'
+    const vm_char* GetErrString(Status ErrCode);
+          ^
+_studio/shared/umc/core/umc/include/umc_structures.h:659:11: error: unknown type name 'vm_char'
+    const vm_char* GetStreamTypeString(SystemStreamType Code);
+          ^
+_studio/shared/umc/core/umc/include/umc_structures.h:660:11: error: unknown type name 'vm_char'
+    const vm_char* GetFormatTypeString(ColorFormat Code);
+          ^
+_studio/shared/umc/core/umc/include/umc_structures.h:661:11: error: unknown type name 'vm_char'
+    const vm_char* GetAudioTypeString(AudioStreamType Code);
+          ^
+_studio/shared/umc/core/umc/include/umc_structures.h:662:11: error: unknown type name 'vm_char'
+    const vm_char* GetVideoTypeString(VideoStreamType Code);
+          ^
+_studio/shared/umc/core/umc/include/umc_structures.h:663:11: error: unknown type name 'vm_char'
+    const vm_char* GetVideoRenderTypeString(VideoRenderType Code);
+          ^
+_studio/shared/umc/core/umc/include/umc_structures.h:664:11: error: unknown type name 'vm_char'
+    const vm_char* GetAudioRenderTypeString(AudioRenderType Code);
+          ^
+In file included from _studio/shared/umc/core/umc/src/umc_va_base.cpp:21:
+_studio/shared/umc/core/umc/include/umc_va_base.h:36:6: error: unsupported platform
+    #error unsupported platform
+     ^
+_studio/shared/umc/core/umc/include/umc_va_base.h:48:10: fatal error: 'va/va.h' file not found
+#include <va/va.h>
+         ^~~~~~~~~
+
+--- CMakeLists.txt.orig	2019-10-30 19:56:10 UTC
++++ CMakeLists.txt
+@@ -57,7 +57,7 @@ option( ENABLE_OPENCL "Build targets dependent on Open
+ #
+ option( ENABLE_ALL "Enable all dependencies and features?" OFF )
+ 
+-if( CMAKE_SYSTEM_NAME MATCHES Linux )
++if( UNIX AND NOT APPLE )
+   option( ENABLE_X11_DRI3 "Build X11 DRI3 versions of the targets?" ${ENABLE_ALL} )
+   option( ENABLE_WAYLAND "Build WAYLAND versions of the targets?" ${ENABLE_ALL} )
+ endif()
+@@ -191,7 +191,7 @@ message("  CMAKE_INSTALL_FULL_LIBDIR               : $
+ message("  CMAKE_INSTALL_FULL_DATADIR              : ${CMAKE_INSTALL_FULL_DATADIR}")
+ message("Enable:")
+ message("  ENABLE_OPENCL                           : ${ENABLE_OPENCL}")
+-if( CMAKE_SYSTEM_NAME MATCHES Linux )
++if( UNIX AND NOT APPLE )
+   message("  ENABLE_X11                              : ${ENABLE_X11}")
+   message("  ENABLE_X11_DRI3                         : ${ENABLE_X11_DRI3}")
+   message("  ENABLE_WAYLAND                          : ${ENABLE_WAYLAND}")
+--- _studio/mfx_lib/shared/include/mediasdk_version.h.orig	2019-10-30 19:56:10 UTC
++++ _studio/mfx_lib/shared/include/mediasdk_version.h
+@@ -23,7 +23,7 @@
+ #pragma once
+ 
+ /* These string constants set Media SDK version information for Linux, Android, OSX. */
+-#ifdef __linux__
++#if !defined(__APPLE__) && !defined(_WIN32)
+ #include "va/va.h"
+ 
+ #ifndef MFX_API_VERSION
+@@ -55,4 +55,4 @@ const char* g_MfxGitCommit       = "mediasdk_git_commi
+ const char* g_MfxBuildInfo       = "mediasdk_build_info: " MFX_BUILD_INFO;
+ const char* g_MfxLibvaVersion    = "mediasdk_libva_version: " VA_VERSION_S;
+ 
+-#endif // __linux__
++#endif // #if !__APPLE__ && !_WIN32
+--- api/include/mfxdefs.h.orig	2019-10-30 19:56:10 UTC
++++ api/include/mfxdefs.h
+@@ -79,7 +79,7 @@ extern "C"
+     #define MFX_PACK_BEGIN_STRUCT_W_PTR()    MFX_PACK_BEGIN_X(8)
+     #define MFX_PACK_BEGIN_STRUCT_W_L_TYPE() MFX_PACK_BEGIN_X(8)
+ /* 32-bit ILP32 data model Windows (Intel architecture) */
+-#elif defined(_WIN32) || defined(_M_IX86) && !defined(__linux__)
++#elif defined(_WIN32)
+     #define MFX_PACK_BEGIN_STRUCT_W_PTR()    MFX_PACK_BEGIN_X(4)
+     #define MFX_PACK_BEGIN_STRUCT_W_L_TYPE() MFX_PACK_BEGIN_X(8)
+ /* 32-bit ILP32 data model Linux */
+--- api/mfx_dispatch/linux/CMakeLists.txt.orig	2019-10-30 19:56:10 UTC
++++ api/mfx_dispatch/linux/CMakeLists.txt
+@@ -58,7 +58,7 @@ message( STATUS "MFX_MODULES_DIR=${MFX_MODULES_DIR}" )
+ 
+ add_definitions(-DUNIX)
+ 
+-if( CMAKE_SYSTEM_NAME MATCHES Linux )
++if( UNIX AND NOT APPLE )
+   add_definitions(-D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 -DLINUX -DLINUX32)
+ 
+   if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+--- builder/FindFunctions.cmake.orig	2019-10-30 19:56:10 UTC
++++ builder/FindFunctions.cmake
+@@ -29,14 +29,14 @@ function( collect_oses )
+     set( NotLinux   true PARENT_SCOPE )
+     set( NotDarwin  true PARENT_SCOPE )
+ 
+-  elseif( CMAKE_SYSTEM_NAME MATCHES Linux )
+-    set( Linux      true PARENT_SCOPE )
+-    set( NotDarwin  true PARENT_SCOPE )
+-    set( NotWindows true PARENT_SCOPE )
+-
+   elseif( CMAKE_SYSTEM_NAME MATCHES Darwin )
+     set( Darwin     true PARENT_SCOPE )
+     set( NotLinux   true PARENT_SCOPE )
++    set( NotWindows true PARENT_SCOPE )
++
++  else()
++    set( Linux      true PARENT_SCOPE )
++    set( NotDarwin  true PARENT_SCOPE )
+     set( NotWindows true PARENT_SCOPE )
+ 
+   endif()
+--- tutorials/common/cmd_options.cpp.orig	2019-10-30 19:56:10 UTC
++++ tutorials/common/cmd_options.cpp
+@@ -24,7 +24,7 @@
+ 
+ #if defined(_WIN32) || defined(_WIN64)
+ #include "bits/windows_defs.h"
+-#elif defined(__linux__)
++#else
+ #include "bits/linux_defs.h"
+ #endif
+ 
+--- tutorials/common/common_utils.h.orig	2019-10-30 19:56:10 UTC
++++ tutorials/common/common_utils.h
+@@ -32,7 +32,7 @@
+ //  - MSDK_SLEEP
+ #if defined(_WIN32) || defined(_WIN64)
+ #include "bits/windows_defs.h"
+-#elif defined(__linux__)
++#else
+ #include "bits/linux_defs.h"
+ #endif
+ 
+--- samples/CMakeLists.txt.orig	2019-10-30 19:56:10 UTC
++++ samples/CMakeLists.txt
+@@ -30,4 +30,6 @@ add_subdirectory(sample_misc/wayland)
+ add_subdirectory(sample_plugins/rotate_cpu)
+ add_subdirectory(sample_plugins/rotate_opencl)
+ add_subdirectory(sample_plugins/vpp_plugin)
++if( CMAKE_SYSTEM_NAME MATCHES Linux )
+ add_subdirectory(metrics_monitor)
++endif()

Added: head/multimedia/intel-media-sdk/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/pkg-descr	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,10 @@
+Intel(R) Media SDK provides a plain C API to access hardware-accelerated
+video decode, encode and filtering on Intel(R) Gen graphics hardware
+platforms. Implementation written in C++ 11 with parts in C-for-Media (CM).
+
+Supported video encoders: HEVC, AVC, MPEG-2, JPEG, VP9 Supported video
+decoders: HEVC, AVC, VP8, VP9, MPEG-2, VC1, JPEG Supported video
+pre-processing filters: Color Conversion, Deinterlace, Denoise, Resize,
+Rotate, Composition
+
+WWW: http://mediasdk.intel.com/

Added: head/multimedia/intel-media-sdk/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/intel-media-sdk/pkg-plist	Wed Dec 18 06:13:52 2019	(r520364)
@@ -0,0 +1,59 @@
+bin/asg-hevc
+bin/hevc_fei_extractor
+include/mfx/mfxadapter.h
+include/mfx/mfxastructures.h
+include/mfx/mfxaudio++.h
+include/mfx/mfxaudio.h
+include/mfx/mfxbrc.h
+include/mfx/mfxcamera.h
+include/mfx/mfxcommon.h
+include/mfx/mfxdefs.h
+include/mfx/mfxdispatcherprefixedfunctions.h
+include/mfx/mfxenc.h
+include/mfx/mfxfei.h
+include/mfx/mfxfeihevc.h
+include/mfx/mfxjpeg.h
+include/mfx/mfxla.h
+include/mfx/mfxmvc.h
+include/mfx/mfxpak.h
+include/mfx/mfxpcp.h
+include/mfx/mfxplugin++.h
+include/mfx/mfxplugin.h
+include/mfx/mfxsc.h
+include/mfx/mfxscd.h
+include/mfx/mfxsession.h
+include/mfx/mfxstructures.h
+include/mfx/mfxvideo++.h
+include/mfx/mfxvideo.h
+include/mfx/mfxvp8.h
+include/mfx/mfxvp9.h
+include/mfx/mfxvstructures.h
+lib/libmfx.so
+lib/libmfx.so.1
+lib/libmfx.so.1.30
+lib/libmfxhw%%ARCH_SUFX%%.so
+lib/libmfxhw%%ARCH_SUFX%%.so.1
+lib/libmfxhw%%ARCH_SUFX%%.so.1.30
+lib/mfx/libmfx_h264la_hw%%ARCH_SUFX%%.so
+lib/mfx/libmfx_hevc_fei_hw%%ARCH_SUFX%%.so
+lib/mfx/libmfx_hevcd_hw%%ARCH_SUFX%%.so
+lib/mfx/libmfx_hevce_hw%%ARCH_SUFX%%.so
+lib/mfx/libmfx_vp8d_hw%%ARCH_SUFX%%.so
+lib/mfx/libmfx_vp9d_hw%%ARCH_SUFX%%.so
+lib/mfx/libmfx_vp9e_hw%%ARCH_SUFX%%.so
+libdata/pkgconfig/libmfx.pc
+libdata/pkgconfig/libmfxhw%%ARCH_SUFX%%.pc
+libdata/pkgconfig/mfx.pc
+share/mfx/plugins.cfg
+%%WAYLAND%%share/mfx/samples/libmfx_wayland.so
+%%OPENCL%%share/mfx/samples/libsample_plugin_opencl.so
+share/mfx/samples/libsample_rotate_plugin.so
+share/mfx/samples/libvpp_plugin.a
+%%OPENCL%%share/mfx/samples/ocl_rotate.cl
+share/mfx/samples/sample_decode
+share/mfx/samples/sample_encode
+share/mfx/samples/sample_fei
+share/mfx/samples/sample_hevc_fei
+share/mfx/samples/sample_hevc_fei_abr
+share/mfx/samples/sample_multi_transcode
+share/mfx/samples/sample_vpp



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