[vlc-devel] [PATCH 09/15] direct3d11: store the texture format that is used to display the texture

Steve Lhomme robux4 at videolabs.io
Wed Feb 8 14:26:56 CET 2017


---
 modules/video_chroma/d3d11_fmt.h        | 1 +
 modules/video_output/win32/direct3d11.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index 354a4bc..7db8bc3 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -39,6 +39,7 @@ struct picture_sys_t
     unsigned                      slice_index;
     ID3D11VideoProcessorInputView *inputView; /* when used as processor input */
     ID3D11ShaderResourceView      *resourceView[D3D11_MAX_SHADER_VIEW];
+    DXGI_FORMAT                   formatTexture;
 };
 
 #endif /* include-guard */
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index dcfcf38..35a6712 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -697,6 +697,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
         ID3D11Texture2D_AddRef(texture);
         picsys->texture = texture;
         picsys->slice_index = picture_count;
+        picsys->formatTexture = vd->sys->picQuadConfig->formatTexture;
         picsys->context = vd->sys->d3dcontext;
 
         picture_resource_t resource = {
@@ -2074,6 +2075,8 @@ static int AllocQuad(vout_display_t *vd, const video_format_t *fmt, d3d_quad_t *
     if (AllocateShaderView(vd, cfg, quad->pTexture, 0, quad->picSys.resourceView) != VLC_SUCCESS)
         goto error;
 
+    quad->picSys.formatTexture = cfg->formatTexture;
+
     if ( d3dpixelShader != NULL )
     {
         if (!AllocQuadVertices(vd, quad, fmt, projection))
-- 
2.10.2



More information about the vlc-devel mailing list