[vlc-devel] [PATCH 1/2] d3d11va: fix the device creation under Windows Phone

Rémi Denis-Courmont remi at remlab.net
Mon Jul 20 17:02:06 CEST 2015


Le 2015-07-20 17:52, Steve Lhomme a écrit :
> ---
>  modules/codec/avcodec/d3d11va.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/modules/codec/avcodec/d3d11va.c
> b/modules/codec/avcodec/d3d11va.c
> index 0d1f856..7140f28 100644
> --- a/modules/codec/avcodec/d3d11va.c
> +++ b/modules/codec/avcodec/d3d11va.c
> @@ -32,6 +32,9 @@
>  # include "config.h"
>  #endif
>
> +# undef WINAPI_FAMILY
> +# define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
> +
>  #include <assert.h>
>
>  #include <vlc_common.h>
> @@ -62,6 +65,10 @@ vlc_module_begin()
>      set_callbacks(Open, Close)
>  vlc_module_end()
>
> +#if VLC_WINSTORE_APP
> +#define pf_CreateDevice                 D3D11CreateDevice
> +#endif
> +
>  #include <initguid.h> /* must be last included to not redefine
> existing GUIDs */
>
>  /* dxva2api.h GUIDs:
> 
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms697067(v=vs100).aspx
> @@ -435,6 +442,7 @@ static int D3dCreateDevice(vlc_va_t *va)
>          return VLC_SUCCESS;
>      }
>
> +#if !VLC_WINSTORE_APP
>      /* */
>      PFN_D3D11_CREATE_DEVICE pf_CreateDevice;
>      pf_CreateDevice = (void *)GetProcAddress(dx_sys->hdecoder_dll,
> "D3D11CreateDevice");
> @@ -442,6 +450,7 @@ static int D3dCreateDevice(vlc_va_t *va)
>          msg_Err(va, "Cannot locate reference to D3D11CreateDevice
> ABI in DLL");
>          return VLC_EGENERIC;
>      }
> +#endif

If the function is necessary for the plugin to work in any useful way, 
then there is no point in loading it at run-time. Let LoadLibrary() 
fail.

The plugin will no longer show in the preferences on unsupported 
systems. But that looks more like a feature than a bug to me.

>      UINT creationFlags = D3D11_CREATE_DEVICE_VIDEO_SUPPORT;
>  #if !defined(NDEBUG) //&& defined(_MSC_VER)

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list