[vlc-commits] vout:win32: use picture_UpdatePlanes() directly

Steve Lhomme git at videolan.org
Mon Feb 25 14:34:18 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 25 14:18:11 2019 +0100| [3c8a4312a61a975c000c205943ac146fc82c00ef] | committer: Steve Lhomme

vout:win32: use picture_UpdatePlanes() directly

We don't need CommonUpdatePicture() anymore to create fake/unused picture
planes.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3c8a4312a61a975c000c205943ac146fc82c00ef
---

 modules/video_output/win32/direct3d11.c | 3 ++-
 modules/video_output/win32/direct3d9.c  | 3 ++-
 modules/video_output/win32/directdraw.c | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 4541715b0a..a20000cc4a 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -54,6 +54,7 @@
 #include "d3d11_shaders.h"
 
 #include "common.h"
+#include "../video_chroma/copy.h"
 
 DEFINE_GUID(GUID_SWAPCHAIN_WIDTH,  0xf1b59347, 0x1643, 0x411a, 0xad, 0x6b, 0xc7, 0x80, 0x17, 0x7a, 0x06, 0xb6);
 DEFINE_GUID(GUID_SWAPCHAIN_HEIGHT, 0x6ea976a0, 0x9d60, 0x4bb7, 0xa5, 0xa9, 0x7d, 0xd1, 0x18, 0x7f, 0xc9, 0xbd);
@@ -1853,7 +1854,7 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
 
         hr = ID3D11DeviceContext_Map(sys->d3d_dev.d3dcontext, ((d3d_quad_t *) quad_picture->p_sys)->picSys.resource[KNOWN_DXGI_INDEX], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
         if( SUCCEEDED(hr) ) {
-            err = CommonUpdatePicture(quad_picture, NULL, mappedResource.pData, mappedResource.RowPitch);
+            err = picture_UpdatePlanes(quad_picture, mappedResource.pData, mappedResource.RowPitch);
             if (err != VLC_SUCCESS) {
                 msg_Err(vd, "Failed to set the buffer on the SPU picture" );
                 ID3D11DeviceContext_Unmap(sys->d3d_dev.d3dcontext, ((d3d_quad_t *) quad_picture->p_sys)->picSys.resource[KNOWN_DXGI_INDEX], 0);
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index e57891e14a..9dd9665f38 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -53,6 +53,7 @@
 
 #include "common.h"
 #include "builtin_shaders.h"
+#include "../video_chroma/copy.h"
 
 #include <assert.h>
 
@@ -1243,7 +1244,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
         }
 
         picture_t fake_pic = *picture;
-        CommonUpdatePicture(&fake_pic, NULL, d3drect.pBits, d3drect.Pitch);
+        picture_UpdatePlanes(&fake_pic, d3drect.pBits, d3drect.Pitch);
         picture_CopyPixels(&fake_pic, picture);
         IDirect3DSurface9_UnlockRect(surface);
     }
diff --git a/modules/video_output/win32/directdraw.c b/modules/video_output/win32/directdraw.c
index a262fcb5b6..7ae3a49003 100644
--- a/modules/video_output/win32/directdraw.c
+++ b/modules/video_output/win32/directdraw.c
@@ -50,6 +50,7 @@
 #include <commctrl.h>       /* ListView_(Get|Set)* */
 
 #include "common.h"
+#include "../video_chroma/copy.h"
 
 /* Unicode function "DirectDrawEnumerateExW" has been desactivated
    since in some cases this function fails and the callbacks are not
@@ -1248,7 +1249,7 @@ static int DirectXLock(vout_display_sys_t *sys, picture_t *picture)
                            sys->surface, &ddsd))
         return VLC_EGENERIC;
 
-    CommonUpdatePicture(picture, NULL, ddsd.lpSurface, ddsd.lPitch);
+    picture_UpdatePlanes(picture, ddsd.lpSurface, ddsd.lPitch);
     return VLC_SUCCESS;
 }
 static void DirectXUnlock(vout_display_sys_t *sys, picture_t *picture)



More information about the vlc-commits mailing list