Skip to content

RDKEMW-19064: Implementation of OCDM api's to be able to query Key Sy…#545

Merged
kkanag314 merged 18 commits into
masterfrom
RDKEMW-19064
Jul 14, 2026
Merged

RDKEMW-19064: Implementation of OCDM api's to be able to query Key Sy…#545
kkanag314 merged 18 commits into
masterfrom
RDKEMW-19064

Conversation

@kkanag314

@kkanag314 kkanag314 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary: Implement a interfaces in webkit to query the robustness level from CDM
Type: Feature
Test Plan:Check the Widevine L1 DRM support on Glass/Stream with the test URL and regression testing of webapps
Jira: https://ccp.sys.comcast.net/browse/RDKEMW-19064

…stem Robustness Level

Reason for change: Implement a interfaces in webkit to query the robustness level from CDM
Test Procedure: Check the Widevine L1 DRM support on Glass/Stream with the test URL and regression tsting of webapps
Priority: P1
Risks: None
Copilot AI review requested due to automatic review settings June 26, 2026 07:05
@github-actions

Copy link
Copy Markdown

Pull request must be merged with a description containing the required fields,

Summary:
Type: Feature/Fix/Cleanup
Test Plan:
Jira:

If there is no jira releated to this change, please put 'Jira: NO-JIRA'.

Description can be changed by editing the top comment on your pull request and making a new commit.

@github-actions

Copy link
Copy Markdown

media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp:251:1: error: Unmatched '}'. Configuration: ''. [syntaxError]
}; // namespace firebolt::rialto::client
^
nofile:0:0: information: Active checkers: There was critical errors (use --checkers-report= to see details) [checkersReport]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an end-to-end API (wrapper → server service → IPC → client) to query the robustness levels supported by the underlying CDM for a given key system, enabling WebKit (and other consumers) to determine DRM robustness (e.g., Widevine L1 support).

Changes:

  • Added getSupportedRobustnessLevels to the public/media capabilities interfaces and implementations (client + server).
  • Extended the MediaKeysCapabilities IPC protobuf/service with a new getSupportedRobustnessLevels RPC.
  • Implemented the OpenCDM wrapper call to retrieve supported robustness levels from the CDM.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
wrappers/source/OcdmSystem.cpp Adds OpenCDM wrapper method to retrieve robustness levels from the system handle.
wrappers/interface/IOcdmSystem.h Exposes robustness-level query in the wrapper interface.
wrappers/include/OcdmSystem.h Declares the new wrapper method on OcdmSystem.
media/server/main/source/MediaKeysCapabilities.cpp Implements server-side robustness-level query via IOcdmSystemFactory.
media/server/main/include/MediaKeysCapabilities.h Declares the new server-side capabilities method.
media/server/service/source/CdmService.cpp Adds ICdmService entrypoint forwarding to MediaKeysCapabilities.
media/server/service/source/CdmService.h Declares the new ICdmService override on CdmService.
media/server/service/include/ICdmService.h Extends the service interface with the new query method.
media/server/ipc/source/MediaKeysCapabilitiesModuleService.cpp Implements the new protobuf RPC on the server.
media/server/ipc/include/MediaKeysCapabilitiesModuleService.h Declares the new protobuf RPC handler.
media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp Implements client-side IPC call + response unmarshalling.
media/client/ipc/include/MediaKeysCapabilitiesIpc.h Declares the client IPC method.
media/client/main/source/MediaKeysCapabilities.cpp Adds client-side convenience method forwarding to IPC.
media/client/main/include/MediaKeysCapabilities.h Declares the new client capabilities method.
media/public/include/IMediaKeysCapabilities.h Extends the public client-facing interface with the new method.
proto/mediakeyscapabilitiesmodule.proto Adds request/response messages + RPC for robustness levels.
patch.patch Adds a tracked git-format patch file containing the same changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp Outdated
Comment thread wrappers/source/OcdmSystem.cpp
Comment thread wrappers/source/OcdmSystem.cpp
Comment thread media/server/main/source/MediaKeysCapabilities.cpp Outdated
Comment thread wrappers/interface/IOcdmSystem.h
Comment thread media/public/include/IMediaKeysCapabilities.h
Comment thread media/server/service/include/ICdmService.h
Comment thread media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp
Comment thread patch.patch Outdated
Comment on lines +1 to +5
From feda9d75dd606ac48286909115c4f81015431755 Mon Sep 17 00:00:00 2001
From: Krishna Priya Kanagaraj <krishnapriya_kanagaraj@comcast.com>
Date: Tue, 26 May 2026 11:59:42 +0000
Subject: [PATCH] add getSupportedRobustnessLevels to rialto

@github-actions

Copy link
Copy Markdown

media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp:251:1: error: Unmatched '}'. Configuration: ''. [syntaxError]
}; // namespace firebolt::rialto::client
^
nofile:0:0: information: Active checkers: There was critical errors (use --checkers-report= to see details) [checkersReport]

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 29, 2026 15:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Comment on lines +121 to +144
bool OcdmSystem::getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels)
{
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
Comment thread media/server/ipc/source/MediaKeysCapabilitiesModuleService.cpp
Comment thread media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp
Comment thread media/server/service/source/CdmService.cpp
Comment thread media/server/main/source/MediaKeysCapabilities.cpp Outdated
Comment thread media/client/main/source/MediaKeysCapabilities.cpp Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 29, 2026 18:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.

Comment on lines +121 to +145
bool OcdmSystem::getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels)
{
robustnessLevels.clear();
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
Comment on lines +124 to +127
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
Comment thread wrappers/interface/IOcdmSystem.h
Comment thread media/server/service/include/ICdmService.h
Comment thread media/public/include/IMediaKeysCapabilities.h Outdated
Comment thread media/server/main/source/MediaKeysCapabilities.cpp Outdated
Comment thread media/server/ipc/source/MediaKeysCapabilitiesModuleService.cpp
Comment thread media/server/ipc/include/MediaKeysCapabilitiesModuleService.h
Copilot AI review requested due to automatic review settings June 29, 2026 18:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Comment on lines +121 to +145
bool OcdmSystem::getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels)
{
robustnessLevels.clear();
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
Comment thread media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp
Comment thread wrappers/interface/IOcdmSystem.h
Comment thread media/public/include/IMediaKeysCapabilities.h Outdated
Comment thread media/server/service/include/ICdmService.h Outdated
Comment thread media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp
Copilot AI review requested due to automatic review settings July 2, 2026 06:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 9, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.

Comment on lines +123 to +145
robustnessLevels.clear();
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
Comment on lines +500 to +503
bool CdmService::getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels)
{
RIALTO_SERVER_LOG_DEBUG("CdmService requested to getSupportedRobustnessLevels");

Comment on lines +217 to +224
bool MediaKeysCapabilitiesIpc::getSupportedRobustnessLevels(const std::string &keySystem,
std::vector<std::string> &robustnessLevels)
{
if (!reattachChannelIfRequired())
{
RIALTO_CLIENT_LOG_ERROR("Reattachment of the ipc channel failed, ipc disconnected");
return false;
}
Comment on lines +151 to +159
/**
* @brief Gets the robustness levels supported by the underlying CDM for this key system.
*
* @param[out] robustnessLevels : The supported robustness levels.
*
* @retval true if robustness levels were retrieved successfully
*/
virtual bool getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels) = 0;

Copilot AI review requested due to automatic review settings July 10, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 44 out of 44 changed files in this pull request and generated 4 comments.

Comment on lines +123 to +147
bool OcdmSystem::getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels)
{
robustnessLevels.clear();
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
Comment thread 1 Outdated
Comment on lines +1 to +4
From af88d9a3d6afda7671bee13f4139d17a767cd5c5 Mon Sep 17 00:00:00 2001
From: Krishna Priya Kanagaraj <krishnapriya_kanagaraj@comcast.com>
Date: Fri, 10 Jul 2026 01:56:56 +0530
Subject: [PATCH] clang fix
Comment on lines +216 to +223
bool MediaKeysCapabilitiesIpc::getSupportedRobustnessLevels(const std::string &keySystem,
std::vector<std::string> &robustnessLevels)
{
if (!reattachChannelIfRequired())
{
RIALTO_CLIENT_LOG_ERROR("Reattachment of the ipc channel failed, ipc disconnected");
return false;
}
MediaKeysTestMethods::shouldNotGetSupportedRobustnessLevels();
MediaKeysTestMethods::doesNotGetSupportedRobustnessLevels();

// Step 11: Destroy MediaKeysCabilities.
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.7%

Copilot AI review requested due to automatic review settings July 10, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 58 changed files in this pull request and generated 3 comments.

Comment on lines +123 to +147
bool OcdmSystem::getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels)
{
robustnessLevels.clear();
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
Comment on lines +216 to +223
bool MediaKeysCapabilitiesIpc::getSupportedRobustnessLevels(const std::string &keySystem,
std::vector<std::string> &robustnessLevels)
{
if (!reattachChannelIfRequired())
{
RIALTO_CLIENT_LOG_ERROR("Reattachment of the ipc channel failed, ipc disconnected");
return false;
}
Comment on lines +500 to +508
bool CdmService::getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels)
{
RIALTO_SERVER_LOG_DEBUG("CdmService requested to getSupportedRobustnessLevels");

if (!m_isActive)
{
RIALTO_SERVER_LOG_ERROR("Skip getSupportedRobustnessLevels: Session Server in Inactive state");
return false;
}
Copilot AI review requested due to automatic review settings July 10, 2026 08:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 58 changed files in this pull request and generated 3 comments.

Comment on lines +124 to +148
bool OcdmSystem::getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels)
{
robustnessLevels.clear();
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
Comment on lines +216 to +223
bool MediaKeysCapabilitiesIpc::getSupportedRobustnessLevels(const std::string &keySystem,
std::vector<std::string> &robustnessLevels)
{
if (!reattachChannelIfRequired())
{
RIALTO_CLIENT_LOG_ERROR("Reattachment of the ipc channel failed, ipc disconnected");
return false;
}
MediaKeysTestMethods::shouldNotGetSupportedRobustnessLevels();
MediaKeysTestMethods::doesNotGetSupportedRobustnessLevels();

// Step 11: Destroy MediaKeysCabilities.
Copilot AI review requested due to automatic review settings July 10, 2026 10:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 58 changed files in this pull request and generated 3 comments.

Comment on lines +124 to +148
bool OcdmSystem::getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels)
{
robustnessLevels.clear();
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
MediaKeysTestMethods::shouldNotGetSupportedRobustnessLevels();
MediaKeysTestMethods::doesNotGetSupportedRobustnessLevels();

// Step 11: Destroy MediaKeysCabilities.
Comment on lines +510 to +515
auto mediaKeysCapabilities = m_mediaKeysCapabilitiesFactory->getMediaKeysCapabilities();
if (!mediaKeysCapabilities)
{
RIALTO_SERVER_LOG_ERROR("MediaKeysCapabilities is null");
return false;
}
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.7%

1 similar comment
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.7%

Copilot AI review requested due to automatic review settings July 10, 2026 10:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 3 comments.

Comment on lines +124 to +148
bool OcdmSystem::getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels)
{
robustnessLevels.clear();
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
Comment on lines 23 to +27
#include "opencdm/open_cdm_ext.h"
#include <stdexcept>

extern "C" OpenCDMError opencdm_system_supported_robustness(struct OpenCDMSystem *system, char ***robustness,
uint16_t *count);
MediaKeysTestMethods::shouldNotGetSupportedRobustnessLevels();
MediaKeysTestMethods::doesNotGetSupportedRobustnessLevels();

// Step 11: Destroy MediaKeysCabilities.
Copilot AI review requested due to automatic review settings July 14, 2026 12:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 4 comments.

Comment on lines +26 to +27
extern "C" OpenCDMError opencdm_system_supported_robustness(struct OpenCDMSystem *system, char ***robustness,
uint16_t *count);
Comment on lines +124 to +148
bool OcdmSystem::getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels)
{
robustnessLevels.clear();
char **buffer = nullptr;
uint16_t count = 0;
OpenCDMError status = opencdm_system_supported_robustness(m_systemHandle, &buffer, &count);
if (status == ERROR_NONE && buffer != nullptr && count > 0)
{
for (uint16_t i = 0; i < count; ++i)
{
if (buffer[i] != nullptr)
{
robustnessLevels.push_back(std::string(buffer[i]));
free(buffer[i]);
}
}
free(buffer);
return true;
}
if (buffer != nullptr)
{
free(buffer);
}
return false;
}
Comment on lines +216 to +223
bool MediaKeysCapabilitiesIpc::getSupportedRobustnessLevels(const std::string &keySystem,
std::vector<std::string> &robustnessLevels)
{
if (!reattachChannelIfRequired())
{
RIALTO_CLIENT_LOG_ERROR("Reattachment of the ipc channel failed, ipc disconnected");
return false;
}
MediaKeysTestMethods::shouldNotGetSupportedRobustnessLevels();
MediaKeysTestMethods::doesNotGetSupportedRobustnessLevels();

// Step 11: Destroy MediaKeysCabilities.
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.7%

@kkanag314
kkanag314 merged commit 9190a99 into master Jul 14, 2026
40 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants