public interface DrmSessionManager
| Modifier and Type | Field and Description |
|---|---|
static DrmSessionManager |
DRM_UNSUPPORTED
An instance that supports no DRM schemes.
|
static DrmSessionManager |
DUMMY
Deprecated.
Use
DRM_UNSUPPORTED. |
| Modifier and Type | Method and Description |
|---|---|
DrmSession |
acquireSession(android.os.Looper playbackLooper,
DrmSessionEventListener.EventDispatcher eventDispatcher,
DrmInitData drmInitData,
java.lang.String sampleMimeType)
Returns a
DrmSession for the specified DrmInitData, with an incremented reference
count. |
static DrmSessionManager |
getDummyDrmSessionManager()
Deprecated.
Use
DRM_UNSUPPORTED. |
java.lang.Class<? extends ExoMediaCrypto> |
getExoMediaCryptoType(DrmInitData drmInitData,
java.lang.String sampleMimeType)
Returns the
ExoMediaCrypto type associated to sessions acquired for the given DrmInitData. |
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()
DrmSession acquireSession(android.os.Looper playbackLooper, DrmSessionEventListener.EventDispatcher eventDispatcher, DrmInitData drmInitData, java.lang.String sampleMimeType)
DrmSession for the specified DrmInitData, with an incremented reference
count. May return null if the 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 DrmInitData contains a null 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).drmInitData - The DrmInitData for which to acquire a DrmSession.java.lang.Class<? extends ExoMediaCrypto> getExoMediaCryptoType(DrmInitData drmInitData, java.lang.String sampleMimeType)
ExoMediaCrypto type associated to sessions acquired for the given DrmInitData. Returns the UnsupportedMediaCrypto type if this DRM session manager does not
support any of the DRM schemes defined in the given DrmInitData. Returns null if drmInitData
is null and acquireSession(android.os.Looper, tv.danmaku.ijk.media.drm.DrmSessionEventListener.EventDispatcher, tv.danmaku.ijk.media.drm.DrmInitData, java.lang.String) would return null for the given DrmInitData.drmInitData - The DrmInitData for which to return the ExoMediaCrypto type.ExoMediaCrypto type associated to sessions acquired using the given DrmInitData, or UnsupportedMediaCrypto if this DRM session manager does not support any
of the DRM schemes defined in the given DrmInitData. May be null if
drmInitData is null and acquireSession(android.os.Looper, tv.danmaku.ijk.media.drm.DrmSessionEventListener.EventDispatcher, tv.danmaku.ijk.media.drm.DrmInitData, java.lang.String) would return null for the given
DrmInitData.