DefaultDrmSessionManagerpublic interface DrmSessionManager
| Modifier and Type | Field | Description |
|---|---|---|
static DrmSessionManager |
DRM_UNSUPPORTED |
An instance that supports no DRM schemes.
|
static DrmSessionManager |
DUMMY |
Deprecated.
Use
DRM_UNSUPPORTED. |
| Modifier and Type | Method | Description |
|---|---|---|
DrmSession |
acquireSession(Looper playbackLooper,
DrmSessionEventListener.EventDispatcher eventDispatcher,
Format format) |
Returns a
DrmSession for the specified Format, with an incremented reference
count. |
static DrmSessionManager |
getDummyDrmSessionManager() |
Deprecated.
Use
DRM_UNSUPPORTED. |
Class<? extends ExoMediaCrypto> |
getExoMediaCryptoType(Format format) |
Returns the
ExoMediaCrypto type associated to sessions acquired for the given Format. |
default void |
prepare() |
Acquires any required resources.
|
default void |
release() |
Releases any acquired resources.
|
static final DrmSessionManager DRM_UNSUPPORTED
@Deprecated static final DrmSessionManager DUMMY
DRM_UNSUPPORTED.@Deprecated static DrmSessionManager getDummyDrmSessionManager()
DRM_UNSUPPORTED.DRM_UNSUPPORTED.default void prepare()
release() must be called to ensure the acquired resources are released. After
releasing, an instance may be re-prepared.
default void release()
@Nullable DrmSession acquireSession(Looper playbackLooper, @Nullable DrmSessionEventListener.EventDispatcher eventDispatcher, Format format)
DrmSession for the specified Format, with an incremented reference
count. May return null if the Format.drmInitData is null and the DRM session manager is
not configured to attach a DrmSession to clear content. When the caller no longer needs
to use a returned DrmSession, it must call DrmSession.release(DrmSessionEventListener.EventDispatcher) to decrement the reference count.
If the provided Format contains a null Format.drmInitData, the returned
DrmSession (if not null) will be a placeholder session which does not execute key
requests, and cannot be used to handle encrypted content. However, a placeholder session may be
used to configure secure decoders for playback of clear content periods, which can reduce the
cost of transitioning between clear and encrypted content.
playbackLooper - The looper associated with the media playback thread.eventDispatcher - The DrmSessionEventListener.EventDispatcher used to distribute
events, and passed on to DrmSession.acquire(DrmSessionEventListener.EventDispatcher).format - The Format for which to acquire a DrmSession.Format.drmInitData is null.@Nullable Class<? extends ExoMediaCrypto> getExoMediaCryptoType(Format format)
ExoMediaCrypto type associated to sessions acquired for the given Format. Returns the UnsupportedMediaCrypto type if this DRM session manager does not
support any of the DRM schemes defined in the given Format. Returns null if Format.drmInitData is null and acquireSession(android.os.Looper, com.google.android.exoplayer2.drm.DrmSessionEventListener.EventDispatcher, com.google.android.exoplayer2.Format) would return null for the given Format.format - The Format for which to return the ExoMediaCrypto type.ExoMediaCrypto type associated to sessions acquired using the given Format, or UnsupportedMediaCrypto if this DRM session manager does not support any
of the DRM schemes defined in the given Format. May be null if Format.drmInitData is null and acquireSession(android.os.Looper, com.google.android.exoplayer2.drm.DrmSessionEventListener.EventDispatcher, com.google.android.exoplayer2.Format) would return null for the given
Format.