[vlc-commits] d3d9: make sure external devices also set the adapterId and device caps

Steve Lhomme git at videolan.org
Fri Dec 7 16:50:02 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Dec  7 16:30:53 2018 +0100| [732e5cbfdf64e1405bb343596430f685dcdeccf1] | committer: Steve Lhomme

d3d9: make sure external devices also set the adapterId and device caps

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

 modules/video_chroma/d3d9_fmt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/video_chroma/d3d9_fmt.c b/modules/video_chroma/d3d9_fmt.c
index 7ba9c108f9..a3f5e47836 100644
--- a/modules/video_chroma/d3d9_fmt.c
+++ b/modules/video_chroma/d3d9_fmt.c
@@ -133,10 +133,18 @@ HRESULT D3D9_CreateDevice(vlc_object_t *o, d3d9_handle_t *hd3d, HWND hwnd,
 HRESULT D3D9_CreateDeviceExternal(IDirect3DDevice9 *dev, d3d9_handle_t *hd3d, HWND hwnd,
                                   const video_format_t *source, d3d9_device_t *out)
 {
-
+    D3DDEVICE_CREATION_PARAMETERS params;
+    HRESULT hr = IDirect3DDevice9_GetCreationParameters(dev, &params);
+    if (FAILED(hr))
+       return hr;
     out->dev   = dev;
     out->owner = false;
     out->hwnd  = hwnd;
+    out->adapterId = params.AdapterOrdinal;
+    ZeroMemory(&out->caps, sizeof(out->caps));
+    hr = IDirect3D9_GetDeviceCaps(hd3d->obj, out->adapterId, params.DeviceType, &out->caps);
+    if (FAILED(hr))
+       return hr;
     if (D3D9_FillPresentationParameters(hd3d, source, out))
     {
         return E_FAIL;



More information about the vlc-commits mailing list