Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache opened widevine DRM Sessions until Player.release() #2048

Open
stevemayhew opened this issue Jan 16, 2025 · 0 comments
Open

Cache opened widevine DRM Sessions until Player.release() #2048

stevemayhew opened this issue Jan 16, 2025 · 0 comments

Comments

@stevemayhew
Copy link
Contributor

stevemayhew commented Jan 16, 2025

Use case description

The use case involves streaming a large linear channel list (>100 channels) consisting of Live HLS and DASH playlists, protected by Widevine. Playback is continuous, and "channel zapping" or "channel surfing" is a frequent activity. Channels may be licensed individually or in packages.

Most Android streaming hardware supports a significant number of open MediaDrm session slots (e.g., Google TV Chromecast, based on AmLogic SoC, supports 100 active license slots).

Currently, ExoPlayer retains open sessions for MediaItems in a timed cache, however this cache is flushed whenever any MediaSource that references it is released.

The Playlist avoids this as the MediaItem's in it are associated with MediaSources are not fully released until the MediaSourceList (playlist) is released.

In contrast, changing channels by calling Player.setMediaItems() with a single channel's MediaItem releases the current MediaSource, effectively flushing the DRM session cache every time.

The use case precludes the use of a Playlist due to the following challenges:

  1. The Playlist API does not directly preclude multiple live items, however it makes little sense contextually
  2. Retaining a fully prepared live MediaSource consumes significant CPU, memory, and network bandwidth, as it retains source buffers and continues polling live playlist refreshes.
  3. Linear channel provisioning often occurs on-the-fly, making it impractical to pre-create a playlist of 100+ channels before playback starts.

Related Requests

The issue #394 presented a very similar request, however it looked like the request was to persist licnese after process exit.

The Widevine CDM platform will not support this as the open MediaDrm sessions owned by a process are released on process exit. In fact it is not really valid to retain open MediaDrm sessions while the Activity is not in the foreground as they are a shared hardware resource.

Proposed solution

Pull request #2049

Alternatives considered

The Playlist could be made acceptable, but some mechanism for quiescing the Timeline.Window live windows that are not currently playing. The quiesce would stop the playlist tracker and free cached media without fulling releasing the MediaSource. This would be a much more significant change than what is proposed in the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants