[vlc-commits] [Git][videolan/vlc][3.0.x] 2 commits: video_filter: disable VQ Enhancer for other GPU manufacturers

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Sep 26 07:50:43 UTC 2024



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
8d11bb2f by Steve Lhomme at 2024-09-26T07:29:18+00:00
video_filter: disable VQ Enhancer for other GPU manufacturers

InitDX11 crashes if the filter is enabled but an incompatible GPU is used.

(cherry picked from commit 49381f476eda197962d1164133cc7021a0adb52d) (edited)
edited:
- on 3.0 we need to get the D3D device via D3D11_FilterHoldInstance()

- - - - -
47e6c1b7 by Steve Lhomme at 2024-09-26T07:29:18+00:00
hw/amf: keep the AMF version in the context

For FRC we may need to disable it before 1.4.34.

(cherry picked from commit de748458776f58f150edc06a4b9cac8c961dac20)

- - - - -


3 changed files:

- modules/hw/amf/amf_helper.c
- modules/hw/amf/amf_helper.h
- modules/video_filter/amf_vqenhancer.c


Changes:

=====================================
modules/hw/amf/amf_helper.c
=====================================
@@ -21,12 +21,12 @@ int vlc_AMFCreateContext(struct vlc_amf_context *c)
     if (hLib == NULL)
         return (-ENOTSUP);
 
-    amf_uint64 version = 0;
+    c->Version = 0;
     AMF_RESULT res;
     AMFQueryVersion_Fn queryVersion = (AMFQueryVersion_Fn)GetProcAddress(hLib, AMF_QUERY_VERSION_FUNCTION_NAME);
     if (unlikely(queryVersion == NULL))
         goto error;
-    res = queryVersion(&version);
+    res = queryVersion(&c->Version);
     if (unlikely(res != AMF_OK))
         goto error;
 
@@ -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(version, &c->pFactory);
+    res = init(c->Version, &c->pFactory); // use the highest possible value for that DLL
     if (unlikely(res != AMF_OK))
         goto error;
 


=====================================
modules/hw/amf/amf_helper.h
=====================================
@@ -29,6 +29,7 @@ struct vlc_amf_context
 {
     AMT_TYPE(AMFFactory) *pFactory;
     AMT_TYPE(AMFContext) *Context;
+    amf_uint64           Version;
     void            *Private;
 };
 


=====================================
modules/video_filter/amf_vqenhancer.c
=====================================
@@ -175,6 +175,14 @@ int D3D11CreateAMFVQE(vlc_object_t *p_this)
         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;
+    }
+
     DXGI_FORMAT input_format = dstDesc.Format;
     const d3d_format_t *cfg;
     for (cfg = GetRenderFormatList(); cfg->name != NULL; ++cfg)
@@ -192,8 +200,6 @@ int D3D11CreateAMFVQE(vlc_object_t *p_this)
         return VLC_EGENERIC;
     }
 
-    struct filter_sys_t *dev_sys = sys;
-
     HRESULT hr;
     HANDLE context_lock = INVALID_HANDLE_VALUE;
     UINT dataSize = sizeof(context_lock);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f0703a7162b14e178d745b64157ea932cb61a491...47e6c1b726b22afb53a0762506864650ca1a2d33

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f0703a7162b14e178d745b64157ea932cb61a491...47e6c1b726b22afb53a0762506864650ca1a2d33
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