[vlc-commits] d3d9_filters: log possible errors when creating the adjust filter

2018-03-14 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | Tue Mar 13 
11:18:12 2018 +0100| [301950395f0df015194bd9ffdffa16fce683ba06] | committer: 
Hugo Beauzée-Luyssen

d3d9_filters: log possible errors when creating the adjust filter

(cherry picked from commit a763f362af3e1a7d1467b35c2c2b811dfdb8a110)
Signed-off-by: Hugo Beauzée-Luyssen 

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

 modules/hw/d3d9/d3d9_filters.c | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/modules/hw/d3d9/d3d9_filters.c b/modules/hw/d3d9/d3d9_filters.c
index 8d1f7be7ca..8772d3c4a3 100644
--- a/modules/hw/d3d9/d3d9_filters.c
+++ b/modules/hw/d3d9/d3d9_filters.c
@@ -261,12 +261,18 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
 CreateVideoService =
   (void *)GetProcAddress(hdecoder_dll, "DXVA2CreateVideoService");
 if (CreateVideoService == NULL)
+{
+msg_Err(filter, "Can't create video service");
 goto error;
+}
 
 hr = CreateVideoService( sys->d3d_dev.dev, 
_IDirectXVideoProcessorService,
 (void**));
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to create the video processor. (hr=0x%lX)", 
hr);
 goto error;
+}
 
 DXVA2_VideoDesc dsc;
 ZeroMemory(, sizeof(dsc));
@@ -291,7 +297,10 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
 ,
 
);
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get processor GUIDs. (hr=0x%lX)", hr);
 goto error;
+}
 
 const UINT neededCaps = DXVA2_ProcAmp_Brightness |
 DXVA2_ProcAmp_Contrast |
@@ -325,25 +334,37 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
 dstDesc.Format, 
DXVA2_ProcAmp_Brightness,
 >Brightness.Range 
);
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get the brightness range. (hr=0x%lX)", hr);
 goto error;
+}
 
 hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, 
processorGUID, ,
 dstDesc.Format, 
DXVA2_ProcAmp_Contrast,
 >Contrast.Range );
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get the contrast range. (hr=0x%lX)", hr);
 goto error;
+}
 
 hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, 
processorGUID, ,
 dstDesc.Format, 
DXVA2_ProcAmp_Hue,
 >Hue.Range );
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get the hue range. (hr=0x%lX)", hr);
 goto error;
+}
 
 hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, 
processorGUID, ,
 dstDesc.Format, 
DXVA2_ProcAmp_Saturation,
 >Saturation.Range 
);
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get the saturation range. (hr=0x%lX)", hr);
 goto error;
+}
 
 /* needed to get options passed in transcode using the
  * adjust{name=value} syntax */
@@ -369,7 +390,10 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
  1,
  >processor );
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to create the video processor. (hr=0x%lX)", 
hr);
 goto error;
+}
 
 hr = IDirectXVideoProcessorService_CreateSurface( processor,
   dstDesc.Width,
@@ -382,7 +406,10 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
   >hw_surface,
   NULL);
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to create the hardware surface. (hr=0x%lX)", 
hr);
 goto error;
+}
 
 CoTaskMemFree(processorGUIDs);
 IDirectXVideoProcessorService_Release(processor);

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] d3d9_filters: log possible errors when creating the adjust filter

2018-03-13 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Tue Mar 13 11:18:12 
2018 +0100| [a763f362af3e1a7d1467b35c2c2b811dfdb8a110] | committer: Steve Lhomme

d3d9_filters: log possible errors when creating the adjust filter

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

 modules/hw/d3d9/d3d9_filters.c | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/modules/hw/d3d9/d3d9_filters.c b/modules/hw/d3d9/d3d9_filters.c
index 72357c649c..dca5e4229a 100644
--- a/modules/hw/d3d9/d3d9_filters.c
+++ b/modules/hw/d3d9/d3d9_filters.c
@@ -261,12 +261,18 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
 CreateVideoService =
   (void *)GetProcAddress(hdecoder_dll, "DXVA2CreateVideoService");
 if (CreateVideoService == NULL)
+{
+msg_Err(filter, "Can't create video service");
 goto error;
+}
 
 hr = CreateVideoService( sys->d3d_dev.dev, 
_IDirectXVideoProcessorService,
 (void**));
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to create the video processor. (hr=0x%lX)", 
hr);
 goto error;
+}
 
 DXVA2_VideoDesc dsc;
 ZeroMemory(, sizeof(dsc));
@@ -291,7 +297,10 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
 ,
 
);
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get processor GUIDs. (hr=0x%lX)", hr);
 goto error;
+}
 
 const UINT neededCaps = DXVA2_ProcAmp_Brightness |
 DXVA2_ProcAmp_Contrast |
@@ -325,25 +334,37 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
 dstDesc.Format, 
DXVA2_ProcAmp_Brightness,
 >Brightness.Range 
);
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get the brightness range. (hr=0x%lX)", hr);
 goto error;
+}
 
 hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, 
processorGUID, ,
 dstDesc.Format, 
DXVA2_ProcAmp_Contrast,
 >Contrast.Range );
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get the contrast range. (hr=0x%lX)", hr);
 goto error;
+}
 
 hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, 
processorGUID, ,
 dstDesc.Format, 
DXVA2_ProcAmp_Hue,
 >Hue.Range );
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get the hue range. (hr=0x%lX)", hr);
 goto error;
+}
 
 hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, 
processorGUID, ,
 dstDesc.Format, 
DXVA2_ProcAmp_Saturation,
 >Saturation.Range 
);
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to get the saturation range. (hr=0x%lX)", hr);
 goto error;
+}
 
 /* needed to get options passed in transcode using the
  * adjust{name=value} syntax */
@@ -369,7 +390,10 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
  1,
  >processor );
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to create the video processor. (hr=0x%lX)", 
hr);
 goto error;
+}
 
 hr = IDirectXVideoProcessorService_CreateSurface( processor,
   dstDesc.Width,
@@ -382,7 +406,10 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
   >hw_surface,
   NULL);
 if (FAILED(hr))
+{
+msg_Err(filter, "Failed to create the hardware surface. (hr=0x%lX)", 
hr);
 goto error;
+}
 
 CoTaskMemFree(processorGUIDs);
 IDirectXVideoProcessorService_Release(processor);

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits