1+ // Copyright (c) 2017-2024 Intel Corporation
2+ //
3+ // Permission is hereby granted, free of charge, to any person obtaining a copy
4+ // of this software and associated documentation files (the "Software"), to deal
5+ // in the Software without restriction, including without limitation the rights
6+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+ // copies of the Software, and to permit persons to whom the Software is
8+ // furnished to do so, subject to the following conditions:
9+ //
10+ // The above copyright notice and this permission notice shall be included in all
11+ // copies or substantial portions of the Software.
12+ //
13+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+ // SOFTWARE.
20+
21+ #include " mfx_c2_secure_decoder_component.h"
22+
23+ #include " mfx_defs.h"
24+ #include " mfx_c2_utils.h"
25+ #include " mfx_debug.h"
26+ #include " mfx_msdk_debug.h"
27+ #include " mfx_c2_debug.h"
28+ #include " mfx_c2_components_registry.h"
29+ #include " mfx_defaults.h"
30+ #include " C2PlatformSupport.h"
31+
32+ #undef MFX_DEBUG_MODULE_NAME
33+ #define MFX_DEBUG_MODULE_NAME " mfx_c2_secure_decoder_component"
34+
35+ MfxC2SecureDecoderComponent::MfxC2SecureDecoderComponent (const C2String name, const CreateConfig& config,
36+ std::shared_ptr<C2ReflectorHelper> reflector, DecoderType decoder_type) :
37+ MfxC2DecoderComponent(name, config, std::move(reflector), decoder_type)
38+ {
39+ MFX_DEBUG_TRACE_FUNC;
40+ m_secure = true ;
41+
42+ addParameter (
43+ DefineParam (m_secureMode, C2_PARAMKEY_SECURE_MODE)
44+ .withConstValue (new C2SecureModeTuning (C2Config::secure_mode_t ::SM_READ_PROTECTED_WITH_ENCRYPTED))
45+ .build ());
46+ }
47+
48+ MfxC2SecureDecoderComponent::~MfxC2SecureDecoderComponent ()
49+ {
50+ MFX_DEBUG_TRACE_FUNC;
51+
52+ MfxC2DecoderComponent::Release ();
53+ }
54+
55+ void MfxC2SecureDecoderComponent::RegisterClass (MfxC2ComponentsRegistry& registry)
56+ {
57+ MFX_DEBUG_TRACE_FUNC;
58+
59+ registry.RegisterMfxC2Component (" c2.intel.avc.decoder.secure" ,
60+ &MfxC2Component::Factory<MfxC2SecureDecoderComponent, DecoderType>::Create<DECODER_H264_SECURE>);
61+
62+ registry.RegisterMfxC2Component (" c2.intel.hevc.decoder.secure" ,
63+ &MfxC2Component::Factory<MfxC2SecureDecoderComponent, DecoderType>::Create<DECODER_H265_SECURE>);
64+ }
0 commit comments