msdkenc: guard MFX_FOURCC_Y410 with MFX version 1027

This commit is contained in:
Víctor Manuel Jáquez Leal 2019-10-01 11:00:02 +02:00 committed by Edward Hervey
parent d763aeee4b
commit 5140bf1a1f
2 changed files with 15 additions and 1 deletions

View File

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

View File

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