[vlc-commits] [Git][videolan/vlc][master] 2 commits: configure: don't check the presence of D3D11/D3D9 structures

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Aug 27 15:21:22 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
765c9d30 by Steve Lhomme at 2023-08-27T15:08:05+00:00
configure: don't check the presence of D3D11/D3D9 structures

Either D3D11/D3D9 is usable and the structures are there, or they are not.
We don't support old mingw-w64 versions without these headers.

* D3D11 is not enabled if libavcodec/d3d11.h is not usable
* DXVA2 is not enabled if libavcodec/dxva2.h is not usable
* direct3d9_filters is enabled if d3d9.h is usable (ie not UWP builds)

- - - - -
910a50f6 by Steve Lhomme at 2023-08-27T15:08:05+00:00
configure: remove stray comment

This is my m4 syntax highlighting.

- - - - -


3 changed files:

- configure.ac
- modules/video_chroma/d3d11_fmt.c
- modules/video_output/win32/direct3d11.cpp


Changes:

=====================================
configure.ac
=====================================
@@ -817,7 +817,7 @@ AC_SUBST([SOCKET_LIBS])
 
 dnl Check for socklen_t
 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
-AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
+AC_CACHE_CHECK([for socklen_t in sys/socket.h],
 ac_cv_type_socklen_t,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
 [#include <sys/types.h>
@@ -2577,29 +2577,24 @@ AC_ARG_ENABLE([dxva2],
 
 have_avcodec_dxva2="no"
 AS_IF([test "${enable_dxva2}" != "no"], [
-  if test "${SYS}" = "mingw32"; then
-  AS_IF([test "${have_avcodec}" = "yes"], [
-    AC_CHECK_HEADERS([dxva2api.h],
-      [
+  AS_IF([test "${SYS}" = "mingw32"], [
+    AS_IF([test "${have_avcodec}" = "yes"], [
         AC_CHECK_HEADERS([libavcodec/dxva2.h], [
-           AC_MSG_NOTICE([DxVA2 acceleration activated])
-           have_avcodec_dxva2="yes"
+            AC_MSG_NOTICE([DxVA2 acceleration activated])
+            have_avcodec_dxva2="yes"
         ],[
-    AS_IF([test "${enable_dxva2}" = "yes"],
-          [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
-              [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
-        ], [])
-      ],[
-    AS_IF([test "${enable_dxva2}" = "yes"],
-              [AC_MSG_ERROR([Could not find required dxva2api.h])],
-              [AC_MSG_WARN([dxva2api.h not found])])
-      ],[#include <d3d9.h>])
-  ],[
-    AS_IF([test "x${enable_dxva2}" != "x"], [
-      AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
+            AS_IF([test "${enable_dxva2}" = "yes"],[
+                AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])
+            ],[
+                AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])
+            ])
+        ])
+    ],[
+        AS_IF([test "x${enable_dxva2}" != "x"], [
+            AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
+        ])
     ])
   ])
-  fi
 ])
 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
 
@@ -2611,37 +2606,24 @@ AC_ARG_ENABLE([d3d11va],
 
 have_avcodec_d3d11va="no"
 AS_IF([test "${enable_d3d11va}" != "no"], [
-  if test "${SYS}" = "mingw32"; then
-  AS_IF([test "${have_avcodec}" = "yes"], [
-        AC_CHECK_TYPES([ID3D11VideoDecoder],
-          [
-            AC_CHECK_HEADERS([dxva2api.h],
-              [
-                AC_CHECK_HEADERS([libavcodec/d3d11va.h], [
-                   AC_MSG_NOTICE([D3D11 acceleration activated])
-                   AC_DEFINE([HAVE_AVCODEC_D3D11VA], [1], [Define if the d3d11va module is built])
-                   have_avcodec_d3d11va="yes"
-                ],[
-                  AS_IF([test "${enable_d3d11va}" = "yes"],
-                    [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
-                        [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
-                  ], [])
-                  ],[
-                    AS_IF([test "${enable_d3d11va}" = "yes"],
-                          [AC_MSG_ERROR([Could not find required dxva2api.h])],
-                          [AC_MSG_WARN([dxva2api.h not found])])
-                  ],[#include <d3d9.h>])
-          ],[
-            AS_IF([test "${enable_d3d11va}" = "yes"],
-                  [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
-                  [AC_MSG_WARN([ID3D11VideoDecoder not found])])
-          ], [#include <d3d11.h>])
+  AS_IF([test "${SYS}" = "mingw32"], [
+    AS_IF([test "${have_avcodec}" = "yes"], [
+        AC_CHECK_HEADERS([libavcodec/d3d11va.h], [
+            AC_MSG_NOTICE([D3D11 acceleration activated])
+            have_avcodec_d3d11va="yes"
+        ],[
+            AS_IF([test "${enable_d3d11va}" = "yes"], [
+                AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])
+            ],[
+                AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])
+            ])
+        ])
+    ])
   ],[
     AS_IF([test "x${enable_d3d11va}" != "x"], [
       AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
     ])
   ])
-  fi
 ])
 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
 
@@ -3603,22 +3585,8 @@ AS_IF([test "${enable_directx}" != "no"], [
 
   dnl Direct3D9
   AC_CHECK_HEADERS([d3d9.h], [
-    VLC_ADD_PLUGIN([direct3d9])
+    VLC_ADD_PLUGIN([direct3d9 direct3d9_filters])
     AC_CHECK_HEADERS([d3dx9effect.h])
-
-    AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
-        [[#define COBJMACROS
-          #include <d3d9.h>
-          #include <dxva2api.h>
-          #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
-          # error dxva2 too old
-          #endif
-        ]],[[;]])
-      ],[
-        VLC_ADD_PLUGIN([direct3d9_filters])
-      ],
-      [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
-
   ])
 ])
 


=====================================
modules/video_chroma/d3d11_fmt.c
=====================================
@@ -364,13 +364,11 @@ void D3D11_ReleaseDevice(d3d11_decoder_device_t *dev_sys)
         ID3D11Device_Release(d3d_dev->d3ddevice);
         d3d_dev->d3ddevice = NULL;
     }
-#if defined(HAVE_ID3D11VIDEODECODER)
     if( d3d_dev->mutex_owner && d3d_dev->context_mutex != INVALID_HANDLE_VALUE )
     {
         CloseHandle( d3d_dev->context_mutex );
         d3d_dev->context_mutex = INVALID_HANDLE_VALUE;
     }
-#endif
 
     if ( sys->external.cleanupDeviceCb )
         sys->external.cleanupDeviceCb( sys->external.opaque );


=====================================
modules/video_output/win32/direct3d11.cpp
=====================================
@@ -316,7 +316,6 @@ static int SetViewpoint(vout_display_t *vd, const vlc_viewpoint_t *viewpoint)
 static int UpdateStaging(vout_display_t *vd, const video_format_t *fmt)
 {
     vout_display_sys_t *sys = static_cast<vout_display_sys_t *>(vd->sys);
-#ifdef HAVE_ID3D11VIDEODECODER
     if (sys->legacy_shader)
     {
         /* we need a staging texture */
@@ -344,7 +343,6 @@ static int UpdateStaging(vout_display_t *vd, const video_format_t *fmt)
         for (unsigned plane = 0; plane < DXGI_MAX_SHADER_VIEW; plane++)
             sys->stagingSys.texture[plane] = textures[plane];
     }
-#endif
     return VLC_SUCCESS;
 }
 
@@ -1022,10 +1020,6 @@ static bool CanUseTextureArray(vout_display_t *vd)
 {
     vout_display_sys_t *sys = static_cast<vout_display_sys_t *>(vd->sys);
 
-#ifndef HAVE_ID3D11VIDEODECODER
-    (void) vd;
-    return false;
-#else
     // 15.200.1062.1004 is wrong - 2015/08/03 - 15.7.1 WHQL
     // 21.19.144.1281 is wrong   -
     // 22.19.165.3 is good       - 2017/05/04 - ReLive Edition 17.5.1
@@ -1053,7 +1047,6 @@ static bool CanUseTextureArray(vout_display_t *vd)
     }
 
     return true;
-#endif
 }
 
 static bool BogusZeroCopy(const vout_display_t *vd)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bf7e2b2192a425cc2df08465d3d31217c14762ab...910a50f6bb516f9cb7b6330b27dd5c27a63b2af1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bf7e2b2192a425cc2df08465d3d31217c14762ab...910a50f6bb516f9cb7b6330b27dd5c27a63b2af1
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