From a165a1a1a9c9aaad6dcd178a75086864ec438a8f Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Wed, 14 Feb 2018 14:29:57 +0000 Subject: [PATCH] msdk: encoder: h265: generalize the behavior of "i-frames" property We have the property "i-frames" to set the IDR interval in a gop. Unfortunately MSDK HEVC encoder behaves bit differently for IdrInterval field, IdrInteval == 1 indicate every I-frame should be an IDR (which is IdrInterval == 0 for other codecs), IdrInteval == 2 means every other I-frame is an IDR (which is IdrInterval == 1 for other codecs) etc. So we generalize the behaviour of property "i-frames" by incrementing the value by one in each case (only for HEVC). https://bugzilla.gnome.org/show_bug.cgi?id=791637 --- sys/msdk/gstmsdkh265enc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/msdk/gstmsdkh265enc.c b/sys/msdk/gstmsdkh265enc.c index d0361e4a35..0f6de89bec 100644 --- a/sys/msdk/gstmsdkh265enc.c +++ b/sys/msdk/gstmsdkh265enc.c @@ -91,6 +91,13 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder) encoder->param.mfx.CodecId = MFX_CODEC_HEVC; encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN; + /* IdrInterval field of MediaSDK HEVC encoder behaves differently + * than other encoders. IdrInteval == 1 indicate every + * I-frame should be an IDR, IdrInteval == 2 means every other + * I-frame is an IDR etc. So we generalize the behaviour of property + * "i-frames" by incrementing the value by one in each case*/ + encoder->param.mfx.IdrInterval += 1; + return TRUE; }