[vlc-commits] hw:d3d11: make the VideoProcessor logging local to D3D11_CreateProcessor
Steve Lhomme
git at videolan.org
Mon May 28 13:25:01 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Nov 30 11:01:11 2017 +0100| [64add10dc13d791422e75f0aaae0f0baf13c140e] | committer: Steve Lhomme
hw:d3d11: make the VideoProcessor logging local to D3D11_CreateProcessor
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=64add10dc13d791422e75f0aaae0f0baf13c140e
---
modules/hw/d3d11/d3d11_deinterlace.c | 3 ---
modules/hw/d3d11/d3d11_filters.c | 3 ---
modules/hw/d3d11/d3d11_processor.c | 34 ++++++++++++++++++++++++++++++++++
modules/hw/d3d11/d3d11_surface.c | 3 ---
modules/video_chroma/d3d11_fmt.c | 32 --------------------------------
modules/video_chroma/d3d11_fmt.h | 5 -----
6 files changed, 34 insertions(+), 46 deletions(-)
diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index c6224cabc1..b0d6d87e21 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -372,9 +372,6 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
goto error;
UINT flags;
-#ifndef NDEBUG
- D3D11_LogProcessorSupport(filter, sys->d3d_proc.procEnumerator);
-#endif
hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(sys->d3d_proc.procEnumerator, dstDesc.Format, &flags);
if (!SUCCEEDED(hr))
{
diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
index a96274eb50..a594c2b342 100644
--- a/modules/hw/d3d11/d3d11_filters.c
+++ b/modules/hw/d3d11/d3d11_filters.c
@@ -372,9 +372,6 @@ static int D3D11OpenAdjust(vlc_object_t *obj)
goto error;
UINT flags;
-#ifndef NDEBUG
- D3D11_LogProcessorSupport(filter, sys->d3d_proc.procEnumerator);
-#endif
hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(sys->d3d_proc.procEnumerator, dstDesc.Format, &flags);
if (!SUCCEEDED(hr))
{
diff --git a/modules/hw/d3d11/d3d11_processor.c b/modules/hw/d3d11/d3d11_processor.c
index 37a2110ce7..2688077a71 100644
--- a/modules/hw/d3d11/d3d11_processor.c
+++ b/modules/hw/d3d11/d3d11_processor.c
@@ -36,6 +36,36 @@
#include "d3d11_processor.h"
#if defined(ID3D11VideoContext_VideoProcessorBlt)
+#ifndef NDEBUG
+static void LogProcessorSupport(vlc_object_t *o,
+ ID3D11VideoProcessorEnumerator *processorEnumerator)
+{
+ UINT flags;
+ HRESULT hr;
+ for (int format = 0; format < 188; format++) {
+ hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, format, &flags);
+ if (FAILED(hr))
+ continue;
+ const char *name = DxgiFormatToStr(format);
+ const char *support = NULL;
+ if ((flags & (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT|D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT))
+ == (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT|D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT))
+ support = "input/output";
+ else if (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT)
+ support = "input";
+ else if (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)
+ support = "output";
+ if (support)
+ {
+ if (name)
+ msg_Dbg(o, "processor format %s is supported for %s", name, support);
+ else
+ msg_Dbg(o, "processor format (%d) is supported for %s", format, support);
+ }
+ }
+}
+#endif
+
#undef D3D11_CreateProcessor
int D3D11_CreateProcessor(vlc_object_t *o, d3d11_device_t *d3d_dev,
D3D11_VIDEO_FRAME_FORMAT srcFields,
@@ -80,6 +110,10 @@ int D3D11_CreateProcessor(vlc_object_t *o, d3d11_device_t *d3d_dev,
goto error;
}
+#ifndef NDEBUG
+ LogProcessorSupport(o, out->procEnumerator);
+#endif
+
return VLC_SUCCESS;
error:
D3D11_ReleaseProcessor(out);
diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index c5482b80bf..31a3d0201b 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -90,9 +90,6 @@ static int SetupProcessor(filter_t *p_filter, d3d11_device_t *d3d_dev,
goto error;
UINT flags;
-#ifndef NDEBUG
- D3D11_LogProcessorSupport(p_filter, sys->d3d_proc.procEnumerator);
-#endif
/* shortcut for the rendering output */
hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(sys->d3d_proc.procEnumerator, srcFormat, &flags);
if (FAILED(hr) || !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT))
diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index 9247ac0628..5d6ccc6469 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -611,35 +611,3 @@ void D3D11_Destroy(d3d11_handle_t *hd3d)
#endif
#endif
}
-
-#ifndef NDEBUG
-#undef D3D11_LogProcessorSupport
-void D3D11_LogProcessorSupport(vlc_object_t *o,
- ID3D11VideoProcessorEnumerator *processorEnumerator)
-{
- UINT flags;
- HRESULT hr;
- for (int format = 0; format < 188; format++) {
- hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, format, &flags);
- if (FAILED(hr))
- continue;
- const char *name = DxgiFormatToStr(format);
- const char *support = NULL;
- if ((flags & (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT|D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT))
- == (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT|D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT))
- support = "input/output";
- else if (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT)
- support = "input";
- else if (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)
- support = "output";
- if (support)
- {
- if (name)
- msg_Dbg(o, "processor format %s is supported for %s", name, support);
- else
- msg_Dbg(o, "processor format (%d) is supported for %s", format, support);
- }
- }
-}
-
-#endif
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index ba10ddfb81..49465ae5a3 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -136,11 +136,6 @@ int AllocateTextures(vlc_object_t *obj, d3d11_device_t *d3d_dev,
const d3d_format_t *cfg, const video_format_t *fmt,
unsigned pool_size, ID3D11Texture2D *textures[]);
-#ifndef NDEBUG
-void D3D11_LogProcessorSupport(vlc_object_t*, ID3D11VideoProcessorEnumerator*);
-#define D3D11_LogProcessorSupport(a,b) D3D11_LogProcessorSupport( VLC_OBJECT(a), b )
-#endif
-
static inline void d3d11_device_lock(d3d11_device_t *d3d_dev)
{
if( d3d_dev->context_mutex != INVALID_HANDLE_VALUE )
More information about the vlc-commits
mailing list