Expose public constructors for FrameworkMediaCrypto
MediaCodecRenderer implementations require DrmSessionManager<FrameworkMediaCrypto>, but it's currently not possible for an app to provide a custom implementation due to FrameworkMediaCrypto having a package private constructor. This change exposes public FrameworkMediaCrypto constructors, hence removing this restriction. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171718853
This commit is contained in:
parent
9a6d717a7a
commit
5d4fa335f9
@ -28,12 +28,29 @@ public final class FrameworkMediaCrypto implements ExoMediaCrypto {
|
||||
private final MediaCrypto mediaCrypto;
|
||||
private final boolean forceAllowInsecureDecoderComponents;
|
||||
|
||||
/* package */ FrameworkMediaCrypto(MediaCrypto mediaCrypto,
|
||||
/**
|
||||
* @param mediaCrypto The {@link MediaCrypto} to wrap.
|
||||
*/
|
||||
public FrameworkMediaCrypto(MediaCrypto mediaCrypto) {
|
||||
this(mediaCrypto, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mediaCrypto The {@link MediaCrypto} to wrap.
|
||||
* @param forceAllowInsecureDecoderComponents Whether to force
|
||||
* {@link #requiresSecureDecoderComponent(String)} to return {@code false}, rather than
|
||||
* {@link MediaCrypto#requiresSecureDecoderComponent(String)} of the wrapped
|
||||
* {@link MediaCrypto}.
|
||||
*/
|
||||
public FrameworkMediaCrypto(MediaCrypto mediaCrypto,
|
||||
boolean forceAllowInsecureDecoderComponents) {
|
||||
this.mediaCrypto = Assertions.checkNotNull(mediaCrypto);
|
||||
this.forceAllowInsecureDecoderComponents = forceAllowInsecureDecoderComponents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the wrapped {@link MediaCrypto}.
|
||||
*/
|
||||
public MediaCrypto getWrappedMediaCrypto() {
|
||||
return mediaCrypto;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user