From 1f6646af55b51df32ca01d4c4f75bbe0da2f9940 Mon Sep 17 00:00:00 2001 From: Steve Lhomme <robux4@ycbcr.xyz> Date: Tue, 26 May 2020 13:50:15 +0200 Subject: [PATCH] Update libvlc patchset - update mfx so it can build properly for UWP targets --- ...ontrib-mfx-fix-building-for-WinStore.patch | 49 +++++++++++++++ ...ntrib-mfx-fix-compilation-with-clang.patch | 53 ++++++++++++++++ ...ct-winstore-builds-with-a-regular-mi.patch | 62 +++++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 libvlc/patches/0038-contrib-mfx-fix-building-for-WinStore.patch create mode 100644 libvlc/patches/0039-contrib-mfx-fix-compilation-with-clang.patch create mode 100644 libvlc/patches/0040-contrib-mfx-detect-winstore-builds-with-a-regular-mi.patch diff --git a/libvlc/patches/0038-contrib-mfx-fix-building-for-WinStore.patch b/libvlc/patches/0038-contrib-mfx-fix-building-for-WinStore.patch new file mode 100644 index 000000000..36b224203 --- /dev/null +++ b/libvlc/patches/0038-contrib-mfx-fix-building-for-WinStore.patch @@ -0,0 +1,49 @@ +From 5d87e6c69abba53a7d3d4e96fe2fbe128f06d8db Mon Sep 17 00:00:00 2001 +From: Steve Lhomme <robux4@ycbcr.xyz> +Date: Wed, 6 Mar 2019 13:08:06 +0100 +Subject: [PATCH 38/40] contrib: mfx: fix building for WinStore + +(cherry picked from commit 7ef64712d411c7d621e92e9753224f8b9c1f7086) +--- + contrib/src/mfx/rules.mak | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/contrib/src/mfx/rules.mak b/contrib/src/mfx/rules.mak +index 2b4fbad702..bef7aa37a6 100644 +--- a/contrib/src/mfx/rules.mak ++++ b/contrib/src/mfx/rules.mak +@@ -1,7 +1,7 @@ + # mfx (Media SDK) + + mfx_GITURL := https://github.com/lu-zero/mfx_dispatch.git +-MFX_GITHASH := b3b0bc9524a8a936fb1b80ca2db45566feb2e868 ++MFX_GITHASH := 612558419be4889ac6d059516457e83c163edcd2 + + ifeq ($(call need_pkg,"mfx"),) + PKGS_FOUND += mfx +@@ -10,6 +10,14 @@ ifdef HAVE_WIN32 + PKGS += mfx + endif + ++MFX_CFLAGS := $(CFLAGS) ++MFX_CXXFLAGS := $(CFLAGS) ++ ++ifdef HAVE_WINSTORE ++MFX_CFLAGS += -DMEDIASDK_UWP_LOADER -DMEDIASDK_UWP_PROCTABLE ++MFX_CXXFLAGS += -DMEDIASDK_UWP_LOADER -DMEDIASDK_UWP_PROCTABLE ++endif ++ + $(TARBALLS)/mfx-$(MFX_GITHASH).tar.xz: + $(call download_git,$(mfx_GITURL),,$(MFX_GITHASH)) + +@@ -23,6 +31,6 @@ mfx: mfx-$(MFX_GITHASH).tar.xz .sum-mfx + $(MOVE) + + .mfx: mfx +- cd $< && $(HOSTVARS) ./configure $(HOSTCONF) ++ cd $< && $(HOSTVARS) CFLAGS="$(MFX_CFLAGS)" CXXFLAGS="$(MFX_CXXFLAGS)" ./configure $(HOSTCONF) + cd $< && $(MAKE) install + touch $@ +-- +2.26.0.windows.1 + diff --git a/libvlc/patches/0039-contrib-mfx-fix-compilation-with-clang.patch b/libvlc/patches/0039-contrib-mfx-fix-compilation-with-clang.patch new file mode 100644 index 000000000..9c64980e6 --- /dev/null +++ b/libvlc/patches/0039-contrib-mfx-fix-compilation-with-clang.patch @@ -0,0 +1,53 @@ +From 4f20b711bc6f3ce3f9a9b4b7cb6f8b13c196e412 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme <robux4@ycbcr.xyz> +Date: Thu, 21 Mar 2019 09:12:03 +0100 +Subject: [PATCH 39/40] contrib: mfx: fix compilation with clang + +(cherry picked from commit 2c4b1e008f02b63ab2b290890d9a83fac1b3632e) +--- + contrib/src/mfx/mfx-cpp11-fix.patch | 20 ++++++++++++++++++++ + contrib/src/mfx/rules.mak | 1 + + 2 files changed, 21 insertions(+) + create mode 100644 contrib/src/mfx/mfx-cpp11-fix.patch + +diff --git a/contrib/src/mfx/mfx-cpp11-fix.patch b/contrib/src/mfx/mfx-cpp11-fix.patch +new file mode 100644 +index 0000000000..dff7503376 +--- /dev/null ++++ b/contrib/src/mfx/mfx-cpp11-fix.patch +@@ -0,0 +1,20 @@ ++--- mfx/src/mfx_plugin_hive.cpp.cpp11 2019-03-20 09:52:12.000000000 +0100 +++++ mfx/src/mfx_plugin_hive.cpp 2019-03-21 09:08:20.825840300 +0100 ++@@ -169,7 +169,7 @@ MFX::MFXPluginsInHive::MFXPluginsInHive( ++ ++ if (QueryKey(subKey, CodecIDKeyName, descriptionRecord.CodecId)) ++ { ++- TRACE_HIVE_INFO(alignStr()" : "MFXFOURCCTYPE()" \n", CodecIDKeyName, MFXU32TOFOURCC(descriptionRecord.CodecId)); +++ TRACE_HIVE_INFO(alignStr()" : " MFXFOURCCTYPE() " \n", CodecIDKeyName, MFXU32TOFOURCC(descriptionRecord.CodecId)); ++ } ++ else ++ { ++@@ -180,7 +180,7 @@ MFX::MFXPluginsInHive::MFXPluginsInHive( ++ { ++ continue; ++ } ++- TRACE_HIVE_INFO(alignStr()" : "MFXGUIDTYPE()"\n", GUIDKeyName, MFXGUIDTOHEX(&descriptionRecord.PluginUID)); +++ TRACE_HIVE_INFO(alignStr()" : " MFXGUIDTYPE() "\n", GUIDKeyName, MFXGUIDTOHEX(&descriptionRecord.PluginUID)); ++ ++ mfxU32 nSize = sizeof(descriptionRecord.sPath)/sizeof(*descriptionRecord.sPath); ++ if (!subKey.Query(PathKeyName, descriptionRecord.sPath, nSize)) +diff --git a/contrib/src/mfx/rules.mak b/contrib/src/mfx/rules.mak +index bef7aa37a6..510383e786 100644 +--- a/contrib/src/mfx/rules.mak ++++ b/contrib/src/mfx/rules.mak +@@ -27,6 +27,7 @@ $(TARBALLS)/mfx-$(MFX_GITHASH).tar.xz: + + mfx: mfx-$(MFX_GITHASH).tar.xz .sum-mfx + $(UNPACK) ++ $(APPLY) $(SRC)/mfx/mfx-cpp11-fix.patch + cd $(UNPACK_DIR) && autoreconf -ivf + $(MOVE) + +-- +2.26.0.windows.1 + diff --git a/libvlc/patches/0040-contrib-mfx-detect-winstore-builds-with-a-regular-mi.patch b/libvlc/patches/0040-contrib-mfx-detect-winstore-builds-with-a-regular-mi.patch new file mode 100644 index 000000000..1ce6e5d35 --- /dev/null +++ b/libvlc/patches/0040-contrib-mfx-detect-winstore-builds-with-a-regular-mi.patch @@ -0,0 +1,62 @@ +From 36daa1a676c134eb02fb1499eb373620bf605997 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme <robux4@ycbcr.xyz> +Date: Thu, 14 May 2020 10:01:26 +0200 +Subject: [PATCH 40/40] contrib: mfx: detect winstore builds with a regular + mingw32 toolchain + +Forcing the WINAPI_FAMILY should be enough to trigger the winstore mode. +--- + contrib/src/mfx/mfx-detect-uwp.patch | 23 +++++++++++++++++++++++ + contrib/src/mfx/rules.mak | 2 ++ + 2 files changed, 25 insertions(+) + create mode 100644 contrib/src/mfx/mfx-detect-uwp.patch + +diff --git a/contrib/src/mfx/mfx-detect-uwp.patch b/contrib/src/mfx/mfx-detect-uwp.patch +new file mode 100644 +index 0000000000..0817993bfe +--- /dev/null ++++ b/contrib/src/mfx/mfx-detect-uwp.patch +@@ -0,0 +1,23 @@ ++--- mfx/configure.ac.winapifamily 2020-05-14 09:59:09.687298300 +0200 +++++ mfx/configure.ac 2020-05-14 09:59:36.091781200 +0200 ++@@ -35,6 +35,20 @@ AS_CASE([${host_os}], ++ AM_CONDITIONAL([WINDOWS_STORE], [true]) ++ DLLIB="$(DLLIB) -ldxgi" ++ ], +++ [mingw32], [ +++ AC_PREPROC_IFELSE([AC_LANG_PROGRAM( +++ [[#include <winapifamily.h> +++ #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) +++ # error Win32 Desktop build +++ #endif +++ ]],[[;]]) +++ ],[ +++ AM_CONDITIONAL([WINDOWS_STORE], [true]) +++ DLLIB="$(DLLIB) -ldxgi" +++ ],[ +++ AM_CONDITIONAL([WINDOWS_STORE], [false]) +++ ]) +++ ], ++ [ ++ AM_CONDITIONAL([WINDOWS_STORE], [false]) ++ ] +diff --git a/contrib/src/mfx/rules.mak b/contrib/src/mfx/rules.mak +index 510383e786..622097464a 100644 +--- a/contrib/src/mfx/rules.mak ++++ b/contrib/src/mfx/rules.mak +@@ -28,10 +28,12 @@ $(TARBALLS)/mfx-$(MFX_GITHASH).tar.xz: + mfx: mfx-$(MFX_GITHASH).tar.xz .sum-mfx + $(UNPACK) + $(APPLY) $(SRC)/mfx/mfx-cpp11-fix.patch ++ $(APPLY) $(SRC)/mfx/mfx-detect-uwp.patch + cd $(UNPACK_DIR) && autoreconf -ivf + $(MOVE) + + .mfx: mfx ++ $(RECONF) + cd $< && $(HOSTVARS) CFLAGS="$(MFX_CFLAGS)" CXXFLAGS="$(MFX_CXXFLAGS)" ./configure $(HOSTCONF) + cd $< && $(MAKE) install + touch $@ +-- +2.26.0.windows.1 + -- GitLab