msdkh265enc: add support for Y410 in sink pad

Sample pipeline:
gst-launch-1.0 videotestsrc ! video/x-raw,format=Y410 !
msdkh265enc low-power=1 ! filesink location=output.h265
This commit is contained in:
Haihao Xiang 2019-09-30 10:13:56 +08:00
parent 0507547646
commit 83100b3504
2 changed files with 13 additions and 1 deletions

View file

@ -271,6 +271,7 @@ gst_msdkenc_init_encoder (GstMsdkEnc * thiz)
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_P010_10LE:
case GST_VIDEO_FORMAT_VUYA:
case GST_VIDEO_FORMAT_Y410:
need_vpp = FALSE;
break;
case GST_VIDEO_FORMAT_YV12:
@ -424,6 +425,12 @@ gst_msdkenc_init_encoder (GstMsdkEnc * thiz)
thiz->param.mfx.FrameInfo.BitDepthLuma = 8;
thiz->param.mfx.FrameInfo.BitDepthChroma = 8;
break;
case GST_VIDEO_FORMAT_Y410:
thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_Y410;
thiz->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
thiz->param.mfx.FrameInfo.BitDepthLuma = 10;
thiz->param.mfx.FrameInfo.BitDepthChroma = 10;
break;
default:
thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
thiz->param.mfx.FrameInfo.BitDepthLuma = 8;

View file

@ -49,7 +49,7 @@ enum
#define PROP_LOWPOWER_DEFAULT FALSE
#define COMMON_FORMAT "{ NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE, VUYA }"
#define COMMON_FORMAT "{ NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE, VUYA, Y410 }"
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
@ -107,6 +107,7 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder)
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN10;
break;
case MFX_FOURCC_AYUV:
case MFX_FOURCC_Y410:
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_REXT;
break;
default:
@ -188,6 +189,10 @@ gst_msdkh265enc_set_src_caps (GstMsdkEnc * encoder)
case MFX_FOURCC_AYUV:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main-444", NULL);
break;
case MFX_FOURCC_Y410:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main-444-10",
NULL);
break;
default:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main", NULL);
break;