@@ -693,6 +693,7 @@ MfxC2DecoderComponent::MfxC2DecoderComponent(const C2String name, const CreateCo
693693 m_hdrStaticInfo->maxFall = 0 ;
694694
695695 MFX_ZERO_MEMORY (m_signalInfo);
696+ MFX_ZERO_MEMORY (m_secureCodec);
696697 // m_paramStorage.DumpParams();
697698}
698699
@@ -1096,9 +1097,13 @@ mfxStatus MfxC2DecoderComponent::ResetSettings()
10961097 mfxStatus res = MFX_ERR_NONE;
10971098 MFX_ZERO_MEMORY (m_mfxVideoParams);
10981099 MFX_ZERO_MEMORY (m_signalInfo);
1100+ MFX_ZERO_MEMORY (m_secureCodec);
10991101
11001102 m_signalInfo.Header .BufferId = MFX_EXTBUFF_VIDEO_SIGNAL_INFO;
11011103 m_signalInfo.Header .BufferSz = sizeof (mfxExtVideoSignalInfo);
1104+ m_secureCodec.Header .BufferId = MFX_EXTBUFF_SECURE_CODEC;
1105+ m_secureCodec.Header .BufferSz = sizeof (mfxExtSecureCodec);
1106+ m_secureCodec.on = m_secure;
11021107
11031108 switch (m_decoderType)
11041109 {
@@ -1306,10 +1311,16 @@ mfxStatus MfxC2DecoderComponent::InitDecoder(std::shared_ptr<C2BlockPool> c2_all
13061311 m_allocator->SetConsumerUsage (m_consumerUsage);
13071312 }
13081313
1314+ mfxVideoParam oldParams = m_mfxVideoParams;
1315+ m_extBuffers.push_back (reinterpret_cast <mfxExtBuffer*>(&m_secureCodec));
1316+ m_mfxVideoParams.NumExtParam = m_extBuffers.size ();
1317+ m_mfxVideoParams.ExtParam = &m_extBuffers.front ();
13091318 MFX_DEBUG_TRACE_MSG (" Decoder initializing..." );
13101319 mfx_res = m_mfxDecoder->Init (&m_mfxVideoParams);
13111320 MFX_DEBUG_TRACE_PRINTF (" Decoder initialized, sts = %d" , mfx_res);
1312-
1321+ m_extBuffers.pop_back ();
1322+ m_mfxVideoParams.NumExtParam = oldParams.NumExtParam ;
1323+ m_mfxVideoParams.ExtParam = oldParams.ExtParam ;
13131324
13141325 // c2 allocator is needed to handle mfxAllocRequest coming from m_mfxDecoder->Init,
13151326 // not needed after that.
0 commit comments