[vlc-commits] direct3d11: use VLC_CODEC_D3D11_OPAQUE_BGRA for BGRA display
Steve Lhomme
git at videolan.org
Wed Feb 21 12:20:47 CET 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jan 29 17:42:18 2018 +0100| [ec9f73e397fe0a980f25098cd1d66892c57b4695] | committer: Steve Lhomme
direct3d11: use VLC_CODEC_D3D11_OPAQUE_BGRA for BGRA display
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ec9f73e397fe0a980f25098cd1d66892c57b4695
---
modules/video_chroma/d3d11_fmt.h | 3 ++-
modules/video_chroma/dxgi_fmt.c | 4 ++--
modules/video_output/win32/direct3d11.c | 1 +
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index e7685b2d5f..667a601c8d 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -83,7 +83,8 @@ static inline bool is_d3d11_opaque(vlc_fourcc_t chroma)
{
return chroma == VLC_CODEC_D3D11_OPAQUE ||
chroma == VLC_CODEC_D3D11_OPAQUE_10B ||
- chroma == VLC_CODEC_D3D11_OPAQUE_RGBA;
+ chroma == VLC_CODEC_D3D11_OPAQUE_RGBA ||
+ chroma == VLC_CODEC_D3D11_OPAQUE_BGRA;
}
void AcquirePictureSys(picture_sys_t *p_sys);
diff --git a/modules/video_chroma/dxgi_fmt.c b/modules/video_chroma/dxgi_fmt.c
index 66c73bcd3e..f2ef8e35f2 100644
--- a/modules/video_chroma/dxgi_fmt.c
+++ b/modules/video_chroma/dxgi_fmt.c
@@ -80,7 +80,7 @@ static const d3d_format_t d3d_formats[] = {
{ "I420", DXGI_FORMAT_UNKNOWN, VLC_CODEC_I420, 8, 2, 2, { DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM } },
{ "I420_10", DXGI_FORMAT_UNKNOWN, VLC_CODEC_I420_10L, 10, 2, 2, { DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM } },
{ "B8G8R8A8", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_BGRA, 8, 1, 1, { DXGI_FORMAT_B8G8R8A8_UNORM } },
- { "VA_BGRA", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_D3D11_OPAQUE_RGBA, 8, 1, 1, { DXGI_FORMAT_B8G8R8A8_UNORM } },
+ { "VA_BGRA", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_D3D11_OPAQUE_BGRA, 8, 1, 1, { DXGI_FORMAT_B8G8R8A8_UNORM } },
{ "R8G8B8A8", DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_RGBA, 8, 1, 1, { DXGI_FORMAT_R8G8B8A8_UNORM } },
{ "VA_RGBA", DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_D3D11_OPAQUE_RGBA, 8, 1, 1, { DXGI_FORMAT_R8G8B8A8_UNORM } },
{ "R8G8B8X8", DXGI_FORMAT_B8G8R8X8_UNORM, VLC_CODEC_RGB32, 8, 1, 1, { DXGI_FORMAT_B8G8R8X8_UNORM } },
@@ -120,7 +120,7 @@ const d3d_format_t *GetRenderFormatList(void)
void DxgiFormatMask(DXGI_FORMAT format, video_format_t *fmt)
{
- if (format == DXGI_FORMAT_B8G8R8X8_UNORM)
+ if (format == DXGI_FORMAT_B8G8R8X8_UNORM || format == DXGI_FORMAT_B8G8R8A8_UNORM)
{
fmt->i_rmask = 0x0000ff00;
fmt->i_gmask = 0x00ff0000;
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 377fb33a8d..5574e3f296 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1629,6 +1629,7 @@ static int SetupOutputFormat(vout_display_t *vd, video_format_t *fmt)
{
case VLC_CODEC_D3D11_OPAQUE:
case VLC_CODEC_D3D11_OPAQUE_RGBA:
+ case VLC_CODEC_D3D11_OPAQUE_BGRA:
bits_per_channel = 8;
break;
case VLC_CODEC_D3D11_OPAQUE_10B:
More information about the vlc-commits
mailing list