[vlc-commits] direct3d9: add an option callback to be signaled when the scene/source size changes

Steve Lhomme git at videolan.org
Fri Jan 18 11:33:39 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Nov 15 12:46:47 2018 +0100| [cc5b976e2aa9fe66baa34f2bdfce1b2ecb7f0c09] | committer: Steve Lhomme

direct3d9: add an option callback to be signaled when the scene/source size changes

To be used for "window less" rendering

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

 modules/video_output/win32/direct3d9.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index dd85b43e1a..6e3bcb799e 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -165,6 +165,7 @@ struct vout_display_sys_t
     void (*swapCb)(void* opaque);
     void (*endRenderCb)(void* opaque);
     bool (*starRenderCb)(void* opaque);
+    bool (*resizeCb)(void* opaque, unsigned, unsigned);
 };
 
 /* */
@@ -581,6 +582,14 @@ static int Direct3D9CreateScene(vout_display_t *vd, const video_format_t *fmt)
     IDirect3DDevice9        *d3ddev = p_d3d9_dev->dev;
     HRESULT hr;
 
+    if (sys->resizeCb && !sys->resizeCb( sys->outside_opaque,
+                                         fmt->i_visible_width,
+                                         fmt->i_visible_height ))
+    {
+        msg_Err(vd, "Failed to set the external render size");
+        return VLC_EGENERIC;
+    }
+
     /*
      * Create a texture for use when rendering a scene
      * for performance reason, texture format is identical to backbuffer
@@ -1655,6 +1664,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         sys->swapCb         = Swap;
         sys->starRenderCb   = StartRendering;
         sys->endRenderCb    = EndRendering;
+        sys->resizeCb       = NULL;
     }
 
     sys->hxdll = Direct3D9LoadShaderLibrary();



More information about the vlc-commits mailing list