[vlc-commits] [Git][videolan/vlc][3.0.x] 8 commits: d3d11: read the adapter description when reading the driver version
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Oct 4 07:16:28 UTC 2024
Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC
Commits:
9b7b520e by Steve Lhomme at 2024-10-01T08:39:23+02:00
d3d11: read the adapter description when reading the driver version
So we have all the information about the adapter.
- - - - -
27ff7bd5 by Steve Lhomme at 2024-10-01T08:39:23+02:00
d3d11_fmt: use CheckInterfaceSupport() to get the driver version
It works well with WDDM 2.3 and above. Otherwise we fallback to the old
way.
(cherry picked from commit d48871ba62dbdd2c0be59195d2f91d3e31ba6523) (edited)
edited:
- on 3.0 we use C
- on 3.0 the call is done outside of the adapter setup
- - - - -
e2be4359 by Sean McGovern at 2024-10-01T08:55:41+02:00
contrib/amf: remove old SHA512SUMS entry
(cherry picked from commit 7d1e89fc10f1758a40062c92c6658fb54ea411b6)
- - - - -
e3ebd51a by Steve Lhomme at 2024-10-01T08:55:41+02:00
contrib: amf: update to 1.4.34
It now comes with a nicer header-only package.
(cherry picked from commit fb18df85ca73deffe66bb83a06fd09bb9de4b09d)
- - - - -
d73f972f by Steve Lhomme at 2024-10-01T08:55:41+02:00
hw/amf: let the AMF system know what version was used to compile
With future drivers and old binaries it may trigger different code
pathes than the latest version.
(cherry picked from commit e1c9c361849e6042185d123ab559d14fa7d7e8e3)
- - - - -
ceaddfac by Steve Lhomme at 2024-10-01T08:55:41+02:00
configure: detect AMD FRC.h
(cherry picked from commit c2256ac9717eba469479fd6052db2286fc45d0ae) (edited)
edited:
- add a define to be able to conditionally use the code.
- - - - -
585f2c88 by Steve Lhomme at 2024-10-01T16:44:16+02:00
video_filter: add AMD FRC filter
(cherry picked from commit 44833103120be4b98d8869a4fe5f3a68eb0442c2) (edited)
edited:
- on 3.0 the D3D11 filters are in a single DLL
- on 3.0 add_bool has an extra parameter
- on 3.0 the output pictures come from filter_NewPicture()
- on 3.0 there is no vlc_filter_operations
- on 3.0 there is no video context
- on 3.0 there is no vlc_picture_chain_AppendChain()
- - - - -
2f6a5082 by Steve Lhomme at 2024-10-01T16:44:16+02:00
video_output: allow the AMD FRC filter as a static filter
"Interactive" filters can only do one output per input.
Only "static" filters are allowed to generate more frames, like the deinterlacers.
There is no way at this point to probe the module that will be used
if it will output many frames or not. And even if it could the order of
filters would need to be respected. We cannot dynamically add filters
on one chain or the other.
(cherry picked from commit b3379d35c9794b93f1558c06852174145c48da39)
- - - - -
19 changed files:
- configure.ac
- − contrib/src/amf/0001-Differentiate-the-AMF_NO_VTABLE-based-on-the-compile.patch
- − contrib/src/amf/0001-Don-t-cast-amf_int64-when-using-a-format-string.patch
- − contrib/src/amf/0001-Fix-const-on-return-by-value-AMF_DECLARE_IID.patch
- − contrib/src/amf/0001-Fix-warning-when-_MSC_VER-is-not-defined.patch
- contrib/src/amf/0001-Move-AMF_UNICODE-into-Platform.h.patch
- contrib/src/amf/0002-Define-LPRI-d-ud-x-64-as-Unicode-wide-versions-of-AM.patch
- − contrib/src/amf/0002-Fix-const-on-return-by-value-Variant-values.patch
- contrib/src/amf/0003-Define-AMFPRI-d-ud-x-64-using-the-standard-C-format-.patch
- contrib/src/amf/SHA512SUMS
- contrib/src/amf/rules.mak
- modules/hw/amf/amf_helper.c
- modules/hw/d3d11/Makefile.am
- modules/hw/d3d11/d3d11_filters.c
- modules/hw/d3d11/d3d11_filters.h
- modules/hw/d3d11/d3d11_instance.c
- modules/video_chroma/d3d11_fmt.c
- + modules/video_filter/amf_frc.c
- src/video_output/video_output.c
Changes:
=====================================
configure.ac
=====================================
@@ -1967,6 +1967,17 @@ AS_IF([test "$enable_amf_enhancer" != "no"], [
])
AM_CONDITIONAL([HAVE_AMF_ENHANCER], [test "${have_amf_enhancer}" != "no"])
+AC_ARG_ENABLE([amf-frc], AS_HELP_STRING([--disable-amf-frc],
+ [disable AMD FRC (default auto)]))
+have_amf_frc="no"
+AS_IF([test "$enable_amf_frc" != "no"], [
+ AC_CHECK_HEADERS([AMF/core/PropertyStorage.h AMF/components/FRC.h], [
+ have_amf_frc="yes"
+ AC_DEFINE(HAVE_AMF_FRC, 1, AMD Frame Rate Conversion supported)
+ ])
+])
+AM_CONDITIONAL([HAVE_AMF_FRC], [test "${have_amf_frc}" != "no"])
+
dnl
dnl special access module for Blackmagic SDI cards
dnl
=====================================
contrib/src/amf/0001-Differentiate-the-AMF_NO_VTABLE-based-on-the-compile.patch deleted
=====================================
@@ -1,47 +0,0 @@
-From cf190d084644d3d3e2ea1ffbb740ad8e7aede760 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at videolabs.io>
-Date: Fri, 16 Feb 2024 08:18:19 +0100
-Subject: [PATCH] Differentiate the AMF_NO_VTABLE based on the compiler
-
-This is a Microsoft specific extension: https://learn.microsoft.com/en-us/cpp/cpp/novtable
-Clang and gcc can compile for Windows but don't support this.
----
- amf/public/include/core/Platform.h | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/amf/public/include/core/Platform.h b/amf/public/include/core/Platform.h
-index d6496d4..378f789 100644
---- a/amf/public/include/core/Platform.h
-+++ b/amf/public/include/core/Platform.h
-@@ -100,6 +100,12 @@ typedef signed int HRESULT;
- #include <stdint.h>
- #include <string.h>
-
-+#if defined(_MSC_VER)
-+ #define AMF_NO_VTABLE __declspec(novtable)
-+#else
-+ #define AMF_NO_VTABLE
-+#endif
-+
- #if defined(_WIN32)
-
-
-@@ -116,7 +122,6 @@ typedef signed int HRESULT;
- #define AMF_INLINE __inline
- #define AMF_FORCEINLINE __forceinline
- #endif
-- #define AMF_NO_VTABLE __declspec(novtable)
-
- #else // !WIN32 - Linux and Mac
-
-@@ -130,7 +135,6 @@ typedef signed int HRESULT;
- #define AMF_INLINE __inline__
- #define AMF_FORCEINLINE __inline__
- #endif
-- #define AMF_NO_VTABLE
-
- #endif // WIN32
-
---
-2.37.3.windows.1
-
=====================================
contrib/src/amf/0001-Don-t-cast-amf_int64-when-using-a-format-string.patch deleted
=====================================
@@ -1,34 +0,0 @@
-From e5498eb5e82c54c93fdd56127a8bb6dc96961e46 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at videolabs.io>
-Date: Fri, 16 Feb 2024 08:05:13 +0100
-Subject: [PATCH] Don't cast amf_int64 when using a format string
-
-The format string is designed to match amf_int64.
----
- amf/public/include/core/Variant.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/amf/public/include/core/Variant.h b/amf/public/include/core/Variant.h
-index edf14ae..a44fbf5 100644
---- a/amf/public/include/core/Variant.h
-+++ b/amf/public/include/core/Variant.h
-@@ -872,14 +872,14 @@ namespace amf
- {
- res = AMF_OK;
- char buff[0xFF];
-- sprintf(buff, "%" AMFPRId64, (long long)value);
-+ sprintf(buff, "%" AMFPRId64, value);
- return buff;
- }
- static AMF_INLINE AMFVariant::WString AMFConvertInt64ToWString(amf_int64 value, AMF_RESULT& res)
- {
- res = AMF_OK;
- wchar_t buff[0xFF];
-- swprintf(buff, 0xFF, L"%" LPRId64, (long long)value);
-+ swprintf(buff, 0xFF, L"%" LPRId64, value);
- return buff;
- }
-
---
-2.37.3.windows.1
-
=====================================
contrib/src/amf/0001-Fix-const-on-return-by-value-AMF_DECLARE_IID.patch deleted
=====================================
@@ -1,29 +0,0 @@
-From 17cc77f3185ca562c7c0aa4e439c8f4bace1360a Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at videolabs.io>
-Date: Fri, 16 Feb 2024 08:12:20 +0100
-Subject: [PATCH 1/2] Fix const on return by value AMF_DECLARE_IID()
-
-The returned value won't be const in C.
-
-Fixes this kind of warning:
-include/AMF/core/../components/Component.h:326:5: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
----
- amf/public/include/core/Interface.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/amf/public/include/core/Interface.h b/amf/public/include/core/Interface.h
-index 9ac7e41..96117f0 100644
---- a/amf/public/include/core/Interface.h
-+++ b/amf/public/include/core/Interface.h
-@@ -49,7 +49,7 @@ namespace amf
- }
- #else
- #define AMF_DECLARE_IID(name, _data1, _data2, _data3, _data41, _data42, _data43, _data44, _data45, _data46, _data47, _data48) \
-- AMF_INLINE static const AMFGuid IID_##name(void) \
-+ AMF_INLINE static AMFGuid IID_##name(void) \
- { \
- AMFGuid uid = {_data1, _data2, _data3, _data41, _data42, _data43, _data44, _data45, _data46, _data47, _data48}; \
- return uid; \
---
-2.37.3.windows.1
-
=====================================
contrib/src/amf/0001-Fix-warning-when-_MSC_VER-is-not-defined.patch deleted
=====================================
@@ -1,52 +0,0 @@
-From 6c26950f67fb07550b86f3064fb0f7b7b53eec5d Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at videolabs.io>
-Date: Fri, 16 Feb 2024 08:57:46 +0100
-Subject: [PATCH] Fix warning when _MSC_VER is not defined
-
----
- amf/public/include/core/Variant.h | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/amf/public/include/core/Variant.h b/amf/public/include/core/Variant.h
-index edf14ae..879f092 100644
---- a/amf/public/include/core/Variant.h
-+++ b/amf/public/include/core/Variant.h
-@@ -365,7 +365,7 @@ namespace amf
- operator=(p_other);
- }
-
--#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (_MSC_VER >= 1600)
-+#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (defined(_MSC_VER) && _MSC_VER >= 1600)
- #pragma warning (push)
- #pragma warning (disable : 26439) //This kind of function may not throw. Declare it 'noexcept'.
- String(String&& p_other) : m_Str(nullptr)
-@@ -393,7 +393,7 @@ namespace amf
- m_Str = AMFVariantDuplicateString(p_other.m_Str);
- return *this;
- }
--#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (_MSC_VER >= 1600)
-+#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (defined(_MSC_VER) && _MSC_VER >= 1600)
- String& operator=(String&& p_other)
- {
- Free();
-@@ -475,7 +475,7 @@ namespace amf
- {
- operator=(p_other);
- }
--#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (_MSC_VER >= 1600)
-+#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (defined(_MSC_VER) && _MSC_VER >= 1600)
- WString(WString&& p_other) : m_Str(nullptr)
- {
- operator=(p_other);
-@@ -492,7 +492,7 @@ namespace amf
- m_Str = AMFVariantDuplicateWString(p_other.m_Str);
- return *this;
- }
--#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (_MSC_VER >= 1600)
-+#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X) || (defined(_MSC_VER) && _MSC_VER >= 1600)
- WString& operator=(WString&& p_other)
- {
- Free();
---
-2.37.3.windows.1
-
=====================================
contrib/src/amf/0001-Move-AMF_UNICODE-into-Platform.h.patch
=====================================
@@ -1,17 +1,17 @@
-From a9ee7691cf2535f58695769893e92a634f810523 Mon Sep 17 00:00:00 2001
+From 56828b95fc427e8475d0a03ac016fa7edcc0dfc8 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4 at videolabs.io>
Date: Fri, 16 Feb 2024 07:43:32 +0100
-Subject: [PATCH 1/4] Move AMF_UNICODE into Platform.h
+Subject: [PATCH 1/3] Move AMF_UNICODE into Platform.h
It's a common macro that can be used in other places.
---
- amf/public/include/core/Platform.h | 14 ++++++++++++++
- 2 files changed, 14 insertions(+), 14 deletions(-)
+ core/Platform.h | 14 ++++
+ 1 files changed, 14 insertions(+), 0 deletions(-)
-diff --git a/amf/public/include/core/Platform.h b/amf/public/include/core/Platform.h
-index 3f997fe..cdab1b2 100644
---- a/amf/public/include/core/Platform.h
-+++ b/amf/public/include/core/Platform.h
+diff --git a/core/Platform.h b/core/Platform.h
+index 35cbc9a..2ced091 100644
+--- a/core/Platform.h
++++ b/core/Platform.h
@@ -66,6 +66,20 @@
#define AMF_TODO(_todo) (__FILE__ "(" AMF_MACRO_STRING(__LINE__) "): TODO: "_todo)
@@ -34,5 +34,5 @@ index 3f997fe..cdab1b2 100644
#if defined(__GNUC__) || defined(__clang__)
#define AMF_ALIGN(n) __attribute__((aligned(n)))
--
-2.37.3.windows.1
+2.45.0.windows.1
=====================================
contrib/src/amf/0002-Define-LPRI-d-ud-x-64-as-Unicode-wide-versions-of-AM.patch
=====================================
@@ -1,20 +1,20 @@
-From 7a0df0c174dce8d383be26e7b96d410865c62cf1 Mon Sep 17 00:00:00 2001
+From a2c7dbd97a22febdb19b8a82cfea4fda7af0d4b6 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4 at videolabs.io>
Date: Fri, 16 Feb 2024 07:45:25 +0100
-Subject: [PATCH 2/4] Define LPRI(d|ud|x)64 as Unicode (wide) versions of
+Subject: [PATCH 2/3] Define LPRI(d|ud|x)64 as Unicode (wide) versions of
AMFPRI(d|ud|x)64
It's always true for all platforms.
---
- amf/public/include/core/Platform.h | 10 ++++------
- 1 file changed, 4 insertions(+), 6 deletions(-)
+ core/Platform.h | 27 ++++-----------------------
+ 1 file changed, 4 insertions(+), 23 deletions(-)
-diff --git a/amf/public/include/core/Platform.h b/amf/public/include/core/Platform.h
-index cdab1b2..12ee75c 100644
---- a/amf/public/include/core/Platform.h
-+++ b/amf/public/include/core/Platform.h
-@@ -119,13 +119,10 @@ typedef signed int HRESULT;
- #define AMF_NO_VTABLE __declspec(novtable)
+diff --git a/core/Platform.h b/core/Platform.h
+index 2ced091..12541f3 100644
+--- a/core/Platform.h
++++ b/core/Platform.h
+@@ -124,13 +110,10 @@ typedef signed int HRESULT;
+ #endif
#define AMFPRId64 "I64d"
- #define LPRId64 L"I64d"
@@ -27,9 +27,18 @@ index cdab1b2..12ee75c 100644
#else // !WIN32 - Linux and Mac
-@@ -143,17 +140,18 @@ typedef signed int HRESULT;
+@@ -147,26 +130,24 @@ typedef signed int HRESULT;
- #if !defined(AMFPRId64)
+ #if defined(__x86_64__) || defined(__aarch64__)
+ #define AMFPRId64 "ld"
+- #define LPRId64 L"ld"
+
+ #define AMFPRIud64 "uld"
+- #define LPRIud64 L"uld"
+
+ #define AMFPRIx64 "lx"
+- #define LPRIx64 L"lx"
+ #else
#define AMFPRId64 "lld"
- #define LPRId64 L"lld"
@@ -50,5 +59,5 @@ index cdab1b2..12ee75c 100644
#if defined(_WIN32)
#define AMF_WEAK __declspec( selectany )
--
-2.37.3.windows.1
+2.45.0.windows.1
=====================================
contrib/src/amf/0002-Fix-const-on-return-by-value-Variant-values.patch deleted
=====================================
@@ -1,49 +0,0 @@
-From 18c87b557f7d5b9f1850a66705b551ac482e47e3 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at videolabs.io>
-Date: Fri, 16 Feb 2024 08:50:28 +0100
-Subject: [PATCH 2/2] Fix const on return by value Variant values
-
-Fix const on return by value AMF_DECLARE_IID()
-
-The returned value won't be const in C.
-
-Fixes this kind of warning:
-include/AMF/core/Variant.h:135:23: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
----
- amf/public/include/core/Variant.h | 20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/amf/public/include/core/Variant.h b/amf/public/include/core/Variant.h
-index edf14ae..a0a7eb8 100644
---- a/amf/public/include/core/Variant.h
-+++ b/amf/public/include/core/Variant.h
-@@ -132,16 +132,16 @@ namespace amf
- static AMF_INLINE const AMFRatio& AMF_STD_CALL AMFVariantGetRatio(const AMFVariantStruct* _variant) { return (_variant)->ratioValue; }
- static AMF_INLINE const AMFColor& AMF_STD_CALL AMFVariantGetColor(const AMFVariantStruct* _variant) { return (_variant)->colorValue; }
- #else // #if defined(__cplusplus)
-- static AMF_INLINE const AMFRect AMF_STD_CALL AMFVariantGetRect (const AMFVariantStruct* _variant) { return (_variant)->rectValue; }
-- static AMF_INLINE const AMFSize AMF_STD_CALL AMFVariantGetSize (const AMFVariantStruct* _variant) { return (_variant)->sizeValue; }
-- static AMF_INLINE const AMFPoint AMF_STD_CALL AMFVariantGetPoint(const AMFVariantStruct* _variant) { return (_variant)->pointValue; }
-- static AMF_INLINE const AMFFloatSize AMF_STD_CALL AMFVariantGetFloatSize(const AMFVariantStruct* _variant) { return (_variant)->floatSizeValue; }
-- static AMF_INLINE const AMFFloatPoint2D AMF_STD_CALL AMFVariantGetFloatPoint2D(const AMFVariantStruct* _variant) { return (_variant)->floatPoint2DValue; }
-- static AMF_INLINE const AMFFloatPoint3D AMF_STD_CALL AMFVariantGetFloatPoint3D(const AMFVariantStruct* _variant) { return (_variant)->floatPoint3DValue; }
-- static AMF_INLINE const AMFFloatVector4D AMF_STD_CALL AMFVariantGetFloatVector4D(const AMFVariantStruct* _variant) { return (_variant)->floatVector4DValue; }
-- static AMF_INLINE const AMFRate AMF_STD_CALL AMFVariantGetRate (const AMFVariantStruct* _variant) { return (_variant)->rateValue; }
-- static AMF_INLINE const AMFRatio AMF_STD_CALL AMFVariantGetRatio(const AMFVariantStruct* _variant) { return (_variant)->ratioValue; }
-- static AMF_INLINE const AMFColor AMF_STD_CALL AMFVariantGetColor(const AMFVariantStruct* _variant) { return (_variant)->colorValue; }
-+ static AMF_INLINE AMFRect AMF_STD_CALL AMFVariantGetRect (const AMFVariantStruct* _variant) { return (_variant)->rectValue; }
-+ static AMF_INLINE AMFSize AMF_STD_CALL AMFVariantGetSize (const AMFVariantStruct* _variant) { return (_variant)->sizeValue; }
-+ static AMF_INLINE AMFPoint AMF_STD_CALL AMFVariantGetPoint(const AMFVariantStruct* _variant) { return (_variant)->pointValue; }
-+ static AMF_INLINE AMFFloatSize AMF_STD_CALL AMFVariantGetFloatSize(const AMFVariantStruct* _variant) { return (_variant)->floatSizeValue; }
-+ static AMF_INLINE AMFFloatPoint2D AMF_STD_CALL AMFVariantGetFloatPoint2D(const AMFVariantStruct* _variant) { return (_variant)->floatPoint2DValue; }
-+ static AMF_INLINE AMFFloatPoint3D AMF_STD_CALL AMFVariantGetFloatPoint3D(const AMFVariantStruct* _variant) { return (_variant)->floatPoint3DValue; }
-+ static AMF_INLINE AMFFloatVector4D AMF_STD_CALL AMFVariantGetFloatVector4D(const AMFVariantStruct* _variant) { return (_variant)->floatVector4DValue; }
-+ static AMF_INLINE AMFRate AMF_STD_CALL AMFVariantGetRate (const AMFVariantStruct* _variant) { return (_variant)->rateValue; }
-+ static AMF_INLINE AMFRatio AMF_STD_CALL AMFVariantGetRatio(const AMFVariantStruct* _variant) { return (_variant)->ratioValue; }
-+ static AMF_INLINE AMFColor AMF_STD_CALL AMFVariantGetColor(const AMFVariantStruct* _variant) { return (_variant)->colorValue; }
- #endif // #if defined(__cplusplus)
-
-
---
-2.37.3.windows.1
-
=====================================
contrib/src/amf/0003-Define-AMFPRI-d-ud-x-64-using-the-standard-C-format-.patch
=====================================
@@ -1,7 +1,7 @@
-From 4069f86effdc36ba3f12d120212c8f077b96cdb0 Mon Sep 17 00:00:00 2001
+From 3ecced3ba3ad710b6f86104a648f2c1b6dbb86fa Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4 at videolabs.io>
Date: Fri, 16 Feb 2024 07:50:03 +0100
-Subject: [PATCH 3/4] Define AMFPRI(d|ud|x)64 using the standard C++ format for
+Subject: [PATCH 3/3] Define AMFPRI(d|ud|x)64 using the standard C++ format for
C+11 and up
See https://en.cppreference.com/w/cpp/types/integer
@@ -9,16 +9,16 @@ See https://en.cppreference.com/w/cpp/types/integer
When compiled in C, it depends whether it's the Microsoft flavor or the standard C format. Not
whether it's Win32 or not. Clang or GCC use the proper string formats on windows.
---
- amf/public/include/core/Platform.h | 29 ++++++++++++++++++++---------
- 1 file changed, 20 insertions(+), 9 deletions(-)
+ core/Platform.h | 33 +++++++++++++++---------------
+ 1 file changed, 17 insertions(+), 16 deletions(-)
-diff --git a/amf/public/include/core/Platform.h b/amf/public/include/core/Platform.h
-index 12ee75c..d6496d4 100644
---- a/amf/public/include/core/Platform.h
-+++ b/amf/public/include/core/Platform.h
-@@ -118,12 +118,6 @@ typedef signed int HRESULT;
+diff --git a/core/Platform.h b/core/Platform.h
+index 12541f3..a1fa96c 100644
+--- a/core/Platform.h
++++ b/core/Platform.h
+@@ -109,12 +109,6 @@ typedef signed int HRESULT;
+ #define AMF_FORCEINLINE __forceinline
#endif
- #define AMF_NO_VTABLE __declspec(novtable)
- #define AMFPRId64 "I64d"
-
@@ -29,42 +29,45 @@ index 12ee75c..d6496d4 100644
#else // !WIN32 - Linux and Mac
#define AMF_STD_CALL
-@@ -138,15 +132,32 @@ typedef signed int HRESULT;
+@@ -128,21 +122,28 @@ typedef signed int HRESULT;
+ #define AMF_FORCEINLINE __inline__
#endif
- #define AMF_NO_VTABLE
+- #if defined(__x86_64__) || defined(__aarch64__)
+- #define AMFPRId64 "ld"
+#endif // WIN32
-+
+
+- #define AMFPRIud64 "uld"
+#if defined(__cplusplus) && (__cplusplus >= 201103L)
+ #include <cinttypes>
+ #define AMFPRId64 PRId64
-+
+
+- #define AMFPRIx64 "lx"
+- #else
+- #define AMFPRId64 "lld"
+ #define AMFPRIud64 PRIu64
-+
+
+- #define AMFPRIud64 "ulld"
+ #define AMFPRIx64 PRIx64
-+#else
-+#if defined(_MSC_VER)
++#elif defined(_MSC_VER)
+ #define AMFPRId64 "I64d"
-+
-+ #define AMFPRIud64 "Iu64d"
-+
-+ #define AMFPRIx64 "I64x"
-+#else
- #if !defined(AMFPRId64)
- #define AMFPRId64 "lld"
-- #define AMFPRIud64 "ulld"
-+ #define AMFPRIud64 "ulld"
+- #define AMFPRIx64 "llx"
+- #endif
++ #define AMFPRIud64 "Iu64d"
- #define AMFPRIx64 "llx"
- #endif
--
-#endif // WIN32
-+#endif
++ #define AMFPRIx64 "I64x"
++#elif !defined(AMFPRId64)
++ #define AMFPRId64 "lld"
++
++ #define AMFPRIud64 "ulld"
++
++ #define AMFPRIx64 "llx"
+#endif
#define LPRId64 AMF_UNICODE(AMFPRId64)
#define LPRIud64 AMF_UNICODE(AMFPRIud64)
--
-2.37.3.windows.1
+2.45.0.windows.1
=====================================
contrib/src/amf/SHA512SUMS
=====================================
@@ -1 +1 @@
-43d7d3c05cb385cc5b0b76562dae3f8d5fb0123300291019ddce1032eec55a664290bd9b0552073d3a5cc7036886a015d9edb1f17e2f0f8ffd07acf57360ec18 AMF-1.4.29.tar.gz
+2f6e43908260d9f7cb8b28ab8dd34f8f2a1f61c6f2b24d847f277deb264de74d37e60b71e35f6eb079af5c1a16967d0fb780271aee751c18f2013023dcb96f6c AMF-1.4.34.tar.gz
=====================================
contrib/src/amf/rules.mak
=====================================
@@ -1,10 +1,10 @@
# AMF
-AMF_VERSION := 1.4.33
-AMF_URL := $(GITHUB)/GPUOpen-LibrariesAndSDKs/AMF/archive/refs/tags/v$(AMF_VERSION).tar.gz
+AMF_VERSION := 1.4.34
+AMF_URL := $(GITHUB)/GPUOpen-LibrariesAndSDKs/AMF/releases/download/v$(AMF_VERSION)/AMF-headers.tar.gz
AMF_GITURL := $(GITHUB)/GPUOpen-LibrariesAndSDKs/AMF.git
AMF_BRANCH := v$(AMF_VERSION)
-AMF_GITVERSION := e8c7cd7c10d4e05c1913aa8dfd2be9f9dbdb03d6
+AMF_GITVERSION := 6d7bec0469961e2891c6e1aaa5122b76ed82e1db
ifeq ($(ARCH),x86_64)
ifdef HAVE_WIN32
@@ -17,9 +17,14 @@ endif
endif
endif
+$(TARBALLS)/AMF-$(AMF_VERSION).tar.gz:
+ $(call download,$(AMF_URL))
+
+.sum-amf: AMF-$(AMF_VERSION).tar.gz
+
$(TARBALLS)/AMF-$(AMF_GITVERSION).tar.xz:
- rm -rf "$@" "$(@:.tar.xz=.githash)"
- rm -rf "$(@:.tar.xz=)"
+ $(RM) -Rf "$@" "$(@:.tar.xz=.githash)"
+ $(RM) -Rf "$(@:.tar.xz=)"
mkdir "$(@:.tar.xz=)"
# clone the top of the branch and only checkout amf/public/include
cd "$(@:.tar.xz=)" && git clone -n --depth=1 --no-checkout --branch $(AMF_BRANCH) $(AMF_GITURL) "$(notdir $(@:.tar.xz=))"
@@ -28,26 +33,26 @@ $(TARBALLS)/AMF-$(AMF_GITVERSION).tar.xz:
cd "$(@:.tar.xz=)/$(notdir $(@:.tar.xz=))" && echo "`git rev-parse HEAD` $(@)" > "../tmp.githash"
mv -f -- "$(@:.tar.xz=)/tmp.githash" "$(@:.tar.xz=.githash)"
mv -f -- "$(@:.tar.xz=)/$(notdir $(@))" "$@"
- rm -rf "$(@:.tar.xz=)"
+ $(RM) -Rf "$(@:.tar.xz=)"
-.sum-amf: AMF-$(AMF_GITVERSION).tar.xz
- $(call check_githash,$(AMF_GITVERSION))
- touch "$@"
+# .sum-amf: AMF-$(AMF_GITVERSION).tar.xz
+# $(call check_githash,$(AMF_GITVERSION))
+# touch "$@"
-# amf: AMF-$(AMF_VERSION).tar.gz .sum-amf
-amf: AMF-$(AMF_GITVERSION).tar.xz .sum-amf
+amf: AMF-$(AMF_VERSION).tar.gz .sum-amf
+# amf: AMF-$(AMF_GITVERSION).tar.xz .sum-amf
+ $(RM) -Rf AMF
$(UNPACK)
+ # the tarball is extracted to AMF but it the filesystem is case insenstive
+ # we can't move AMF to amf
+ mv -f -- AMF AMF-$(AMF_VERSION)
$(APPLY) $(SRC)/amf/0001-Move-AMF_UNICODE-into-Platform.h.patch
$(APPLY) $(SRC)/amf/0002-Define-LPRI-d-ud-x-64-as-Unicode-wide-versions-of-AM.patch
$(APPLY) $(SRC)/amf/0003-Define-AMFPRI-d-ud-x-64-using-the-standard-C-format-.patch
- $(APPLY) $(SRC)/amf/0001-Don-t-cast-amf_int64-when-using-a-format-string.patch
- $(APPLY) $(SRC)/amf/0001-Differentiate-the-AMF_NO_VTABLE-based-on-the-compile.patch
- $(APPLY) $(SRC)/amf/0001-Fix-const-on-return-by-value-AMF_DECLARE_IID.patch
- $(APPLY) $(SRC)/amf/0002-Fix-const-on-return-by-value-Variant-values.patch
- $(APPLY) $(SRC)/amf/0001-Fix-warning-when-_MSC_VER-is-not-defined.patch
$(MOVE)
.amf: amf
+ $(RM) -Rf $(PREFIX)/include/AMF
mkdir -p $(PREFIX)/include/AMF
- cp -R $(UNPACK_DIR)/amf/public/include/* $(PREFIX)/include/AMF
+ cp -R $</* $(PREFIX)/include/AMF
touch $@
=====================================
modules/hw/amf/amf_helper.c
=====================================
@@ -34,7 +34,7 @@ int vlc_AMFCreateContext(struct vlc_amf_context *c)
c->Context = NULL;
AMFInit_Fn init = (AMFInit_Fn)GetProcAddress(hLib, AMF_INIT_FUNCTION_NAME);
- res = init(c->Version, &c->pFactory); // use the highest possible value for that DLL
+ res = init(AMF_FULL_VERSION, &c->pFactory);
if (unlikely(res != AMF_OK))
goto error;
=====================================
modules/hw/d3d11/Makefile.am
=====================================
@@ -12,10 +12,22 @@ libdirect3d11_filters_plugin_la_LIBADD += -ld3d11
endif
if HAVE_AMF_ENHANCER
-libdirect3d11_filters_plugin_la_SOURCES += video_filter/amf_vqenhancer.c \
- hw/amf/amf_helper.c hw/amf/amf_helper.h
+libdirect3d11_filters_plugin_la_SOURCES += video_filter/amf_vqenhancer.c
endif
+if HAVE_AMF_FRC
+libdirect3d11_filters_plugin_la_SOURCES += video_filter/amf_frc.c
+endif
+
+if HAVE_AMF_ENHANCER
+libdirect3d11_filters_plugin_la_SOURCES += hw/amf/amf_helper.c hw/amf/amf_helper.h
+else
+if HAVE_AMF_FRC
+libdirect3d11_filters_plugin_la_SOURCES += hw/amf/amf_helper.c hw/amf/amf_helper.h
+endif
+endif
+
+
d3d11_LTLIBRARIES = $(LTLIBdirect3d11_filters)
EXTRA_LTLIBRARIES += libdirect3d11_filters_plugin.la
=====================================
modules/hw/d3d11/d3d11_filters.c
=====================================
@@ -671,6 +671,13 @@ vlc_module_begin()
add_shortcut(N_("amf_vqenhancer"))
set_callbacks( D3D11CreateAMFVQE, D3D11CloseAMFVQE )
#endif
+#ifdef HAVE_AMF_FRC
+ add_submodule()
+ set_description(N_("AMD Frame Rate Doubler"))
+ add_shortcut(N_("amf_frc"))
+ set_callbacks( D3D11CreateAMFFRC, D3D11CloseAMFFRC )
+ add_bool( "frc-indicator", false, N_("Show indicator"), NULL, false )
+#endif
add_submodule()
set_capability( "video converter", 10 )
=====================================
modules/hw/d3d11/d3d11_filters.h
=====================================
@@ -35,6 +35,8 @@ int D3D11OpenCPUConverter(vlc_object_t *);
void D3D11CloseCPUConverter(vlc_object_t *);
int D3D11CreateAMFVQE(vlc_object_t *);
void D3D11CloseAMFVQE(vlc_object_t *);
+int D3D11CreateAMFFRC(vlc_object_t *);
+void D3D11CloseAMFFRC(vlc_object_t *);
void D3D11_FilterHoldInstance(filter_t *, d3d11_device_t *, D3D11_TEXTURE2D_DESC *);
void D3D11_FilterReleaseInstance(d3d11_device_t *);
=====================================
modules/hw/d3d11/d3d11_instance.c
=====================================
@@ -83,6 +83,12 @@ void D3D11_FilterHoldInstance(filter_t *filter, d3d11_device_t *out, D3D11_TEXTU
{
ID3D11DeviceContext_AddRef(out->d3dcontext);
ID3D11Device_AddRef(out->d3ddevice);
+ IDXGIAdapter *adap = D3D11DeviceAdapter(out->d3ddevice);
+ if (adap != NULL)
+ {
+ IDXGIAdapter_GetDesc(adap, &out->adapterDesc);
+ IDXGIAdapter_Release(adap);
+ }
D3D11_GetDriverVersion(filter, out);
}
=====================================
modules/video_chroma/d3d11_fmt.c
=====================================
@@ -193,7 +193,7 @@ static HKEY GetAdapterRegistry(vlc_object_t *obj, DXGI_ADAPTER_DESC *adapterDesc
return NULL;
}
-void D3D11_GetDriverVersion(vlc_object_t *obj, d3d11_device_t *d3d_dev)
+static void D3D11_GetSystemDriver(vlc_object_t *obj, d3d11_device_t *d3d_dev)
{
memset(&d3d_dev->WDDM, 0, sizeof(d3d_dev->WDDM));
@@ -235,7 +235,7 @@ void D3D11_GetDriverVersion(vlc_object_t *obj, d3d11_device_t *d3d_dev)
}
}
#else /* VLC_WINSTORE_APP */
-void D3D11_GetDriverVersion(vlc_object_t *obj, d3d11_device_t *d3d_dev)
+static void D3D11_GetSystemDriver(vlc_object_t *obj, d3d11_device_t *d3d_dev)
{
VLC_UNUSED(obj);
VLC_UNUSED(d3d_dev);
@@ -243,6 +243,36 @@ void D3D11_GetDriverVersion(vlc_object_t *obj, d3d11_device_t *d3d_dev)
}
#endif /* VLC_WINSTORE_APP */
+void D3D11_GetDriverVersion(vlc_object_t *obj, d3d11_device_t *d3d_dev)
+{
+ memset(&d3d_dev->WDDM, 0, sizeof(d3d_dev->WDDM));
+
+ LARGE_INTEGER driver = { 0 };
+ HRESULT hr;
+ IDXGIAdapter *pAdapter = D3D11DeviceAdapter(d3d_dev->d3ddevice);
+ hr = IDXGIAdapter_CheckInterfaceSupport(pAdapter, &IID_IDXGIDevice, &driver);
+
+ if (FAILED(hr))
+ {
+ msg_Dbg(obj, "failed to get interface version. (hr=0x%lX)", hr);
+ D3D11_GetSystemDriver(obj, d3d_dev);
+ }
+ else if (HIWORD(driver.HighPart) < 23)
+ // starting with WDDM 2.3 driver versions must be coherent
+ // https://learn.microsoft.com/en-us/windows/win32/api/dxgi/nf-dxgi-idxgiadapter-checkinterfacesupport#parameters
+ {
+ msg_Dbg(obj, "unsupported interface version %" PRIx64, driver.QuadPart);
+ D3D11_GetSystemDriver(obj, d3d_dev);
+ }
+ else
+ {
+ d3d_dev->WDDM.wddm = HIWORD(driver.HighPart);
+ d3d_dev->WDDM.d3d_features = LOWORD(driver.LowPart);
+ d3d_dev->WDDM.revision = HIWORD(driver.LowPart);
+ d3d_dev->WDDM.build = LOWORD(driver.LowPart);
+ }
+}
+
void D3D11_ReleaseDevice(d3d11_device_t *d3d_dev)
{
if (d3d_dev->d3dcontext)
=====================================
modules/video_filter/amf_frc.c
=====================================
@@ -0,0 +1,364 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
+/*****************************************************************************
+ * amf_frc: Frame Rate doubler video with low frame rate
+ *****************************************************************************
+ * Copyright © 2024 Videolabs, VLC authors and VideoLAN
+ *
+ * Authors: Steve Lhomme <robux4 at videolabs.io>
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_filter.h>
+#include <vlc_plugin.h>
+#include <vlc_configuration.h>
+
+#define COBJMACROS
+#include "../hw/amf/amf_helper.h"
+#include <AMF/components/FRC.h>
+
+#include "../video_chroma/d3d11_fmt.h"
+#include "../hw/d3d11/d3d11_filters.h"
+
+#include <assert.h>
+
+static const char *const ppsz_filter_options[] = {
+ "frc-indicator", NULL
+};
+
+struct filter_sys_t
+{
+ d3d11_handle_t hd3d;
+ d3d11_device_t d3d_dev;
+
+ struct vlc_amf_context amf;
+ AMFComponent *amf_frc;
+ AMFSurface *amfInput;
+ const d3d_format_t *cfg;
+
+ enum AMF_FRC_MODE_TYPE mode;
+ bool source_rate;
+ date_t next_output_pts;
+};
+
+static picture_t *PictureFromTexture(filter_t *filter, d3d11_device_t *d3d_dev, ID3D11Texture2D *out)
+{
+ picture_t *p_outpic = filter_NewPicture( filter );
+ if( !p_outpic )
+ {
+ return NULL;
+ }
+ picture_sys_t *src_sys = ActivePictureSys(p_outpic);
+ if (unlikely(!src_sys))
+ {
+ /* the output filter configuration may have changed since the filter
+ * was opened */
+ picture_Release(p_outpic);
+ return NULL;
+ }
+
+ d3d11_device_lock( d3d_dev );
+ ID3D11DeviceContext_CopySubresourceRegion(src_sys->context,
+ src_sys->resource[KNOWN_DXGI_INDEX],
+ src_sys->slice_index,
+ 0, 0, 0,
+ (ID3D11Resource*)out,
+ 0,
+ NULL);
+ d3d11_device_unlock( d3d_dev );
+ return p_outpic;
+}
+
+static picture_t * Filter(filter_t *filter, picture_t *p_pic)
+{
+ struct filter_sys_t *sys = filter->p_sys;
+
+ picture_sys_t *src_sys = ActivePictureSys(p_pic);
+
+ AMF_RESULT res;
+ AMFSurface *submitSurface;
+
+ AMFPlane *packedStaging = sys->amfInput->pVtbl->GetPlane(sys->amfInput, AMF_PLANE_PACKED);
+ ID3D11Resource *amfStaging = packedStaging->pVtbl->GetNative(packedStaging);
+
+#ifndef NDEBUG
+ ID3D11Texture2D *staging = (ID3D11Texture2D *)amfStaging;
+ D3D11_TEXTURE2D_DESC stagingDesc, inputDesc;
+ ID3D11Texture2D_GetDesc(staging, &stagingDesc);
+ ID3D11Texture2D_GetDesc(src_sys->texture[KNOWN_DXGI_INDEX], &inputDesc);
+ assert(stagingDesc.Width == inputDesc.Width);
+ assert(stagingDesc.Height == inputDesc.Height);
+ assert(stagingDesc.Format == inputDesc.Format);
+#endif
+
+ struct filter_sys_t *dev_sys = sys;
+
+#if 0
+ if (src_sys->slice_index == 0)
+ sys->amf.Context->pVtbl->CreateSurfaceFromDX11Native(sys->amf.Context, )
+#endif
+ // copy source into staging as it may not be shared and we can't select a slice
+ d3d11_device_lock( &dev_sys->d3d_dev );
+ ID3D11DeviceContext_CopySubresourceRegion(dev_sys->d3d_dev.d3dcontext, amfStaging,
+ 0,
+ 0, 0, 0,
+ src_sys->resource[KNOWN_DXGI_INDEX],
+ src_sys->slice_index,
+ NULL);
+ d3d11_device_unlock( &dev_sys->d3d_dev );
+ submitSurface = sys->amfInput;
+
+ res = sys->amf_frc->pVtbl->SubmitInput(sys->amf_frc, (AMFData*)submitSurface);
+ if (res == AMF_INPUT_FULL)
+ {
+ msg_Dbg(filter, "filter input full, skip this frame");
+ return p_pic;
+ }
+ if (res != AMF_OK)
+ {
+ msg_Err(filter, "filter input failed (err=%d)", res);
+ return p_pic;
+ }
+
+ date_Set( &sys->next_output_pts, p_pic->date );
+ bool got_output = sys->mode != FRC_x2_PRESENT;
+ do {
+ AMFData *amfOutput = NULL;
+ res = sys->amf_frc->pVtbl->QueryOutput(sys->amf_frc, &amfOutput);
+ if (res != AMF_OK && res != AMF_REPEAT)
+ {
+ msg_Err(filter, "filter gave no output (err=%d)", res);
+ break;
+ }
+
+ AMFSurface *amfOutputSurface = (AMFSurface*)amfOutput;
+ AMFPlane *packed = amfOutputSurface->pVtbl->GetPlane(amfOutputSurface, AMF_PLANE_PACKED);
+
+ assert(amfOutput->pVtbl->GetMemoryType(amfOutput) == AMF_MEMORY_DX11);
+ ID3D11Texture2D *out = packed->pVtbl->GetNative(packed);
+ picture_t *dst = PictureFromTexture(filter, &dev_sys->d3d_dev, out);
+ amfOutput->pVtbl->Release(amfOutput);
+ if (dst == NULL)
+ break;
+
+ picture_CopyProperties(dst, p_pic);
+ if (!got_output)
+ {
+ picture_Release(p_pic);
+ p_pic = dst;
+ got_output = true;
+ }
+ else
+ {
+ if (sys->mode == FRC_x2_PRESENT)
+ {
+ // teh first frame is the interpolated one with the previous frame
+ dst->date = date_Get( &sys->next_output_pts );
+ p_pic->date = date_Decrement( &sys->next_output_pts, 1 );
+ p_pic->p_next = dst;
+ }
+ else
+ {
+ // past interpolated then source
+ dst->p_next = p_pic;
+ dst->date = date_Decrement( &sys->next_output_pts, 1 );
+ p_pic = dst;
+ }
+ }
+ } while (res == AMF_REPEAT);
+
+ return p_pic;
+}
+
+void D3D11CloseAMFFRC(vlc_object_t *p_this)
+{
+ filter_t *filter = container_of(p_this, filter_t, obj);
+ struct filter_sys_t *sys = filter->p_sys;
+ sys->amfInput->pVtbl->Release(sys->amfInput);
+ sys->amf_frc->pVtbl->Release(sys->amf_frc);
+ if (sys->d3d_dev.d3dcontext)
+ D3D11_FilterReleaseInstance(&sys->d3d_dev);
+ D3D11_Destroy(&sys->hd3d);
+}
+
+int D3D11CreateAMFFRC(vlc_object_t *p_this)
+{
+ filter_t *filter = container_of(p_this, filter_t, obj);
+ if (!is_d3d11_opaque(filter->fmt_in.video.i_chroma))
+ return VLC_EGENERIC;
+ if (!video_format_IsSimilar(&filter->fmt_in.video, &filter->fmt_out.video))
+ return VLC_EGENERIC;
+
+ struct filter_sys_t *sys = vlc_obj_calloc(VLC_OBJECT(filter), 1, sizeof(*sys));
+ if (unlikely(sys == NULL))
+ return VLC_ENOMEM;
+
+ if ( unlikely(D3D11_Create(filter, &sys->hd3d, false) != VLC_SUCCESS ))
+ {
+ msg_Err(filter, "Could not access the d3d11.");
+ goto error;
+ }
+
+ D3D11_TEXTURE2D_DESC dstDesc;
+ D3D11_FilterHoldInstance(filter, &sys->d3d_dev, &dstDesc);
+ if (unlikely(sys->d3d_dev.d3dcontext==NULL))
+ {
+ msg_Dbg(filter, "Filter without a context");
+ return VLC_ENOOBJ;
+ }
+
+ struct filter_sys_t *dev_sys = sys;
+
+ if (dev_sys->d3d_dev.adapterDesc.VendorId != GPU_MANUFACTURER_AMD)
+ {
+ msg_Err(filter, "AMF filter only supported with AMD GPUs");
+ goto error;
+ }
+
+ config_ChainParse( filter, "", ppsz_filter_options, filter->p_cfg );
+
+ sys->mode = FRC_x2_PRESENT; //FRC_ONLY_INTERPOLATED;
+
+ DXGI_FORMAT input_format = dstDesc.Format;
+ const d3d_format_t *cfg;
+ for (cfg = GetRenderFormatList(); cfg->name != NULL; ++cfg)
+ {
+ if (cfg->formatTexture == input_format &&
+ is_d3d11_opaque(cfg->fourcc))
+ break;
+ }
+ assert(cfg != NULL);
+
+ AMF_SURFACE_FORMAT amf_fmt = DXGIToAMF(input_format);
+ if (amf_fmt == AMF_SURFACE_UNKNOWN)
+ {
+ msg_Err(filter, "Unsupported DXGI format %s", cfg->name);
+ return VLC_EGENERIC;
+ }
+
+ int err = vlc_AMFCreateContext(&sys->amf);
+ if (err != VLC_SUCCESS)
+ return err;
+
+#if 0
+ if (sys->amf.Version < AMF_MAKE_FULL_VERSION(1,4,34,0))
+ {
+ msg_Dbg(filter, "AMF version %u.%u.%u too old for FRC (1.4.34 needed)",
+ (unsigned)AMF_GET_MAJOR_VERSION(sys->amf.Version),
+ (unsigned)AMF_GET_MINOR_VERSION(sys->amf.Version),
+ (unsigned)AMF_GET_SUBMINOR_VERSION(sys->amf.Version));
+ goto error;
+ }
+#endif
+
+ AMF_RESULT res;
+ res = sys->amf.Context->pVtbl->InitDX11(sys->amf.Context, dev_sys->d3d_dev.d3ddevice, AMF_DX11_0);
+ if (res != AMF_OK)
+ goto error;
+
+ res = sys->amf.pFactory->pVtbl->CreateComponent(sys->amf.pFactory, sys->amf.Context, AMFFRC, &sys->amf_frc);
+ if (res != AMF_OK || sys->amf_frc == NULL)
+ goto error;
+
+// TODO AMF_STREAM_VIDEO_FRAME_RATE
+
+ AMFVariantStruct val;
+ val.int64Value = FRC_ENGINE_DX11;
+ val.type = AMF_VARIANT_INT64;
+ res = sys->amf_frc->pVtbl->SetProperty(sys->amf_frc, AMF_FRC_ENGINE_TYPE, val);
+ if (unlikely(res != AMF_OK))
+ {
+ msg_Err(filter, "Failed to set D3D11 engine type (err=%d)", res);
+ goto error;
+ }
+
+ val.boolValue = false;
+ val.type = AMF_VARIANT_BOOL;
+ res = sys->amf_frc->pVtbl->SetProperty(sys->amf_frc, AMF_FRC_ENABLE_FALLBACK, val);
+ if (unlikely(res != AMF_OK))
+ {
+ msg_Err(filter, "Failed to disable fallback (err=%d)", res);
+ goto error;
+ }
+
+ val.int64Value = FRC_PROFILE_HIGH;
+ val.type = AMF_VARIANT_INT64;
+ res = sys->amf_frc->pVtbl->SetProperty(sys->amf_frc, AMF_FRC_PROFILE, val);
+ if (unlikely(res != AMF_OK))
+ {
+ msg_Err(filter, "Failed to set FRC profile to %" PRId64 " (err=%d)", val.int64Value, res);
+ goto error;
+ }
+
+ val.int64Value = FRC_MV_SEARCH_NATIVE;
+ val.type = AMF_VARIANT_INT64;
+ res = sys->amf_frc->pVtbl->SetProperty(sys->amf_frc, AMF_FRC_MV_SEARCH_MODE, val);
+ if (unlikely(res != AMF_OK))
+ {
+ msg_Err(filter, "Failed to set FRC mv search to %" PRId64 " (err=%d)", val.int64Value, res);
+ goto error;
+ }
+
+ val.int64Value = sys->mode;
+ val.type = AMF_VARIANT_INT64;
+ res = sys->amf_frc->pVtbl->SetProperty(sys->amf_frc, AMF_FRC_MODE, val);
+ if (unlikely(res != AMF_OK))
+ {
+ msg_Err(filter, "Failed to set FRC mode to %" PRId64 " (err=%d)", val.int64Value, res);
+ goto error;
+ }
+
+ val.boolValue = var_GetBool (filter, "frc-indicator");
+ val.type = AMF_VARIANT_BOOL;
+ res = sys->amf_frc->pVtbl->SetProperty(sys->amf_frc, AMF_FRC_INDICATOR, val);
+ if (res != AMF_OK)
+ goto error;
+
+ res = sys->amf_frc->pVtbl->Init(sys->amf_frc, amf_fmt,
+ filter->fmt_in.video.i_width,
+ filter->fmt_in.video.i_height);
+ if (res != AMF_OK)
+ goto error;
+
+ res = sys->amf.Context->pVtbl->AllocSurface(sys->amf.Context, AMF_MEMORY_DX11,
+ amf_fmt,
+ filter->fmt_in.video.i_width,
+ filter->fmt_in.video.i_height,
+ &sys->amfInput);
+ if (res != AMF_OK)
+ goto error;
+
+ sys->cfg = cfg;
+ filter->pf_video_filter = Filter;
+ filter->p_sys = sys;
+
+ sys->source_rate = filter->fmt_out.video.i_frame_rate_base != 0 &&
+ filter->fmt_out.video.i_frame_rate != 0;
+
+ if (!sys->source_rate)
+ {
+ msg_Warn( filter, "Missing frame rate, assuming 25fps source" );
+ filter->fmt_out.video.i_frame_rate = 25;
+ filter->fmt_out.video.i_frame_rate_base = 1;
+ }
+
+ filter->fmt_out.video.i_frame_rate = 2 * filter->fmt_out.video.i_frame_rate;
+
+ date_Init( &sys->next_output_pts,
+ filter->fmt_out.video.i_frame_rate, filter->fmt_out.video.i_frame_rate_base );
+
+ return VLC_SUCCESS;
+error:
+ if (sys->d3d_dev.d3dcontext)
+ D3D11_FilterReleaseInstance(&sys->d3d_dev);
+ if (sys->amfInput)
+ sys->amfInput->pVtbl->Release(sys->amfInput);
+ if (sys->amf_frc != NULL)
+ sys->amf_frc->pVtbl->Release(sys->amf_frc);
+ vlc_AMFReleaseContext(&sys->amf);
+ D3D11_Destroy(&sys->hd3d);
+ return VLC_EGENERIC;
+}
=====================================
src/video_output/video_output.c
=====================================
@@ -763,7 +763,7 @@ static void ThreadChangeFilters(vout_thread_t *vout,
if (likely(e)) {
e->name = name;
e->cfg = cfg;
- if (!strcmp(e->name, "postproc"))
+ if (!strcmp(e->name, "postproc") || !strcmp(e->name, "amf_frc"))
vlc_array_append_or_abort(&array_static, e);
else
vlc_array_append_or_abort(&array_interactive, e);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f94f0a5f979668fee7b0d2e8bb9cc89152135eac...2f6a50828b03da47ef05fb40340034010ecd191d
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f94f0a5f979668fee7b0d2e8bb9cc89152135eac...2f6a50828b03da47ef05fb40340034010ecd191d
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list