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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1101>
This commit is contained in:
Mengkejiergeli Ba 2021-09-22 14:50:40 +08:00 committed by GStreamer Marge Bot
parent 1bf237e767
commit 40d559adcf

View file

@ -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);