Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fcc2f4d
RDKEMW-19892: [RDKEMW] [BCM Rogers Monarch IUI V2] Linear trick play …
ALSAMEEMA Jun 22, 2026
bd753ba
Merge branch 'develop' into feature/RDKEMW-19892
ALSAMEEMA Jun 22, 2026
a37494f
Potential fix for pull request finding
ALSAMEEMA Jun 22, 2026
85fbba0
RDKEMW-19892: [RDKEMW] [BCM Rogers Monarch IUI V2] Linear trick play …
ALSAMEEMA Jun 22, 2026
f80c2b4
RDKEMW-19892: [RDKEMW] [BCM Rogers Monarch IUI V2] Linear trick play …
ALSAMEEMA Jun 22, 2026
d00299a
Merge branch 'develop' into feature/RDKEMW-19892
ALSAMEEMA Jun 22, 2026
641dfdc
Potential fix for pull request finding
ALSAMEEMA Jun 22, 2026
e10527f
Potential fix for pull request finding
ALSAMEEMA Jun 22, 2026
eea1a65
Potential fix for pull request finding
ALSAMEEMA Jun 22, 2026
d37d0c3
Potential fix for pull request finding
ALSAMEEMA Jun 22, 2026
54fd638
Potential fix for pull request finding
ALSAMEEMA Jun 22, 2026
8b35ec6
Potential fix for pull request finding
ALSAMEEMA Jun 22, 2026
49b59ba
Potential fix for pull request finding
ALSAMEEMA Jun 22, 2026
5bd3c0b
Merge branch 'develop' into feature/RDKEMW-19892
ALSAMEEMA Jul 3, 2026
58f6589
Update WidevineDrmHelper.cpp
ALSAMEEMA Jul 10, 2026
63f6ccb
Potential fix for pull request finding
ALSAMEEMA Jul 10, 2026
37d8aee
Potential fix for pull request finding
ALSAMEEMA Jul 10, 2026
02446cc
Potential fix for pull request finding
ALSAMEEMA Jul 10, 2026
d382109
Potential fix for pull request finding
ALSAMEEMA Jul 10, 2026
7abaf03
Potential fix for pull request finding
ALSAMEEMA Jul 10, 2026
0ab2874
Update WidevineDrmHelper.cpp
ALSAMEEMA Jul 10, 2026
fe93c38
Potential fix for pull request finding
ALSAMEEMA Jul 10, 2026
a27d0d3
Update WidevineDrmHelper.cpp
ALSAMEEMA Jul 10, 2026
e8faa31
Potential fix for pull request finding
ALSAMEEMA Jul 10, 2026
ce176b1
Merge branch 'develop' into feature/RDKEMW-19892
dp0000 Jul 15, 2026
8508c24
Merge branch 'develop' into feature/RDKEMW-19892
dp0000 Jul 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 56 additions & 11 deletions drm/helper/WidevineDrmHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <memory>
#include <iostream>
#include <cstdlib>

#include "WidevineDrmHelper.h"
#include "DrmUtils.h"
Expand Down Expand Up @@ -184,18 +185,55 @@ void WidevineDrmHelper::setDrmMetaData(const std::string& metaData)

void WidevineDrmHelper::setDefaultKeyID(const std::string& cencData)
{
mDefaultKeySlot = -1;
std::vector<uint8_t> defaultKeyID(cencData.begin(), cencData.end());
// Also convert UUID string (e.g. "f3dff538-b8c9-58e4-e8cd-96cf811d32dc") to 16-byte binary
// for comparison against binary keyIDs parsed from PSSH
std::vector<uint8_t> defaultKeyIDBinary;
std::string uuidHex;
uuidHex.reserve(cencData.size());
for (char c : cencData)
{
if (c != '-')
{
uuidHex += c;
}
}
Comment thread
Copilot marked this conversation as resolved.
if (uuidHex.size() == 32)
{
defaultKeyIDBinary.reserve(16);
for (size_t i = 0; i < uuidHex.size(); i += 2)
{
char hexPair[3] = {uuidHex[i], uuidHex[i + 1], '\0'};
char* end = nullptr;
unsigned long v = std::strtoul(hexPair, &end, 16);
if (end != hexPair + 2 || v > 0xFF)
{
MW_LOG_WARN("setDefaultKeyID: invalid hex in cencData at offset %zu", i);
defaultKeyIDBinary.clear();
break;
}
defaultKeyIDBinary.push_back(static_cast<uint8_t>(v));
Comment thread
Copilot marked this conversation as resolved.
Comment thread
Copilot marked this conversation as resolved.
Comment thread
ALSAMEEMA marked this conversation as resolved.
}
}
Comment thread
Copilot marked this conversation as resolved.

if(!mKeyIDs.empty())
{
for(auto& it : mKeyIDs)
{
if(defaultKeyID == it.second)
if(defaultKeyID == it.second || defaultKeyIDBinary == it.second)
{
mDefaultKeySlot = it.first;
MW_LOG_WARN("setDefaultKeyID : %s slot : %d", PlayerLogManager::getHexDebugStr(defaultKeyID).c_str(), mDefaultKeySlot);
MW_LOG_WARN("setDefaultKeyID : %s slot : %d", PlayerLogManager::getHexDebugStr(it.second).c_str(), mDefaultKeySlot);
break;
Comment on lines 226 to +228
}
}
}
if (mDefaultKeySlot < 0 && !mKeyIDs.empty())
{
mDefaultKeySlot = mKeyIDs.begin()->first;
MW_LOG_WARN("setDefaultKeyID: no match found for cencData, defaulting to first slot %d", mDefaultKeySlot);
}
Comment thread
Copilot marked this conversation as resolved.
Comment thread
ALSAMEEMA marked this conversation as resolved.
}


Expand All @@ -212,22 +250,29 @@ void WidevineDrmHelper::createInitData(std::vector<uint8_t>& initData) const
void WidevineDrmHelper::getKey(std::vector<uint8_t>& keyID) const
{
MW_LOG_WARN("WidevineDrmHelper::getKey defaultkey: %d mKeyIDs.size:%zu", mDefaultKeySlot, mKeyIDs.size());
// Print all key IDs for debugging
for (const auto& keyPair : mKeyIDs) {
std::string keyStr = PlayerLogManager::getHexDebugStr(keyPair.second);
MW_LOG_DEBUG("Key ID [%d]: %s", keyPair.first, keyStr.c_str());
// Print all key IDs when debug logging is active
if (PlayerLogManager::isLogLevelAllowed(mLOGLEVEL_DEBUG))
{
for (const auto& keyPair : mKeyIDs) {
std::string keyStr = PlayerLogManager::getHexDebugStr(keyPair.second);
MW_LOG_DEBUG("Key ID [%d]: %s", keyPair.first, keyStr.c_str());
}
}
if ((mDefaultKeySlot >= 0) && (mDefaultKeySlot < mKeyIDs.size()))
if ((mDefaultKeySlot >= 0) && (mKeyIDs.find(mDefaultKeySlot) != mKeyIDs.end()))
{
keyID = this->mKeyIDs.at(mDefaultKeySlot);
keyID = mKeyIDs.at(mDefaultKeySlot);
}
else if (mKeyIDs.size() > 0)
else if (!mKeyIDs.empty())
{
keyID = this->mKeyIDs.at(0);
if (mDefaultKeySlot >= 0)
{
MW_LOG_WARN("mDefaultKeySlot(%d) not found in mKeyIDs, falling back to first entry", mDefaultKeySlot);
}
keyID = mKeyIDs.begin()->second;
}
Comment on lines +265 to 272
else
{
MW_LOG_ERR("No key");
MW_LOG_ERR("No key available - mKeyIDs is empty");
}
}

Expand Down
Loading
Loading