Skip to content

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

Open
kkanag314 wants to merge 6 commits into
masterfrom
RDKEMW-19064
Open

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

Conversation

@kkanag314

@kkanag314 kkanag314 commented Jun 26, 2026

Copy link
Copy Markdown

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

…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 on lines +123 to +126
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 media/server/main/source/MediaKeysCapabilities.cpp
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;

Comment on lines +119 to 128
/**
* @brief Gets the robustness levels supported by the specified key system.
*
* @param[in] keySystem : The key system.
* @param[out] robustnessLevels : The supported robustness levels.
*
* @retval true if operation was successful
*/
virtual bool getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels) = 0;
};
Comment on lines 76 to 81
virtual std::vector<std::string> getSupportedKeySystems() = 0;
virtual bool supportsKeySystem(const std::string &keySystem) = 0;
virtual bool getSupportedKeySystemVersion(const std::string &keySystem, std::string &version) = 0;
virtual bool isServerCertificateSupported(const std::string &keySystem) = 0;
virtual bool getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels) = 0;

Comment on lines +218 to +249
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;
}

firebolt::rialto::GetSupportedRobustnessLevelsRequest request;
request.set_key_system(keySystem);

firebolt::rialto::GetSupportedRobustnessLevelsResponse response;
auto ipcController = m_ipc.createRpcController();
auto blockingClosure = m_ipc.createBlockingClosure();
m_mediaKeysCapabilitiesStub->getSupportedRobustnessLevels(ipcController.get(), &request, &response,
blockingClosure.get());

// wait for the call to complete
blockingClosure->wait();

// check the result
if (ipcController->Failed())
{
RIALTO_CLIENT_LOG_ERROR("failed to get supported robustness levels due to '%s'",
ipcController->ErrorText().c_str());
return false;
}

robustnessLevels.assign(response.robustness_levels().begin(), response.robustness_levels().end());
return true;
}
Comment thread patch.patch Outdated
Comment on lines +1 to +5
From feda9d75dd606ac48286909115c4f81015431755 Mon Sep 17 00:00:00 2001
From: Krishna Priya Kanagaraj <[email protected]>
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 <[email protected]>
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 on lines +171 to +175
void MediaKeysCapabilitiesModuleService::getSupportedRobustnessLevels(
::google::protobuf::RpcController *controller, const ::firebolt::rialto::GetSupportedRobustnessLevelsRequest *request,
::firebolt::rialto::GetSupportedRobustnessLevelsResponse *response, ::google::protobuf::Closure *done)
{
RIALTO_SERVER_LOG_DEBUG("entry:");
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 +498 to +506
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;
}
Comment on lines +178 to +187
bool MediaKeysCapabilities::getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels)
{
std::shared_ptr<firebolt::rialto::wrappers::IOcdmSystem> ocdmSystem =
m_ocdmSystemFactory->createOcdmSystem(keySystem);
if (!ocdmSystem)
{
RIALTO_SERVER_LOG_ERROR("Failed to create the ocdm system object");
return false;
}
return ocdmSystem->getSupportedRobustnessLevels(robustnessLevels);
Comment on lines +123 to +128
bool MediaKeysCapabilities::getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels)
{
RIALTO_CLIENT_LOG_DEBUG("entry:");

return m_mediaKeysCapabilitiesIpc->getSupportedRobustnessLevels(keySystem, robustnessLevels);
}
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings June 29, 2026 18:24
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

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 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;

Comment on lines 77 to 81
virtual bool supportsKeySystem(const std::string &keySystem) = 0;
virtual bool getSupportedKeySystemVersion(const std::string &keySystem, std::string &version) = 0;
virtual bool isServerCertificateSupported(const std::string &keySystem) = 0;
virtual bool getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels) = 0;

Comment on lines +119 to +127
/**
* @brief Gets the robustness levels supported by the specified key system.
*
* @param[in] keySystem : The key system.
* @param[out] robustnessLevels : The supported robustness levels.
*
* @retval true if operation was successful
*/
virtual bool getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels) = 0;
Comment on lines +178 to +188
bool MediaKeysCapabilities::getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels)
{
std::shared_ptr<firebolt::rialto::wrappers::IOcdmSystem> ocdmSystem =
m_ocdmSystemFactory->createOcdmSystem(keySystem);
if (!ocdmSystem)
{
RIALTO_SERVER_LOG_ERROR("Failed to create the ocdm system object");
return false;
}
return ocdmSystem->getSupportedRobustnessLevels(robustnessLevels);
}
Comment on lines +171 to +175
void MediaKeysCapabilitiesModuleService::getSupportedRobustnessLevels(
::google::protobuf::RpcController *controller, const ::firebolt::rialto::GetSupportedRobustnessLevelsRequest *request,
::firebolt::rialto::GetSupportedRobustnessLevelsResponse *response, ::google::protobuf::Closure *done)
{
RIALTO_SERVER_LOG_DEBUG("entry:");
Comment on lines +65 to +68
void getSupportedRobustnessLevels(::google::protobuf::RpcController *controller,
const ::firebolt::rialto::GetSupportedRobustnessLevelsRequest *request,
::firebolt::rialto::GetSupportedRobustnessLevelsResponse *response,
::google::protobuf::Closure *done) override;
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 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 +154 to +158
* @param[out] robustnessLevels : The supported robustness levels.
*
* @retval true if robustness levels were retrieved successfully
*/
virtual bool getSupportedRobustnessLevels(std::vector<std::string> &robustnessLevels) = 0;
Comment on lines +123 to +127
* @param[out] robustnessLevels : The supported robustness levels.
*
* @retval true if operation was successful
*/
virtual bool getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels) = 0;
Comment on lines 78 to +80
virtual bool getSupportedKeySystemVersion(const std::string &keySystem, std::string &version) = 0;
virtual bool isServerCertificateSupported(const std::string &keySystem) = 0;
virtual bool getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels) = 0;
Comment on lines +226 to +230
firebolt::rialto::GetSupportedRobustnessLevelsRequest request;
request.set_key_system(keySystem);

firebolt::rialto::GetSupportedRobustnessLevelsResponse response;
auto ipcController = m_ipc.createRpcController();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants