From ccf5436ecdb73d8eeb3b854b1a4c80a244b04971 Mon Sep 17 00:00:00 2001 From: Nikita Poltorapavlo Date: Thu, 12 Sep 2024 12:02:20 +0300 Subject: [PATCH 1/4] RDK-52316 : Content Protection interface Reason for change: new interface to proxy content security capabilities of the existing DRM plugins like SecManager & Watermark. Test Procedure: None Risks: None Signed-off-by: Nikita Poltorapavlo --- interfaces/IContentProtection.h | 106 ++++++++++++++++++++++++++++++++ interfaces/Ids.h | 7 ++- 2 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 interfaces/IContentProtection.h diff --git a/interfaces/IContentProtection.h b/interfaces/IContentProtection.h new file mode 100644 index 00000000..78195e2d --- /dev/null +++ b/interfaces/IContentProtection.h @@ -0,0 +1,106 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "Module.h" + +namespace Thunder { +namespace Exchange { + + // @json 1.0.0 + struct EXTERNAL IContentProtection : virtual public Core::IUnknown { + enum { ID = ID_CONTENTPROTECTION }; + + ~IContentProtection() override = default; + + enum KeySystem : uint8_t { + WIDEVINE /* @text:widevine */, + PLAYREADY /* @text:playready */, + CLEARKEY /* @text:clearkey */ + }; + + enum State : uint8_t { + ACTIVE /* @text:active */, + INACTIVE /* @text:inactive */ + }; + + // @event + struct EXTERNAL INotification : virtual public Core::IUnknown { + enum { ID = ID_CONTENTPROTECTION_NOTIFICATION }; + + ~INotification() override = default; + + struct Status { + enum State : uint8_t { + GRANTED = 1 /* @text:GRANTED */, + NOT_REQUIRED = 2 /* @text:NOT_REQUIRED */, + DENIED = 3 /* @text:DENIED */, + FAILED = 4 /* @text:FAILED */, + }; + + State state; + int32_t failureReason; + }; + + // @alt onWatermarkStatusChanged + virtual void WatermarkStatusChanged(uint32_t sessionId, + const Status& status) + = 0; + }; + + virtual uint32_t Register(INotification* notification) = 0; + virtual uint32_t Unregister(INotification* notification) = 0; + + // @alt openDrmSession + virtual uint32_t OpenDrmSession(const string& clientId, + KeySystem keySystem, const string& licenseRequest, + const string& initData /* @opaque */, + uint32_t& sessionId /* @out */, + string& response /* @text:openSessionResponse @opaque @out */) + = 0; + + // @alt setDrmSessionState + virtual uint32_t SetDrmSessionState(uint32_t sessionId, + State sessionState) + = 0; + + // @alt updateDrmSession + virtual uint32_t UpdateDrmSession(uint32_t sessionId, + const string& licenseRequest, + const string& initData /* @opaque */, + string& response /* @text:updateSessionResponse @opaque @out */) + = 0; + + // @alt closeDrmSession + virtual uint32_t CloseDrmSession(uint32_t sessionId) = 0; + + // @alt showWatermark + virtual uint32_t ShowWatermark(uint32_t sessionId, + bool show, bool localOverlay) + = 0; + + // @alt setPlaybackPosition + virtual uint32_t SetPlaybackPosition(uint32_t sessionId, + int32_t speed, long position) + = 0; + }; + +} // namespace Exchange +} // namespace Thunder diff --git a/interfaces/Ids.h b/interfaces/Ids.h index e132d4fa..fa4838b0 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -369,10 +369,13 @@ namespace Exchange { ID_DNS_SERVER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4E0, ID_DNS_ZONE = ID_DNS_SERVER + 1, ID_DNS_RECORD = ID_DNS_SERVER + 2, - + ID_TESTAUTOMATIONMEMORY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4F0, ID_TESTAUTOMATIONCOMRPC = ID_TESTAUTOMATIONMEMORY + 1, - ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2 + ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2, + + ID_CONTENTPROTECTION = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500, + ID_CONTENTPROTECTION_NOTIFICATION = ID_CONTENTPROTECTION + 1, }; } From 0361705ec18cdd9ddf939b071892a7962626cd9e Mon Sep 17 00:00:00 2001 From: Nikita Poltorapavlo Date: Fri, 29 Jul 2022 10:59:01 +0300 Subject: [PATCH 2/4] watermark updates (#180) Co-authored-by: mthiru270 --- interfaces/IWatermark.h | 46 +++++++++++++++++++++++++++++++++++++++++ interfaces/Ids.h | 3 +++ 2 files changed, 49 insertions(+) create mode 100644 interfaces/IWatermark.h diff --git a/interfaces/IWatermark.h b/interfaces/IWatermark.h new file mode 100644 index 00000000..b674c5eb --- /dev/null +++ b/interfaces/IWatermark.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Module.h" + +namespace WPEFramework { +namespace Exchange { + + struct PalettedImageData + { + uint32_t imageKey; + uint32_t imageWidth; + uint32_t imageHeight; + uint32_t clutKey; + uint32_t clutSize; + string clutType; + }; + + struct EXTERNAL IWatermark : virtual public Core::IUnknown { + enum { ID = ID_WATERMARK }; + + struct INotification : virtual public Core::IUnknown { + + enum { ID = ID_WATERMARK_NOTIFICATION }; + + ~INotification() override = default; + + virtual void WatermarkEvent(const string& eventName, const string& parametersJson) = 0; + }; + + + virtual ~IWatermark() {} + virtual uint32_t Initialize(string waylandDisplay, bool synchronized) = 0; + virtual uint32_t Deinitialize() = 0; + virtual uint32_t Register(INotification* notification) = 0; + virtual uint32_t Unregister(INotification* notification) = 0; + virtual bool ShowWatermark(const bool show) = 0; + virtual bool CreateWatermark(uint32_t id, uint32_t zorder) = 0; + virtual bool UpdateWatermark(uint32_t id, uint32_t key, uint32_t size) = 0; + virtual bool AdjustWatermark(uint32_t id, uint32_t zorder) = 0; + virtual bool DeleteWatermark(uint32_t id) = 0; + virtual PalettedImageData GetPalettedWatermark(uint32_t id) = 0; + virtual bool ModifyPalettedWatermark(uint32_t id, PalettedImageData data) = 0; + }; + +} // Exchange +} // WPEFramework diff --git a/interfaces/Ids.h b/interfaces/Ids.h index fa4838b0..11dfcd6b 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -377,6 +377,9 @@ namespace Exchange { ID_CONTENTPROTECTION = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500, ID_CONTENTPROTECTION_NOTIFICATION = ID_CONTENTPROTECTION + 1, + ID_WATERMARK = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x510, + ID_WATERMARK_NOTIFICATION = ID_WATERMARK + 2, + }; } } From c4f423c83fa34b166e9a6954c2e03b6e790282ec Mon Sep 17 00:00:00 2001 From: Nikita Poltorapavlo Date: Tue, 8 Oct 2024 18:36:14 +0300 Subject: [PATCH 3/4] replace namespace from WPEFramework to Thunder --- interfaces/IWatermark.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/IWatermark.h b/interfaces/IWatermark.h index b674c5eb..c51ee77f 100644 --- a/interfaces/IWatermark.h +++ b/interfaces/IWatermark.h @@ -2,7 +2,7 @@ #include "Module.h" -namespace WPEFramework { +namespace Thunder { namespace Exchange { struct PalettedImageData @@ -43,4 +43,4 @@ namespace Exchange { }; } // Exchange -} // WPEFramework +} // Thunder From 7ce061f2dfe43cb2f03cc8d709927611789abbc8 Mon Sep 17 00:00:00 2001 From: Nikita Poltorapavlo Date: Mon, 2 Dec 2024 19:23:40 +0200 Subject: [PATCH 4/4] add missing comma after the merge conflict --- interfaces/Ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/Ids.h b/interfaces/Ids.h index fd7d54fa..b9cedb99 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -376,7 +376,7 @@ namespace Exchange { ID_TESTAUTOMATIONMEMORY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x9F0, ID_TESTAUTOMATIONCOMRPC = ID_TESTAUTOMATIONMEMORY + 1, - ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2 + ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2, ID_CONTENTPROTECTION = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500, ID_CONTENTPROTECTION_NOTIFICATION = ID_CONTENTPROTECTION + 1,