[vlc-commits] d3d11_fmt: keep track if we own the device or not

Steve Lhomme git at videolan.org
Mon Nov 20 19:14:06 CET 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Sat Nov 18 14:29:25 2017 +0100| [e3f5fb031cffdeef3b8e0239b9117ac449e6dd73] | committer: Jean-Baptiste Kempf

d3d11_fmt: keep track if we own the device or not

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/avcodec/d3d11va.c  | 1 +
 modules/video_chroma/d3d11_fmt.c | 6 ++++++
 modules/video_chroma/d3d11_fmt.h | 1 +
 3 files changed, 8 insertions(+)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 0fcc7b6ab1..b17dd45cdf 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -376,6 +376,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
 
             dx_sys->d3ddev = sys->d3d_dev.d3ddevice;
             sys->d3d_dev.d3dcontext = p_sys->context;
+            sys->d3d_dev.owner = false;
             sys->d3dvidctx = d3dvidctx;
 
             assert(p_sys->texture[KNOWN_DXGI_INDEX] != NULL);
diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index 1c99ed4a84..c51a12e441 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -214,6 +214,12 @@ HRESULT D3D11_CreateDevice(vlc_object_t *obj, d3d11_handle_t *hd3d,
             hr = E_NOTIMPL;
         }
     }
+
+    if (SUCCEEDED(hr))
+    {
+        out->owner = true;
+    }
+
     return hr;
 }
 
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index d5e0848eaf..2e0fe639bc 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -33,6 +33,7 @@ typedef struct
 {
     ID3D11Device             *d3ddevice;       /* D3D device */
     ID3D11DeviceContext      *d3dcontext;      /* D3D context */
+    bool                     owner;
 } d3d11_device_t;
 
 typedef struct



More information about the vlc-commits mailing list