Skip to content

Commit 3d99864

Browse files
nanazhankkkuangzh
authored andcommitted
Add mfxExtSecureCodec
Signed-off-by: Nana Zhang <[email protected]>
1 parent 03b35a3 commit 3d99864

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

c2_components/include/mfx_c2_decoder_component.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class MfxC2DecoderComponent : public MfxC2Component
198198
mfxVideoParam m_mfxVideoParams {};
199199
std::vector<mfxExtBuffer*> m_extBuffers;
200200
mfxExtVideoSignalInfo m_signalInfo;
201+
mfxExtSecureCodec m_secureCodec;
201202

202203
// Protects decoder initialization and m_mfxVideoParams
203204
mutable std::mutex m_initDecoderMutex;

c2_components/src/mfx_c2_decoder_component.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)