d3d11colorconverter: Handle P016_LE format

P016 format is no different than P010. Not much things to add code.
This commit is contained in:
Seungha Yang 2020-01-09 19:39:59 +09:00
parent bbab229905
commit 49a1f022fd
3 changed files with 11 additions and 1 deletions

View file

@ -560,6 +560,7 @@ setup_convert_info_yuv_to_rgb (GstD3D11ColorConverter * self,
break;
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_P010_10LE:
case GST_VIDEO_FORMAT_P016_LE:
info->ps_body[0] = g_strdup_printf (templ_SEMI_PLANAR_to_RGB_BODY);
break;
default:
@ -586,6 +587,7 @@ setup_convert_info_rgb_to_yuv (GstD3D11ColorConverter * self,
break;
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_P010_10LE:
case GST_VIDEO_FORMAT_P016_LE:
info->ps_body[0] = g_strdup_printf (templ_RGB_to_LUMA_BODY, 1);
info->ps_body[1] = g_strdup_printf (templ_RGB_to_SEMI_PLANAR_CHROMA_BODY);
break;
@ -1265,6 +1267,7 @@ gst_d3d11_color_converter_update_rect (GstD3D11ColorConverter * converter,
switch (GST_VIDEO_INFO_FORMAT (&converter->out_info)) {
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_P010_10LE:
case GST_VIDEO_FORMAT_P016_LE:
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_I420_10LE:{
gint i;

View file

@ -33,6 +33,7 @@ GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_format_debug);
* DXGI_FORMAT_AYUV
* DXGI_FORMAT_NV12
* DXGI_FORMAT_P010
* DXGI_FORMAT_P016
* ...
*/
static const GstD3D11Format legacy_d3d11_formats[] = {
@ -53,6 +54,8 @@ static const GstD3D11Format legacy_d3d11_formats[] = {
{DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8_UNORM}},
{GST_VIDEO_FORMAT_P010_10LE, DXGI_FORMAT_UNKNOWN,
{DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16G16_UNORM}},
{GST_VIDEO_FORMAT_P016_LE, DXGI_FORMAT_UNKNOWN,
{DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16G16_UNORM}},
/* YUV planner */
{GST_VIDEO_FORMAT_I420, DXGI_FORMAT_UNKNOWN,
@ -82,6 +85,8 @@ static const GstD3D11Format d3d11_formats[] = {
{DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8_UNORM}},
{GST_VIDEO_FORMAT_P010_10LE, DXGI_FORMAT_P010,
{DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16G16_UNORM}},
{GST_VIDEO_FORMAT_P016_LE, DXGI_FORMAT_P016,
{DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16G16_UNORM}},
/* YUV planner */
{GST_VIDEO_FORMAT_I420, DXGI_FORMAT_UNKNOWN,
@ -145,6 +150,7 @@ gst_d3d11_dxgi_format_n_planes (DXGI_FORMAT format)
return 1;
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
return 2;
default:
break;
@ -175,6 +181,7 @@ gst_d3d11_dxgi_format_get_size (DXGI_FORMAT format, guint width, guint height,
break;
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
offset[0] = 0;
stride[0] = pitch;
offset[1] = offset[0] + stride[0] * height;

View file

@ -26,7 +26,7 @@
#include "gstd3d11_fwd.h"
#define GST_D3D11_FORMATS \
"{ BGRA, RGBA, RGB10A2_LE, VUYA, NV12, P010_10LE, I420, I420_10LE }"
"{ BGRA, RGBA, RGB10A2_LE, VUYA, NV12, P010_10LE, P016_LE, I420, I420_10LE }"
G_BEGIN_DECLS