mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Wait for DRM keys before codec configuration on FireOS devices
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201695876
This commit is contained in:
parent
156e2317cc
commit
a407c028d4
1 changed files with 19 additions and 0 deletions
|
|
@ -369,6 +369,15 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
||||||
wrappedMediaCrypto = mediaCrypto.getWrappedMediaCrypto();
|
wrappedMediaCrypto = mediaCrypto.getWrappedMediaCrypto();
|
||||||
drmSessionRequiresSecureDecoder = mediaCrypto.requiresSecureDecoderComponent(mimeType);
|
drmSessionRequiresSecureDecoder = mediaCrypto.requiresSecureDecoderComponent(mimeType);
|
||||||
}
|
}
|
||||||
|
if (deviceNeedsDrmKeysToConfigureCodecWorkaround()) {
|
||||||
|
@DrmSession.State int drmSessionState = drmSession.getState();
|
||||||
|
if (drmSessionState == DrmSession.STATE_ERROR) {
|
||||||
|
throw ExoPlaybackException.createForRenderer(drmSession.getError(), getIndex());
|
||||||
|
} else if (drmSessionState != DrmSession.STATE_OPENED_WITH_KEYS) {
|
||||||
|
// Wait for keys.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (codecInfo == null) {
|
if (codecInfo == null) {
|
||||||
|
|
@ -1209,6 +1218,16 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the device needs keys to have been loaded into the {@link DrmSession} before
|
||||||
|
* codec configuration.
|
||||||
|
*/
|
||||||
|
private boolean deviceNeedsDrmKeysToConfigureCodecWorkaround() {
|
||||||
|
return "Amazon".equals(Util.MANUFACTURER)
|
||||||
|
&& ("AFTM".equals(Util.MODEL) // Fire TV Stick Gen 1
|
||||||
|
|| "AFTB".equals(Util.MODEL)); // Fire TV Gen 1
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the decoder is known to fail when flushed.
|
* Returns whether the decoder is known to fail when flushed.
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue