[vlc-commits] hw:d3d11: use D3D11_CreateProcessor()
Steve Lhomme
git at videolan.org
Mon May 28 13:24:59 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Nov 30 10:35:57 2017 +0100| [b33201277324f43f8166f66255199fa922bd94ff] | committer: Steve Lhomme
hw:d3d11: use D3D11_CreateProcessor()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b33201277324f43f8166f66255199fa922bd94ff
---
modules/hw/d3d11/d3d11_deinterlace.c | 13 ++-----------
modules/hw/d3d11/d3d11_filters.c | 13 ++-----------
modules/hw/d3d11/d3d11_surface.c | 7 +------
3 files changed, 5 insertions(+), 28 deletions(-)
diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index 2ad06e6d75..61e0cf141d 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -366,17 +366,8 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
if (D3D11_Create(filter, &sys->hd3d) != VLC_SUCCESS)
goto error;
- hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, &IID_ID3D11VideoDevice, (void **)&sys->d3d_proc.d3dviddev);
- if (FAILED(hr)) {
- msg_Err(filter, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr);
- goto error;
- }
-
- hr = ID3D11DeviceContext_QueryInterface(sys->d3d_dev.d3dcontext, &IID_ID3D11VideoContext, (void **)&sys->d3d_proc.d3dvidctx);
- if (FAILED(hr)) {
- msg_Err(filter, "Could not Query ID3D11VideoContext Interface from the picture. (hr=0x%lX)", hr);
- goto error;
- }
+ if (D3D11_CreateProcessor(filter, &sys->d3d_dev, &sys->d3d_proc) != VLC_SUCCESS)
+ goto error;
const video_format_t *fmt = &filter->fmt_out.video;
diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
index ba97a99bfc..bbffbb0da2 100644
--- a/modules/hw/d3d11/d3d11_filters.c
+++ b/modules/hw/d3d11/d3d11_filters.c
@@ -363,17 +363,8 @@ static int D3D11OpenAdjust(vlc_object_t *obj)
return VLC_ENOOBJ;
}
- hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, &IID_ID3D11VideoDevice, (void **)&sys->d3d_proc.d3dviddev);
- if (FAILED(hr)) {
- msg_Err(filter, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr);
- goto error;
- }
-
- hr = ID3D11DeviceContext_QueryInterface(sys->d3d_dev.d3dcontext, &IID_ID3D11VideoContext, (void **)&sys->d3d_proc.d3dvidctx);
- if (FAILED(hr)) {
- msg_Err(filter, "Could not Query ID3D11VideoContext Interface from the picture. (hr=0x%lX)", hr);
- goto error;
- }
+ if (D3D11_CreateProcessor(filter, &sys->d3d_dev, &sys->d3d_proc) != VLC_SUCCESS)
+ goto error;
const video_format_t *fmt = &filter->fmt_out.video;
diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 001a1c2c90..18cf764002 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -85,12 +85,7 @@ static int SetupProcessor(filter_t *p_filter, d3d11_device_t *d3d_dev,
filter_sys_t *sys = p_filter->p_sys;
HRESULT hr;
- hr = ID3D11DeviceContext_QueryInterface(d3d_dev->d3dcontext, &IID_ID3D11VideoContext, (void **)&sys->d3d_proc.d3dvidctx);
- if (unlikely(FAILED(hr)))
- goto error;
-
- hr = ID3D11Device_QueryInterface( d3d_dev->d3ddevice, &IID_ID3D11VideoDevice, (void **)&sys->d3d_proc.d3dviddev);
- if (unlikely(FAILED(hr)))
+ if (D3D11_CreateProcessor(p_filter, d3d_dev, &sys->d3d_proc) != VLC_SUCCESS)
goto error;
const video_format_t *fmt = &p_filter->fmt_in.video;
More information about the vlc-commits
mailing list