diff options
author | Seungha Yang <seungha@centricular.com> | 2021-04-20 02:00:18 +0900 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-04-21 05:45:59 +0000 |
commit | 817544860d96d8ef3a1ec50be45ead9b72f87713 (patch) | |
tree | 215b8e4a3fee9f98498e50f6ef2b4228cef6af00 /gst-libs/gst/d3d11 | |
parent | 33078bf54a15cf29000ee2bc160d3f12a66d4857 (diff) | |
download | gstreamer-plugins-bad-817544860d96d8ef3a1ec50be45ead9b72f87713.tar.gz |
d3d11: Add support for BGRx and RGBx formats
For such formats, we can re-use existing BGRA/RGBA implementations
but ignoring alpha channel
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2174>
Diffstat (limited to 'gst-libs/gst/d3d11')
-rw-r--r-- | gst-libs/gst/d3d11/gstd3d11device.c | 12 | ||||
-rw-r--r-- | gst-libs/gst/d3d11/gstd3d11format.h | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gst-libs/gst/d3d11/gstd3d11device.c b/gst-libs/gst/d3d11/gstd3d11device.c index 946732a25..b6d0982bc 100644 --- a/gst-libs/gst/d3d11/gstd3d11device.c +++ b/gst-libs/gst/d3d11/gstd3d11device.c @@ -494,11 +494,23 @@ gst_d3d11_device_setup_format_table (GstD3D11Device * self) priv->format_table[n_formats].dxgi_format = DXGI_FORMAT_B8G8R8A8_UNORM; n_formats++; + /* Identical to BGRA, but alpha will be ignored */ + priv->format_table[n_formats].format = GST_VIDEO_FORMAT_BGRx; + priv->format_table[n_formats].resource_format[0] = DXGI_FORMAT_B8G8R8A8_UNORM; + priv->format_table[n_formats].dxgi_format = DXGI_FORMAT_B8G8R8A8_UNORM; + n_formats++; + priv->format_table[n_formats].format = GST_VIDEO_FORMAT_RGBA; priv->format_table[n_formats].resource_format[0] = DXGI_FORMAT_R8G8B8A8_UNORM; priv->format_table[n_formats].dxgi_format = DXGI_FORMAT_R8G8B8A8_UNORM; n_formats++; + /* Identical to RGBA, but alpha will be ignored */ + priv->format_table[n_formats].format = GST_VIDEO_FORMAT_RGBx; + priv->format_table[n_formats].resource_format[0] = DXGI_FORMAT_R8G8B8A8_UNORM; + priv->format_table[n_formats].dxgi_format = DXGI_FORMAT_R8G8B8A8_UNORM; + n_formats++; + priv->format_table[n_formats].format = GST_VIDEO_FORMAT_RGB10A2_LE; priv->format_table[n_formats].resource_format[0] = DXGI_FORMAT_R10G10B10A2_UNORM; diff --git a/gst-libs/gst/d3d11/gstd3d11format.h b/gst-libs/gst/d3d11/gstd3d11format.h index 10ae5e14c..1ac521ead 100644 --- a/gst-libs/gst/d3d11/gstd3d11format.h +++ b/gst-libs/gst/d3d11/gstd3d11format.h @@ -27,7 +27,7 @@ G_BEGIN_DECLS #define GST_D3D11_COMMON_FORMATS \ - "BGRA, RGBA, RGB10A2_LE, VUYA, NV12, P010_10LE, P016_LE, I420, I420_10LE" + "BGRA, RGBA, RGB10A2_LE, BGRx, RGBx, VUYA, NV12, P010_10LE, P016_LE, I420, I420_10LE" #define GST_D3D11_EXTRA_IN_FORMATS \ "YUY2, UYVY, VYUY, Y210, Y410" @@ -41,7 +41,7 @@ G_BEGIN_DECLS #define GST_D3D11_ALL_FORMATS \ "{ " GST_D3D11_COMMON_FORMATS " ," GST_D3D11_EXTRA_IN_FORMATS " }" -#define GST_D3D11_N_FORMATS 14 +#define GST_D3D11_N_FORMATS 16 struct _GstD3D11Format { |