aboutsummaryrefslogtreecommitdiff
path: root/multimedia/intel-media-sdk
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2019-12-18 06:13:52 +0000
committerJan Beich <jbeich@FreeBSD.org>2019-12-18 06:13:52 +0000
commit41a9ac7e3f29ce4b8321559b659ab526b8a0ed4d (patch)
tree4f0aeb8a1f65a77fd51e494b72178fa783c42729 /multimedia/intel-media-sdk
parent12595774297cb507d9d63ff26def15d7a852f516 (diff)
downloadports-41a9ac7e3f29ce4b8321559b659ab526b8a0ed4d.tar.gz
ports-41a9ac7e3f29ce4b8321559b659ab526b8a0ed4d.zip
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/
Notes
Notes: svn path=/head/; revision=520364
Diffstat (limited to 'multimedia/intel-media-sdk')
-rw-r--r--multimedia/intel-media-sdk/Makefile69
-rw-r--r--multimedia/intel-media-sdk/distinfo5
-rw-r--r--multimedia/intel-media-sdk/files/patch-includes28
-rw-r--r--multimedia/intel-media-sdk/files/patch-libc++30
-rw-r--r--multimedia/intel-media-sdk/files/patch-memalign85
-rw-r--r--multimedia/intel-media-sdk/files/patch-sched33
-rw-r--r--multimedia/intel-media-sdk/files/patch-sysinfo17
-rw-r--r--multimedia/intel-media-sdk/files/patch-unix147
-rw-r--r--multimedia/intel-media-sdk/pkg-descr10
-rw-r--r--multimedia/intel-media-sdk/pkg-plist59
10 files changed, 483 insertions, 0 deletions
diff --git a/multimedia/intel-media-sdk/Makefile b/multimedia/intel-media-sdk/Makefile
new file mode 100644
index 000000000000..65a2b7eaa8b3
--- /dev/null
+++ b/multimedia/intel-media-sdk/Makefile
@@ -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>
diff --git a/multimedia/intel-media-sdk/distinfo b/multimedia/intel-media-sdk/distinfo
new file mode 100644
index 000000000000..3c09b367fcc4
--- /dev/null
+++ b/multimedia/intel-media-sdk/distinfo
@@ -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
diff --git a/multimedia/intel-media-sdk/files/patch-includes b/multimedia/intel-media-sdk/files/patch-includes
new file mode 100644
index 000000000000..8da0d3bcde3c
--- /dev/null
+++ b/multimedia/intel-media-sdk/files/patch-includes
@@ -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"
+
diff --git a/multimedia/intel-media-sdk/files/patch-libc++ b/multimedia/intel-media-sdk/files/patch-libc++
new file mode 100644
index 000000000000..22228eab652a
--- /dev/null
+++ b/multimedia/intel-media-sdk/files/patch-libc++
@@ -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); }
diff --git a/multimedia/intel-media-sdk/files/patch-memalign b/multimedia/intel-media-sdk/files/patch-memalign
new file mode 100644
index 000000000000..9e3fcf8fc2a4
--- /dev/null
+++ b/multimedia/intel-media-sdk/files/patch-memalign
@@ -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>
diff --git a/multimedia/intel-media-sdk/files/patch-sched b/multimedia/intel-media-sdk/files/patch-sched
new file mode 100644
index 000000000000..9664408fd769
--- /dev/null
+++ b/multimedia/intel-media-sdk/files/patch-sched
@@ -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;
+ }
diff --git a/multimedia/intel-media-sdk/files/patch-sysinfo b/multimedia/intel-media-sdk/files/patch-sysinfo
new file mode 100644
index 000000000000..ef3f12856ec3
--- /dev/null
+++ b/multimedia/intel-media-sdk/files/patch-sysinfo
@@ -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)
diff --git a/multimedia/intel-media-sdk/files/patch-unix b/multimedia/intel-media-sdk/files/patch-unix
new file mode 100644
index 000000000000..65b0ddf167c2
--- /dev/null
+++ b/multimedia/intel-media-sdk/files/patch-unix
@@ -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()
diff --git a/multimedia/intel-media-sdk/pkg-descr b/multimedia/intel-media-sdk/pkg-descr
new file mode 100644
index 000000000000..dd3ac896e038
--- /dev/null
+++ b/multimedia/intel-media-sdk/pkg-descr
@@ -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/
diff --git a/multimedia/intel-media-sdk/pkg-plist b/multimedia/intel-media-sdk/pkg-plist
new file mode 100644
index 000000000000..54291d735e0e
--- /dev/null
+++ b/multimedia/intel-media-sdk/pkg-plist
@@ -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