RDKEMW-19064: Implementation of OCDM api's to be able to query Key Sy…#545
Conversation
…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
|
Pull request must be merged with a description containing the required fields, Summary: 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. |
|
media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp:251:1: error: Unmatched '}'. Configuration: ''. [syntaxError] |
There was a problem hiding this comment.
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
getSupportedRobustnessLevelsto the public/media capabilities interfaces and implementations (client + server). - Extended the MediaKeysCapabilities IPC protobuf/service with a new
getSupportedRobustnessLevelsRPC. - 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.
| 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 | ||
|
|
|
media/client/ipc/source/MediaKeysCapabilitiesIpc.cpp:251:1: error: Unmatched '}'. Configuration: ''. [syntaxError] |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| 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; | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| 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; | ||
| } |
| 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) |
| 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; | ||
| } |
| 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; | ||
| } |
| bool CdmService::getSupportedRobustnessLevels(const std::string &keySystem, std::vector<std::string> &robustnessLevels) | ||
| { | ||
| RIALTO_SERVER_LOG_DEBUG("CdmService requested to getSupportedRobustnessLevels"); | ||
|
|
| 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; | ||
| } |
| /** | ||
| * @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; | ||
|
|
| 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; | ||
| } |
| 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 |
| 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. |
|
Coverage statistics of your commit: |
| 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; | ||
| } |
| 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; | ||
| } |
| 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; | ||
| } |
| 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; | ||
| } |
| 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. |
| 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. |
| auto mediaKeysCapabilities = m_mediaKeysCapabilitiesFactory->getMediaKeysCapabilities(); | ||
| if (!mediaKeysCapabilities) | ||
| { | ||
| RIALTO_SERVER_LOG_ERROR("MediaKeysCapabilities is null"); | ||
| return false; | ||
| } |
|
Coverage statistics of your commit: |
1 similar comment
|
Coverage statistics of your commit: |
| 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; | ||
| } |
| #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. |
| extern "C" OpenCDMError opencdm_system_supported_robustness(struct OpenCDMSystem *system, char ***robustness, | ||
| uint16_t *count); |
| 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; | ||
| } |
| 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. |
|
Coverage statistics of your commit: |
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