Skip to content

Add Rialto DRM adapter as separate path from OCDM#1601

Draft
anshephe wants to merge 3 commits into
feature/VPLAY-12902from
feature/VPLAY-12902_drm_rework
Draft

Add Rialto DRM adapter as separate path from OCDM#1601
anshephe wants to merge 3 commits into
feature/VPLAY-12902from
feature/VPLAY-12902_drm_rework

Conversation

@anshephe

Copy link
Copy Markdown
Contributor

Introduce a standalone Rialto DRM session implementation alongside the existing OCDM path, gated behind a new USE_DIRECT_RIALTO_ADAPTER compile flag and CMAKE_USE_DIRECT_RIALTO_ADAPTER CMake variable.

New classes under middleware/drm/rialto/:

  • RialtoMediaKeySession: wraps a single Rialto key session lifecycle (update, close, destruct, key-status tracking)
  • RialtoMediaKeySystem: owns the IMediaKeys instance and creates sessions; inner MediaKeysClient routes IMediaKeysClient callbacks
  • RialtoMediaKeySessionAdapter: DrmSession implementation that connects DrmHelper and DrmCallbacks to the Rialto path

DrmSessionFactory: add bool useDirectRialto parameter to GetDrmSession to avoid reading gpGlobalConfig directly; Rialto branch is compiled only when USE_DIRECT_RIALTO_ADAPTER is defined.

DrmSessionManager: reads eAAMPConfig_useDirectRialto from config and passes the result as a bool into DrmSessionFactory::GetDrmSession.

Build:

  • middleware/CMakeLists.txt: add if(CMAKE_USE_DIRECT_RIALTO_ADAPTER) block (mirrors the OCDM pattern) that appends the three Rialto sources, sets the compiler define, and links Rialto libraries
  • CMakeLists.txt (top-level): set CMAKE_USE_DIRECT_RIALTO_ADAPTER TRUE after Rialto/RialtoSimulator is resolved so the adapter is always enabled in aamp builds
  • test/rialto/RialtoSimulator.cpp: add IMediaKeysFactory::createFactory stub so simulator builds satisfy the linker

Unit tests under middleware/test/utests/tests/:

  • RialtoMediaKeySessionTests
  • RialtoMediaKeySystemTests
  • RialtoMediaKeySessionAdapterTests

Each test suite has its own CMakeLists.txt per project conventions. Stub Rialto headers (IMediaKeys.h, IMediaKeysClient.h, MediaCommon.h) and a GoogleMock (MockRialtoMediaKeys.h) are provided under test/utests/rialto/ and test/utests/mocks/ respectively.

anshephe added 3 commits June 11, 2026 13:23
Introduce a standalone Rialto DRM session implementation alongside the
existing OCDM path, gated behind a new USE_DIRECT_RIALTO_ADAPTER
compile flag and CMAKE_USE_DIRECT_RIALTO_ADAPTER CMake variable.

New classes under middleware/drm/rialto/:
- RialtoMediaKeySession: wraps a single Rialto key session lifecycle
  (update, close, destruct, key-status tracking)
- RialtoMediaKeySystem: owns the IMediaKeys instance and creates
  sessions; inner MediaKeysClient routes IMediaKeysClient callbacks
- RialtoMediaKeySessionAdapter: DrmSession implementation that
  connects DrmHelper and DrmCallbacks to the Rialto path

DrmSessionFactory: add bool useDirectRialto parameter to GetDrmSession
to avoid reading gpGlobalConfig directly; Rialto branch is compiled
only when USE_DIRECT_RIALTO_ADAPTER is defined.

DrmSessionManager: reads eAAMPConfig_useDirectRialto from config and
passes the result as a bool into DrmSessionFactory::GetDrmSession.

Build:
- middleware/CMakeLists.txt: add if(CMAKE_USE_DIRECT_RIALTO_ADAPTER)
  block (mirrors the OCDM pattern) that appends the three Rialto
  sources, sets the compiler define, and links Rialto libraries
- CMakeLists.txt (top-level): set CMAKE_USE_DIRECT_RIALTO_ADAPTER TRUE
  after Rialto/RialtoSimulator is resolved so the adapter is always
  enabled in aamp builds
- test/rialto/RialtoSimulator.cpp: add IMediaKeysFactory::createFactory
  stub so simulator builds satisfy the linker

Unit tests under middleware/test/utests/tests/:
- RialtoMediaKeySessionTests
- RialtoMediaKeySystemTests
- RialtoMediaKeySessionAdapterTests

Each test suite has its own CMakeLists.txt per project conventions.
Stub Rialto headers (IMediaKeys.h, IMediaKeysClient.h, MediaCommon.h)
and a GoogleMock (MockRialtoMediaKeys.h) are provided under
test/utests/rialto/ and test/utests/mocks/ respectively.
With both adapters enabled simultaneously, the order of
operations in CMakeLists.txt is:

1. Rialto block: set(DEPENDS ${DEPENDS} ${RIALTO_LIBRARIES}) —
list append, DEPENDS is now a semicolon-separated list ending
in /path/to/libRialtoClient.so
2. OCDM block: set(DEPENDS "${DEPENDS} -lgstvideo-1.0") —
string concat, which joins the last list item with -lgstvideo-1.0
via a space

Ninja then sees /path/to/libRialtoClient.so -lgstvideo-1.0 as a
single file path prerequisite → fails immediately.
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.

1 participant