d3d12: Add BGRA64 and BGR10A2 format support

Map BGRA64 and BGR10A2 to Y416 and Y410, respectively,
since it's possible RGB space decoder output

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7092>
This commit is contained in:
Seungha Yang 2024-06-23 22:00:40 +09:00
parent 66cc3ff84e
commit 94bb9fec58
3 changed files with 13 additions and 4 deletions

View file

@ -42,8 +42,9 @@
/* DXGI (semi) native formats */ /* DXGI (semi) native formats */
#define GST_D3D12_TIER_0_FORMATS \ #define GST_D3D12_TIER_0_FORMATS \
"RGBA64_LE, Y416_LE, Y412_LE, RGB10A2_LE, Y410, Y216_LE, Y212_LE, Y210, " \ "RGBA64_LE, BGRA64_LE, Y416_LE, Y412_LE, RGB10A2_LE, Y410, BGR10A2_LE, Y216_LE, Y212_LE, " \
"VUYA, RGBA, BGRA, RBGA, P016_LE, P012_LE, P010_10LE, RGBx, BGRx, YUY2, NV12" "Y210, VUYA, RGBA, BGRA, RBGA, P016_LE, P012_LE, P010_10LE, RGBx, BGRx, " \
"YUY2, NV12"
/* both SRV and RTV are supported */ /* both SRV and RTV are supported */
#define GST_D3D12_TIER_1_FORMATS \ #define GST_D3D12_TIER_1_FORMATS \

View file

@ -161,6 +161,14 @@ gst_d3d12_pack_new (GstD3D12Device * device,
case GST_VIDEO_FORMAT_Y216_LE: case GST_VIDEO_FORMAT_Y216_LE:
conv_format = GST_VIDEO_FORMAT_AYUV64; conv_format = GST_VIDEO_FORMAT_AYUV64;
break; break;
case GST_VIDEO_FORMAT_BGR10A2_LE:
gst_video_info_set_format (&priv->in_info, GST_VIDEO_FORMAT_RGB10A2_LE,
converter_output_info->width, converter_output_info->height);
break;
case GST_VIDEO_FORMAT_BGRA64_LE:
gst_video_info_set_format (&priv->in_info, GST_VIDEO_FORMAT_RGBA64_LE,
converter_output_info->width, converter_output_info->height);
break;
default: default:
return self; return self;
} }

View file

@ -354,8 +354,8 @@ static const GstD3D12Format g_format_map[] = {
FormatBuilder::RgbPacked (GST_VIDEO_FORMAT_RGBA64_LE, FormatBuilder::RgbPacked (GST_VIDEO_FORMAT_RGBA64_LE,
DXGI_FORMAT_R16G16B16A16_UNORM), DXGI_FORMAT_R16G16B16A16_UNORM),
FormatBuilder::NotSupported(GST_VIDEO_FORMAT_RGBA64_BE), FormatBuilder::NotSupported(GST_VIDEO_FORMAT_RGBA64_BE),
FormatBuilder::RgbPacked (GST_VIDEO_FORMAT_BGRA64_LE, FormatBuilder::YuvPacked (GST_VIDEO_FORMAT_BGRA64_LE,
DXGI_FORMAT_R16G16B16A16_UNORM), DXGI_FORMAT_Y416, DXGI_FORMAT_R16G16B16A16_UNORM),
FormatBuilder::NotSupported(GST_VIDEO_FORMAT_BGRA64_BE), FormatBuilder::NotSupported(GST_VIDEO_FORMAT_BGRA64_BE),
FormatBuilder::RgbPacked (GST_VIDEO_FORMAT_ABGR64_LE, FormatBuilder::RgbPacked (GST_VIDEO_FORMAT_ABGR64_LE,
DXGI_FORMAT_R16G16B16A16_UNORM), DXGI_FORMAT_R16G16B16A16_UNORM),