[vlc-commits] [Git][videolan/vlc][master] 3 commits: d3d11va: exit early when video decoding is not supported

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Feb 6 20:47:05 UTC 2023



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


Commits:
ae5c56a4 by Steve Lhomme at 2023-02-06T20:17:02+00:00
d3d11va: exit early when video decoding is not supported

- - - - -
480884be by Steve Lhomme at 2023-02-06T20:17:02+00:00
d3d11_decoder: add the RGB mask if needed

That's what the D3D11 video output expects.

- - - - -
afe48ba5 by Steve Lhomme at 2023-02-06T20:17:02+00:00
d3d11: allow using an external device without decoding support

It might be used just to provide textures to render with no processing.

- - - - -


3 changed files:

- modules/codec/avcodec/d3d11va.c
- modules/hw/d3d11/d3d11_decoder.cpp
- modules/video_chroma/d3d11_fmt.c


Changes:

=====================================
modules/codec/avcodec/d3d11va.c
=====================================
@@ -241,6 +241,12 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum AVPixelFormat hwfmt, con
     if ( devsys == NULL )
         return VLC_EGENERIC;
 
+    if (!(ID3D11Device_GetCreationFlags(devsys->d3d_dev.d3ddevice) & D3D11_CREATE_DEVICE_VIDEO_SUPPORT))
+    {
+        msg_Err(va, "Missing D3D11_CREATE_DEVICE_VIDEO_SUPPORT");
+        return VLC_EGENERIC;
+    }
+
     vlc_va_sys_t *sys = calloc(1, sizeof (*sys));
     if (unlikely(sys == NULL))
         return VLC_ENOMEM;


=====================================
modules/hw/d3d11/d3d11_decoder.cpp
=====================================
@@ -136,6 +136,7 @@ static int DecodeFrame( decoder_t *p_dec, block_t *p_block )
             block_Release( p_block );
             return VLC_EGENERIC;
         }
+        DxgiFormatMask( p_sys->output_format->formatTexture, &p_dec->fmt_out.video );
 
         if( decoder_UpdateVideoOutput( p_dec, p_sys->vctx ) )
         {
@@ -283,6 +284,7 @@ int D3D11OpenBlockDecoder( vlc_object_t *obj )
             vlc_decoder_device_Release(dec_dev);
             return VLC_EGENERIC;
         }
+        DxgiFormatMask( p_sys->output_format->formatTexture, &p_dec->fmt_out.video );
 
         if( decoder_UpdateVideoOutput( p_dec, p_sys->vctx ) )
         {


=====================================
modules/video_chroma/d3d11_fmt.c
=====================================
@@ -390,13 +390,9 @@ static HRESULT D3D11_CreateDeviceExternal(vlc_object_t *obj, ID3D11DeviceContext
     HRESULT hr;
     ID3D11DeviceContext_GetDevice( d3d11ctx, &out->d3ddevice );
 
-    UINT creationFlags = ID3D11Device_GetCreationFlags(out->d3ddevice);
-    if (!(creationFlags & D3D11_CREATE_DEVICE_VIDEO_SUPPORT))
+    if (!(ID3D11Device_GetCreationFlags(out->d3ddevice) & D3D11_CREATE_DEVICE_VIDEO_SUPPORT))
     {
-        msg_Err(obj, "the provided D3D11 device doesn't support decoding");
-        ID3D11Device_Release(out->d3ddevice);
-        out->d3ddevice = NULL;
-        return E_FAIL;
+        msg_Warn(obj, "the provided D3D11 device doesn't support decoding");
     }
 
     IDXGIAdapter *pAdapter = D3D11DeviceAdapter(out->d3ddevice);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3bb97f96938971e945dcfb63c1524252df96491e...afe48ba5e8b59d50b3b5100683d2da274b9d89d4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3bb97f96938971e945dcfb63c1524252df96491e...afe48ba5e8b59d50b3b5100683d2da274b9d89d4
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