From 74a7e4048b99ff3385898681f348d61274a1fc2c Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Wed, 20 Nov 2024 12:59:12 +0100 Subject: [PATCH 1/3] Use the warning supression instead of the variable is not used macro --- OpenCDMi/FrameworkRPC.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenCDMi/FrameworkRPC.cpp b/OpenCDMi/FrameworkRPC.cpp index 096035d..cedbaa1 100644 --- a/OpenCDMi/FrameworkRPC.cpp +++ b/OpenCDMi/FrameworkRPC.cpp @@ -372,12 +372,13 @@ namespace Plugin { return (Core::infinite); } - private: CDMi::IMediaKeySession* _mediaKeys; - VARIABLE_IS_NOT_USED CDMi::IMediaKeySessionExt* _mediaKeysExt; - VARIABLE_IS_NOT_USED uint8_t* _sessionKey; - VARIABLE_IS_NOT_USED uint32_t _sessionKeyLength; +PUSH_WARNING(DISABLE_WARNING_UNUSED_VARIABLES) + CDMi::IMediaKeySessionExt* _mediaKeysExt; + uint8_t* _sessionKey; + uint32_t _sessionKeyLength; +POP_WARNING() }; // IMediaKeys defines the MediaKeys interface. @@ -748,7 +749,9 @@ POP_WARNING() private: AccessorOCDM& _parent; mutable Core::CriticalSection _adminLock; - VARIABLE_IS_NOT_USED mutable uint32_t _refCount; +PUSH_WARNING(DISABLE_WARNING_UNUSED_VARIABLES) + mutable uint32_t _refCount; +POP_WARNING() std::string _keySystem; std::string _sessionId; CDMi::IMediaKeySession* _mediaKeySession; From f7d6f91d798551e10df6464aea8a0e998c382f73 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Wed, 20 Nov 2024 12:59:58 +0100 Subject: [PATCH 2/3] Formatting changes --- OpenCDMi/FrameworkRPC.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenCDMi/FrameworkRPC.cpp b/OpenCDMi/FrameworkRPC.cpp index cedbaa1..f6070dd 100644 --- a/OpenCDMi/FrameworkRPC.cpp +++ b/OpenCDMi/FrameworkRPC.cpp @@ -372,6 +372,7 @@ namespace Plugin { return (Core::infinite); } + private: CDMi::IMediaKeySession* _mediaKeys; PUSH_WARNING(DISABLE_WARNING_UNUSED_VARIABLES) From 34e0dc399dd3a475e80793fbc0fbfdbce00b49eb Mon Sep 17 00:00:00 2001 From: Mateusz Daniluk <121170681+VeithMetro@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:31:20 +0100 Subject: [PATCH 3/3] Remove all unused member variables --- OpenCDMi/FrameworkRPC.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/OpenCDMi/FrameworkRPC.cpp b/OpenCDMi/FrameworkRPC.cpp index f6070dd..2d3c191 100644 --- a/OpenCDMi/FrameworkRPC.cpp +++ b/OpenCDMi/FrameworkRPC.cpp @@ -286,9 +286,6 @@ namespace Plugin { : Exchange::DataExchange(name, defaultSize) , Core::Thread(Core::Thread::DefaultStackSize(), _T("DRMSessionThread")) , _mediaKeys(mediaKeys) - , _mediaKeysExt(dynamic_cast(mediaKeys)) - , _sessionKey(nullptr) - , _sessionKeyLength(0) { Core::Thread::Run(); TRACE(Trace::Information, (_T("Constructing buffer server side: %p - %s"), this, name.c_str())); @@ -375,11 +372,6 @@ namespace Plugin { private: CDMi::IMediaKeySession* _mediaKeys; -PUSH_WARNING(DISABLE_WARNING_UNUSED_VARIABLES) - CDMi::IMediaKeySessionExt* _mediaKeysExt; - uint8_t* _sessionKey; - uint32_t _sessionKeyLength; -POP_WARNING() }; // IMediaKeys defines the MediaKeys interface. @@ -497,7 +489,6 @@ PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) Exchange::ISession::ICallback* callback, const CommonEncryptionData* sessionData) : _parent(*parent) - , _refCount(1) , _keySystem(keySystem) , _sessionId(mediaKeySession->GetSessionId()) , _mediaKeySession(mediaKeySession) @@ -522,7 +513,6 @@ PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) Exchange::ISession::ICallback* callback, const CommonEncryptionData* sessionData) : _parent(*parent) - , _refCount(1) , _keySystem(keySystem) , _sessionId("") , _mediaKeySession(dynamic_cast(mediaKeySession)) @@ -750,9 +740,6 @@ POP_WARNING() private: AccessorOCDM& _parent; mutable Core::CriticalSection _adminLock; -PUSH_WARNING(DISABLE_WARNING_UNUSED_VARIABLES) - mutable uint32_t _refCount; -POP_WARNING() std::string _keySystem; std::string _sessionId; CDMi::IMediaKeySession* _mediaKeySession;