Interface DrmSessionManager
-
- All Known Implementing Classes:
DefaultDrmSessionManager
@Deprecated public interface DrmSessionManager
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Manages a DRM session.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceDrmSessionManager.DrmSessionReferenceDeprecated.Represents a single reference count of aDrmSession, while deliberately not giving access to the underlying session.
-
Field Summary
Fields Modifier and Type Field Description static DrmSessionManagerDRM_UNSUPPORTEDDeprecated.An instance that supports no DRM schemes.static DrmSessionManagerDUMMYDeprecated.UseDRM_UNSUPPORTED.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description DrmSessionacquireSession(DrmSessionEventListener.EventDispatcher eventDispatcher, Format format)Deprecated.Returns aDrmSessionfor the specifiedFormat, with an incremented reference count.@com.google.android.exoplayer2.C.CryptoType intgetCryptoType(Format format)Deprecated.Returns theC.CryptoTypethat the DRM session manager will use for a givenFormat.static DrmSessionManagergetDummyDrmSessionManager()Deprecated.UseDRM_UNSUPPORTED.default DrmSessionManager.DrmSessionReferencepreacquireSession(DrmSessionEventListener.EventDispatcher eventDispatcher, Format format)Deprecated.Pre-acquires a DRM session for the specifiedFormat.default voidprepare()Deprecated.Acquires any required resources.default voidrelease()Deprecated.Releases any acquired resources.voidsetPlayer(Looper playbackLooper, PlayerId playerId)Deprecated.Sets information about the player using this DRM session manager.
-
-
-
Field Detail
-
DRM_UNSUPPORTED
static final DrmSessionManager DRM_UNSUPPORTED
Deprecated.An instance that supports no DRM schemes.
-
DUMMY
@Deprecated static final DrmSessionManager DUMMY
Deprecated.UseDRM_UNSUPPORTED.An instance that supports no DRM schemes.
-
-
Method Detail
-
getDummyDrmSessionManager
@Deprecated static DrmSessionManager getDummyDrmSessionManager()
Deprecated.UseDRM_UNSUPPORTED.ReturnsDRM_UNSUPPORTED.
-
prepare
default void prepare()
Deprecated.Acquires any required resources.release()must be called to ensure the acquired resources are released. After releasing, an instance may be re-prepared.
-
release
default void release()
Deprecated.Releases any acquired resources.
-
setPlayer
void setPlayer(Looper playbackLooper, PlayerId playerId)
Deprecated.Sets information about the player using this DRM session manager.
-
preacquireSession
default DrmSessionManager.DrmSessionReference preacquireSession(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher, Format format)
Deprecated.Pre-acquires a DRM session for the specifiedFormat.This notifies the manager that a subsequent call to
acquireSession( DrmSessionEventListener.EventDispatcher, Format)with the sameFormatis likely, allowing a manager that supports pre-acquisition to get the requiredDrmSessionready in the background.The caller must call
DrmSessionManager.DrmSessionReference.release()on the returned instance when they no longer require the pre-acquisition (i.e. they know they won't be making a matching call toacquireSession(DrmSessionEventListener.EventDispatcher, Format)in the near future).This manager may silently release the underlying session in order to allow another operation to complete. This will result in a subsequent call to
acquireSession( DrmSessionEventListener.EventDispatcher, Format)re-initializing a new session, including repeating key loads and other async initialization steps.The caller must separately call
acquireSession( DrmSessionEventListener.EventDispatcher, Format)in order to obtain a session suitable for playback. The pre-acquiredDrmSessionManager.DrmSessionReferenceand fullDrmSessioninstances are distinct. The caller must release both, and can release theDrmSessionManager.DrmSessionReferencebefore theDrmSessionwithout affecting playback.This can be called from any thread.
Implementations that do not support pre-acquisition always return an empty
DrmSessionManager.DrmSessionReferenceinstance.- Parameters:
eventDispatcher- TheDrmSessionEventListener.EventDispatcherused to distribute events, and passed on toDrmSession.acquire(DrmSessionEventListener.EventDispatcher).format- TheFormatfor which to pre-acquire aDrmSession.- Returns:
- A releaser for the pre-acquired session. Guaranteed to be non-null even if the matching
acquireSession(DrmSessionEventListener.EventDispatcher, Format)would return null.
-
acquireSession
@Nullable DrmSession acquireSession(@Nullable DrmSessionEventListener.EventDispatcher eventDispatcher, Format format)
Deprecated.Returns aDrmSessionfor the specifiedFormat, with an incremented reference count. May return null if theFormat.drmInitDatais null and the DRM session manager is not configured to attach aDrmSessionto clear content. When the caller no longer needs to use a returnedDrmSession, it must callDrmSession.release(DrmSessionEventListener.EventDispatcher)to decrement the reference count.If the provided
Formatcontains a nullFormat.drmInitData, the returnedDrmSession(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.- Parameters:
eventDispatcher- TheDrmSessionEventListener.EventDispatcherused to distribute events, and passed on toDrmSession.acquire(DrmSessionEventListener.EventDispatcher).format- TheFormatfor which to acquire aDrmSession.- Returns:
- The DRM session. May be null if the given
Format.drmInitDatais null.
-
getCryptoType
@com.google.android.exoplayer2.C.CryptoType int getCryptoType(Format format)
Deprecated.Returns theC.CryptoTypethat the DRM session manager will use for a givenFormat. ReturnsC.CRYPTO_TYPE_UNSUPPORTEDif the manager does not support any of the DRM schemes defined in theFormat. ReturnsC.CRYPTO_TYPE_NONEifFormat.drmInitDatais null andacquireSession(com.google.android.exoplayer2.drm.DrmSessionEventListener.EventDispatcher, com.google.android.exoplayer2.Format)will returnnullfor the givenFormat.- Parameters:
format- TheFormat.- Returns:
- The
C.CryptoTypethat the manager will use, or @link C#CRYPTO_TYPE_UNSUPPORTED} if the manager does not support any of the DRM schemes defined in theFormat. Will beC.CRYPTO_TYPE_NONEifFormat.drmInitDatais null andacquireSession(com.google.android.exoplayer2.drm.DrmSessionEventListener.EventDispatcher, com.google.android.exoplayer2.Format)will return null for the givenFormat.
-
-