[vlc-commits] dxgi_fmt: rename some defines/constants from D3D11_ to DXGI_
Steve Lhomme
git at videolan.org
Wed Feb 10 11:06:57 UTC 2021
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jan 25 08:42:52 2021 +0100| [ed6e9b9a9f2d3a33844136b72db3716692e9cd2f] | committer: Steve Lhomme
dxgi_fmt: rename some defines/constants from D3D11_ to DXGI_
Move some defines from d3d11_fmt.h to dxgi_fmt.h.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ed6e9b9a9f2d3a33844136b72db3716692e9cd2f
---
modules/codec/avcodec/d3d11va.c | 16 ++++++++--------
modules/hw/d3d11/d3d11_surface.c | 2 +-
modules/video_chroma/d3d11_fmt.c | 4 ++--
modules/video_chroma/d3d11_fmt.h | 6 ------
modules/video_chroma/dxgi_fmt.h | 6 ++++++
modules/video_output/win32/d3d11_swapchain.c | 8 ++++----
modules/video_output/win32/direct3d11.c | 16 ++++++++--------
7 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 753aaca986..aca1443984 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -403,18 +403,18 @@ static int DxSetupOutput(vlc_va_t *va, const directx_va_mode_t *mode, const vide
int idx = 0;
const d3d_format_t *decoder_format;
UINT supportFlags = D3D11_FORMAT_SUPPORT_DECODER_OUTPUT | D3D11_FORMAT_SUPPORT_SHADER_LOAD;
- decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, D3D11_RGB_FORMAT|D3D11_YUV_FORMAT,
+ decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
mode->bit_depth, mode->log2_chroma_h+1, mode->log2_chroma_w+1,
- D3D11_CHROMA_GPU, supportFlags );
+ DXGI_CHROMA_GPU, supportFlags );
if (decoder_format == NULL)
- decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, D3D11_RGB_FORMAT|D3D11_YUV_FORMAT,
- mode->bit_depth, 0, 0, D3D11_CHROMA_GPU, supportFlags );
+ decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
+ mode->bit_depth, 0, 0, DXGI_CHROMA_GPU, supportFlags );
if (decoder_format == NULL && mode->bit_depth > 10)
- decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, D3D11_RGB_FORMAT|D3D11_YUV_FORMAT,
- 10, 0, 0, D3D11_CHROMA_GPU, supportFlags );
+ decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
+ 10, 0, 0, DXGI_CHROMA_GPU, supportFlags );
if (decoder_format == NULL)
- decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, D3D11_RGB_FORMAT|D3D11_YUV_FORMAT,
- 0, 0, 0, D3D11_CHROMA_GPU, supportFlags );
+ decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
+ 0, 0, 0, DXGI_CHROMA_GPU, supportFlags );
if (decoder_format != NULL)
{
msg_Dbg(va, "favor decoder format %s", decoder_format->name);
diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 1f53d74230..9ce9b8e882 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -183,7 +183,7 @@ static int assert_staging(filter_t *p_filter, filter_sys_t *sys, DXGI_FORMAT for
/* failed with the this format, try a different one */
UINT supportFlags = D3D11_FORMAT_SUPPORT_SHADER_LOAD | D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT;
const d3d_format_t *new_fmt =
- FindD3D11Format( p_filter, d3d_dev, 0, D3D11_RGB_FORMAT|D3D11_YUV_FORMAT, 0, 0, 0, D3D11_CHROMA_CPU, supportFlags );
+ FindD3D11Format( p_filter, d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0, DXGI_CHROMA_CPU, supportFlags );
if (new_fmt && texDesc.Format != new_fmt->formatTexture)
{
DXGI_FORMAT srcFormat = texDesc.Format;
diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index 2cf12f2c21..f8a04a4a89 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -710,10 +710,10 @@ const d3d_format_t *(FindD3D11Format)(vlc_object_t *o,
continue;
if (bits_per_channel && bits_per_channel > output_format->bitsPerChannel)
continue;
- int cpu_gpu_fmt = is_d3d11_opaque(output_format->fourcc) ? D3D11_CHROMA_GPU : D3D11_CHROMA_CPU;
+ int cpu_gpu_fmt = is_d3d11_opaque(output_format->fourcc) ? DXGI_CHROMA_GPU : DXGI_CHROMA_CPU;
if ((cpu_gpu & cpu_gpu_fmt)==0)
continue;
- int format = vlc_fourcc_IsYUV(output_format->fourcc) ? D3D11_YUV_FORMAT : D3D11_RGB_FORMAT;
+ int format = vlc_fourcc_IsYUV(output_format->fourcc) ? DXGI_YUV_FORMAT : DXGI_RGB_FORMAT;
if ((rgb_yuv & format)==0)
continue;
if (widthDenominator && widthDenominator < output_format->widthDenominator)
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index 845c7e409c..0e1ba14f92 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -151,12 +151,6 @@ int D3D11CheckDriverVersion(const d3d11_device_t *, UINT vendorId,
bool DeviceSupportsFormat(ID3D11Device *d3ddevice, DXGI_FORMAT format, UINT supportFlags);
-#define D3D11_RGB_FORMAT 1
-#define D3D11_YUV_FORMAT 2
-
-#define D3D11_CHROMA_CPU 1
-#define D3D11_CHROMA_GPU 2
-
const d3d_format_t *FindD3D11Format(vlc_object_t *,
d3d11_device_t*,
vlc_fourcc_t i_src_chroma,
diff --git a/modules/video_chroma/dxgi_fmt.h b/modules/video_chroma/dxgi_fmt.h
index f104614d9f..da9252d688 100644
--- a/modules/video_chroma/dxgi_fmt.h
+++ b/modules/video_chroma/dxgi_fmt.h
@@ -60,4 +60,10 @@ UINT DxgiResourceCount(const d3d_format_t *);
bool DxgiIsRGBFormat(const d3d_format_t *);
+#define DXGI_RGB_FORMAT 1
+#define DXGI_YUV_FORMAT 2
+
+#define DXGI_CHROMA_CPU 1
+#define DXGI_CHROMA_GPU 2
+
#endif /* include-guard */
diff --git a/modules/video_output/win32/d3d11_swapchain.c b/modules/video_output/win32/d3d11_swapchain.c
index c4bb5015f8..4b67ec4655 100644
--- a/modules/video_output/win32/d3d11_swapchain.c
+++ b/modules/video_output/win32/d3d11_swapchain.c
@@ -120,15 +120,15 @@ static bool UpdateSwapchain( struct d3d11_local_swapchain *display, const libvlc
}
#else /* !VLC_WINSTORE_APP */
/* favor RGB formats first */
- newPixelFormat = FindD3D11Format( display->obj, display->d3d_dev, 0, D3D11_RGB_FORMAT,
+ newPixelFormat = FindD3D11Format( display->obj, display->d3d_dev, 0, DXGI_RGB_FORMAT,
cfg->bitdepth > 8 ? 10 : 8,
0, 0,
- D3D11_CHROMA_CPU, D3D11_FORMAT_SUPPORT_DISPLAY );
+ DXGI_CHROMA_CPU, D3D11_FORMAT_SUPPORT_DISPLAY );
if (unlikely(newPixelFormat == NULL))
- newPixelFormat = FindD3D11Format( display->obj, display->d3d_dev, 0, D3D11_YUV_FORMAT,
+ newPixelFormat = FindD3D11Format( display->obj, display->d3d_dev, 0, DXGI_YUV_FORMAT,
cfg->bitdepth > 8 ? 10 : 8,
0, 0,
- D3D11_CHROMA_CPU, D3D11_FORMAT_SUPPORT_DISPLAY );
+ DXGI_CHROMA_CPU, D3D11_FORMAT_SUPPORT_DISPLAY );
#endif /* !VLC_WINSTORE_APP */
if (unlikely(newPixelFormat == NULL)) {
msg_Err(display->obj, "Could not get the SwapChain format.");
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 912afae420..09ea0c860e 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -735,15 +735,15 @@ static const d3d_format_t *GetDirectRenderingFormat(vout_display_t *vd, vlc_four
UINT supportFlags = D3D11_FORMAT_SUPPORT_SHADER_LOAD;
if (is_d3d11_opaque(i_src_chroma))
supportFlags |= D3D11_FORMAT_SUPPORT_DECODER_OUTPUT;
- return FindD3D11Format( vd, vd->sys->d3d_dev, i_src_chroma, D3D11_RGB_FORMAT|D3D11_YUV_FORMAT, 0, 0, 0,
- is_d3d11_opaque(i_src_chroma) ? D3D11_CHROMA_GPU : D3D11_CHROMA_CPU, supportFlags );
+ return FindD3D11Format( vd, vd->sys->d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0,
+ is_d3d11_opaque(i_src_chroma) ? DXGI_CHROMA_GPU : DXGI_CHROMA_CPU, supportFlags );
}
static const d3d_format_t *GetDirectDecoderFormat(vout_display_t *vd, vlc_fourcc_t i_src_chroma)
{
UINT supportFlags = D3D11_FORMAT_SUPPORT_DECODER_OUTPUT;
- return FindD3D11Format( vd, vd->sys->d3d_dev, i_src_chroma, D3D11_RGB_FORMAT|D3D11_YUV_FORMAT, 0, 0, 0,
- D3D11_CHROMA_GPU, supportFlags );
+ return FindD3D11Format( vd, vd->sys->d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0,
+ DXGI_CHROMA_GPU, supportFlags );
}
static const d3d_format_t *GetDisplayFormatByDepth(vout_display_t *vd, uint8_t bit_depth,
@@ -757,13 +757,13 @@ static const d3d_format_t *GetDisplayFormatByDepth(vout_display_t *vd, uint8_t b
supportFlags |= D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT;
return FindD3D11Format( vd, vd->sys->d3d_dev, 0, rgb_yuv,
bit_depth, widthDenominator+1, heightDenominator+1,
- D3D11_CHROMA_CPU, supportFlags );
+ DXGI_CHROMA_CPU, supportFlags );
}
static const d3d_format_t *GetBlendableFormat(vout_display_t *vd, vlc_fourcc_t i_src_chroma)
{
UINT supportFlags = D3D11_FORMAT_SUPPORT_SHADER_LOAD | D3D11_FORMAT_SUPPORT_BLENDABLE;
- return FindD3D11Format( vd, vd->sys->d3d_dev, i_src_chroma, D3D11_RGB_FORMAT|D3D11_YUV_FORMAT, 0, 0, 0, D3D11_CHROMA_CPU, supportFlags );
+ return FindD3D11Format( vd, vd->sys->d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0, DXGI_CHROMA_CPU, supportFlags );
}
static int Direct3D11Open(vout_display_t *vd, video_format_t *fmtp, vlc_video_context *vctx)
@@ -925,12 +925,12 @@ static int SetupOutputFormat(vout_display_t *vd, video_format_t *fmt, vlc_video_
sys->picQuad.generic.textureFormat = GetDisplayFormatByDepth(vd, bits_per_channel,
widthDenominator, heightDenominator,
decoder_format!=NULL,
- is_rgb ? D3D11_RGB_FORMAT : D3D11_YUV_FORMAT);
+ is_rgb ? DXGI_RGB_FORMAT : DXGI_YUV_FORMAT);
if (!sys->picQuad.generic.textureFormat)
sys->picQuad.generic.textureFormat = GetDisplayFormatByDepth(vd, bits_per_channel,
widthDenominator, heightDenominator,
decoder_format!=NULL,
- is_rgb ? D3D11_YUV_FORMAT : D3D11_RGB_FORMAT);
+ is_rgb ? DXGI_YUV_FORMAT : DXGI_RGB_FORMAT);
}
// look for any pixel format that we can handle
More information about the vlc-commits
mailing list