Skip to content

Commit 9ceaf86

Browse files
Rdk 56378aka delia 68021 main (rdkcentral#6240)
* RDK-56378 : diff between spec version 14 and 30 (rdkcentral#6089) Reason for change: minor changes to the following apis: openDrmSession, showWatermark, onWatermarkStatusChanged. Descriptions added. Test Procedure: None Risks: None Signed-off-by: Nikita Poltorapavlo <[email protected]> * update changelog and api version --------- Signed-off-by: Nikita Poltorapavlo <[email protected]>
1 parent fb0da09 commit 9ceaf86

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

ContentProtection/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file.
1616

1717
* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
1818

19+
## [1.1.0] - 2025-05-13
20+
### Changed
21+
- New appId parameter in openDrmSession and onWatermarkStatusChanged, opacityLevel parameter in showWatermark
22+
1923
## [1.0.1] - 2025-05-05
2024
### Fixed
2125
- Fix callsign - "org.rdk." missing

ContentProtection/ContentProtection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "ContentProtection.h"
2121

2222
#define API_VERSION_NUMBER_MAJOR 1
23-
#define API_VERSION_NUMBER_MINOR 0
24-
#define API_VERSION_NUMBER_PATCH 1
23+
#define API_VERSION_NUMBER_MINOR 1
24+
#define API_VERSION_NUMBER_PATCH 0
2525

2626
namespace WPEFramework {
2727
namespace Plugin {

ContentProtection/ContentProtection.h

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ namespace Plugin {
3232
private:
3333
struct Session {
3434
string ClientId;
35+
string AppId;
3536
Exchange::IContentProtection::KeySystem KeySystem;
3637
};
3738

@@ -226,8 +227,10 @@ namespace Plugin {
226227
ShowWatermarkParams()
227228
{
228229
Add(_T("show"), &Show);
230+
Add(_T("alpha"), &Alpha);
229231
}
230232
Core::JSON::Boolean Show;
233+
Core::JSON::DecUInt8 Alpha;
231234
};
232235

233236
struct CreateWatermarkParams : public Core::JSON::Container {
@@ -338,6 +341,7 @@ namespace Plugin {
338341
}
339342

340343
uint32_t OpenDrmSession(const string& clientId,
344+
const string& appId,
341345
KeySystem keySystem, const string& licenseRequest,
342346
const string& initData, uint32_t& sessionId, string& response)
343347
override
@@ -360,7 +364,7 @@ namespace Plugin {
360364
in.ToString(response);
361365

362366
_parent._sessionStorage.Set(sessionId,
363-
{ clientId, keySystem });
367+
{ clientId, appId, keySystem });
364368
}
365369
}
366370
return result;
@@ -445,11 +449,12 @@ namespace Plugin {
445449
}
446450

447451
uint32_t ShowWatermark(uint32_t /*sessionId*/,
448-
bool show, bool /*localOverlay*/) override
452+
bool show, const uint8_t opacityLevel) override
449453
{
450454
uint32_t result;
451455
ShowWatermarkParams out;
452456
out.Show = show;
457+
out.Alpha = opacityLevel;
453458
JsonObject in;
454459
result = _parent._watermark->Invoke<
455460
ShowWatermarkParams, JsonObject>(
@@ -562,8 +567,14 @@ namespace Plugin {
562567
ASSERT(_secManager->Subscribe<OnWatermarkSessionParams>(
563568
Timeout, _T("onWatermarkSession"),
564569
[&](const OnWatermarkSessionParams& params) {
570+
auto session = _sessionStorage.Get(
571+
params.SessionId);
572+
if (!session.IsSet()) {
573+
return; // No such session
574+
}
565575
WatermarkStatusChanged(
566576
params.SessionId,
577+
session.Value().AppId,
567578
{ ((params.ConditionContext == 1)
568579
? State::GRANTED
569580
: ((params.ConditionContext == 2)
@@ -713,8 +724,14 @@ namespace Plugin {
713724
auto watermark = _watermarkStorage
714725
.Get(params.Image);
715726
if (watermark.IsSet()) {
727+
auto session = _sessionStorage.Get(
728+
watermark.Value().SessionId);
729+
if (!session.IsSet()) {
730+
return; // No such session
731+
}
716732
WatermarkStatusChanged(
717733
watermark.Value().SessionId,
734+
session.Value().AppId,
718735
{ State::FAILED, 20001 });
719736
}
720737
})
@@ -731,14 +748,15 @@ namespace Plugin {
731748
_watermark->Unsubscribe(Timeout, _T("onWatermarkRenderFailed"));
732749
}
733750
void WatermarkStatusChanged(uint32_t sessionId,
751+
const string& appId,
734752
const Exchange::IContentProtection::INotification::Status& status)
735753
{
736754
Exchange::JContentProtection::Event::WatermarkStatusChanged(
737-
*this, sessionId, status);
755+
*this, sessionId, appId, status);
738756

739757
Core::SafeSyncType<Core::CriticalSection> lock(_clientLock);
740758
for (auto& i : _clients) {
741-
i->WatermarkStatusChanged(sessionId, status);
759+
i->WatermarkStatusChanged(sessionId, appId, status);
742760
}
743761
}
744762

0 commit comments

Comments
 (0)