From 40d559adcffca3c0ae0127ed92dc5921fdafd1da Mon Sep 17 00:00:00 2001 From: Mengkejiergeli Ba Date: Wed, 22 Sep 2021 14:50:40 +0800 Subject: [PATCH] msdkenc: fix vp9enc initialization fail MediaSDK does not support to handle extbuff with id MFX_EXTBUFF_VIDEO_SIGNAL_INFO for mjpegenc and vp9enc. Hence, need to exclude mjpeg and vp9 when passing color properties to MediaSDK during msdkenc initialization. Fix issue: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/764 Part-of: --- subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c index dd1ea3b4ec..b58f2d340f 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c @@ -736,11 +736,13 @@ gst_msdkenc_init_encoder (GstMsdkEnc * thiz) } /* If color properties are available from upstream, set it and pass to MediaSDK here. - * MJPEG is excluded from color config below as it is different from other codecs in - * mfxInfoMFX struct. + * MJPEG and VP9 are excluded as MediaSDK does not support to handle video param + * extbuff with buffer id equals to MFX_EXTBUFF_VIDEO_SIGNAL_INFO. */ - if (thiz->param.mfx.CodecId != MFX_CODEC_JPEG && (info->colorimetry.primaries - || info->colorimetry.transfer || info->colorimetry.matrix)) { + if (thiz->param.mfx.CodecId != MFX_CODEC_JPEG && + thiz->param.mfx.CodecId != MFX_CODEC_VP9 && + (info->colorimetry.primaries || info->colorimetry.transfer + || info->colorimetry.matrix)) { memset (&ext_vsi, 0, sizeof (ext_vsi)); ext_vsi.Header.BufferId = MFX_EXTBUFF_VIDEO_SIGNAL_INFO; ext_vsi.Header.BufferSz = sizeof (ext_vsi);