msdkh265enc: add support for Y210 in sink pad

Sample pipeline:
gst-launch-1.0 videotestsrc ! video/x-raw,format=Y210 !
msdkh265enc ! filesink location=output.h265
This commit is contained in:
Haihao Xiang 2020-03-17 15:18:37 +08:00
parent fbd1d0cecb
commit 7c91c8c980
2 changed files with 15 additions and 2 deletions

View file

@ -552,6 +552,13 @@ gst_msdkenc_init_encoder (GstMsdkEnc * thiz)
thiz->param.mfx.FrameInfo.BitDepthLuma = 10;
thiz->param.mfx.FrameInfo.BitDepthChroma = 10;
break;
case GST_VIDEO_FORMAT_Y210:
thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_Y210;
thiz->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
thiz->param.mfx.FrameInfo.BitDepthLuma = 10;
thiz->param.mfx.FrameInfo.BitDepthChroma = 10;
thiz->param.mfx.FrameInfo.Shift = 1;
break;
#endif
case GST_VIDEO_FORMAT_BGRA:
thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_RGB4;
@ -1864,6 +1871,7 @@ gst_msdkenc_need_conversion (GstMsdkEnc * encoder, GstVideoInfo * info,
case GST_VIDEO_FORMAT_VUYA:
#if (MFX_VERSION >= 1027)
case GST_VIDEO_FORMAT_Y410:
case GST_VIDEO_FORMAT_Y210:
#endif
return FALSE;

View file

@ -56,7 +56,7 @@ enum
#define RAW_FORMATS "NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE, VUYA"
#if (MFX_VERSION >= 1027)
#define COMMON_FORMAT "{ " RAW_FORMATS ", Y410 }"
#define COMMON_FORMAT "{ " RAW_FORMATS ", Y410, Y210 }"
#else
#define COMMON_FORMAT "{ " RAW_FORMATS " }"
#endif
@ -74,7 +74,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, main-444, main-444-10 } ")
"profile = (string) { main, main-10, main-444, main-444-10, main-422-10 } ")
);
#define gst_msdkh265enc_parent_class parent_class
@ -112,6 +112,7 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder)
case MFX_FOURCC_AYUV:
#if (MFX_VERSION >= 1027)
case MFX_FOURCC_Y410:
case MFX_FOURCC_Y210:
#endif
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_REXT;
break;
@ -215,6 +216,10 @@ gst_msdkh265enc_set_src_caps (GstMsdkEnc * encoder)
gst_structure_set (structure, "profile", G_TYPE_STRING, "main-444-10",
NULL);
break;
case MFX_FOURCC_Y210:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main-422-10",
NULL);
break;
#endif
default:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main", NULL);