msdkh265enc: add support for VUYA in sink pad

sample pipelie:
gst-launch-1.0 videotestsrc ! video/x-raw,format=VUYA !
msdkh265enc low-power=1 ! filesink location=output.h265
This commit is contained in:
Haihao Xiang 2019-09-30 09:48:26 +08:00
parent 85914997f5
commit 0507547646
2 changed files with 15 additions and 2 deletions

View file

@ -270,6 +270,7 @@ gst_msdkenc_init_encoder (GstMsdkEnc * thiz)
switch (GST_VIDEO_INFO_FORMAT (info)) {
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_P010_10LE:
case GST_VIDEO_FORMAT_VUYA:
need_vpp = FALSE;
break;
case GST_VIDEO_FORMAT_YV12:
@ -417,6 +418,12 @@ gst_msdkenc_init_encoder (GstMsdkEnc * thiz)
thiz->param.mfx.FrameInfo.BitDepthChroma = 10;
thiz->param.mfx.FrameInfo.Shift = 1;
break;
case GST_VIDEO_FORMAT_VUYA:
thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_AYUV;
thiz->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
thiz->param.mfx.FrameInfo.BitDepthLuma = 8;
thiz->param.mfx.FrameInfo.BitDepthChroma = 8;
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 }"
#define COMMON_FORMAT "{ NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE, VUYA }"
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
@ -63,7 +63,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
"framerate = (fraction) [0/1, MAX], "
"width = (int) [ 1, MAX ], height = (int) [ 1, MAX ], "
"stream-format = (string) byte-stream , alignment = (string) au , "
"profile = (string) { main, main-10 } ")
"profile = (string) { main, main-10, main-444 } ")
);
#define gst_msdkh265enc_parent_class parent_class
@ -106,6 +106,9 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder)
case MFX_FOURCC_P010:
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN10;
break;
case MFX_FOURCC_AYUV:
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_REXT;
break;
default:
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN;
}
@ -182,6 +185,9 @@ gst_msdkh265enc_set_src_caps (GstMsdkEnc * encoder)
case MFX_FOURCC_P010:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main-10", NULL);
break;
case MFX_FOURCC_AYUV:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main-444", NULL);
break;
default:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main", NULL);
break;