Fix mapping CLEARKEY_UUID to COMMON_PSSH_UUID
This mapping when we call into platform components also needs to be applied when creating the MediaCrypto instance. The fix is to stop propagating the UUID through all the createMediaCrypto methods. This is unnecessary, since the eventual target already knows its own UUID! Issue: #3138 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=166843372
This commit is contained in:
parent
3e76227006
commit
f44e30c754
@ -226,7 +226,7 @@ import java.util.UUID;
|
||||
|
||||
try {
|
||||
sessionId = mediaDrm.openSession();
|
||||
mediaCrypto = mediaDrm.createMediaCrypto(uuid, sessionId);
|
||||
mediaCrypto = mediaDrm.createMediaCrypto(sessionId);
|
||||
state = STATE_OPENED;
|
||||
return true;
|
||||
} catch (NotProvisionedException e) {
|
||||
|
@ -22,7 +22,6 @@ import android.media.NotProvisionedException;
|
||||
import android.media.ResourceBusyException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Used to obtain keys for decrypting protected media streams. See {@link android.media.MediaDrm}.
|
||||
@ -137,11 +136,10 @@ public interface ExoMediaDrm<T extends ExoMediaCrypto> {
|
||||
/**
|
||||
* @see android.media.MediaCrypto#MediaCrypto(UUID, byte[])
|
||||
*
|
||||
* @param uuid The UUID of the crypto scheme.
|
||||
* @param initData Opaque initialization data specific to the crypto scheme.
|
||||
* @return An object extends {@link ExoMediaCrypto}, using opaque crypto scheme specific data.
|
||||
* @throws MediaCryptoException
|
||||
*/
|
||||
T createMediaCrypto(UUID uuid, byte[] initData) throws MediaCryptoException;
|
||||
T createMediaCrypto(byte[] initData) throws MediaCryptoException;
|
||||
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ import java.util.UUID;
|
||||
@TargetApi(18)
|
||||
public final class FrameworkMediaDrm implements ExoMediaDrm<FrameworkMediaCrypto> {
|
||||
|
||||
private final UUID uuid;
|
||||
private final MediaDrm mediaDrm;
|
||||
|
||||
/**
|
||||
@ -59,10 +60,9 @@ public final class FrameworkMediaDrm implements ExoMediaDrm<FrameworkMediaCrypto
|
||||
private FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
|
||||
Assertions.checkNotNull(uuid);
|
||||
Assertions.checkArgument(!C.COMMON_PSSH_UUID.equals(uuid), "Use C.CLEARKEY_UUID instead");
|
||||
if (Util.SDK_INT < 27 && C.CLEARKEY_UUID.equals(uuid)) {
|
||||
// ClearKey had to be accessed using the Common PSSH UUID prior to API level 27.
|
||||
uuid = C.COMMON_PSSH_UUID;
|
||||
}
|
||||
uuid = Util.SDK_INT < 27 && C.CLEARKEY_UUID.equals(uuid) ? C.COMMON_PSSH_UUID : uuid;
|
||||
this.uuid = uuid;
|
||||
this.mediaDrm = new MediaDrm(uuid);
|
||||
}
|
||||
|
||||
@ -169,8 +169,7 @@ public final class FrameworkMediaDrm implements ExoMediaDrm<FrameworkMediaCrypto
|
||||
}
|
||||
|
||||
@Override
|
||||
public FrameworkMediaCrypto createMediaCrypto(UUID uuid, byte[] initData)
|
||||
throws MediaCryptoException {
|
||||
public FrameworkMediaCrypto createMediaCrypto(byte[] initData) throws MediaCryptoException {
|
||||
// Work around a bug prior to Lollipop where L1 Widevine forced into L3 mode would still
|
||||
// indicate that it required secure video decoders [Internal ref: b/11428937].
|
||||
boolean forceAllowInsecureDecoderComponents = Util.SDK_INT < 21
|
||||
|
Loading…
x
Reference in New Issue
Block a user