mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Make placeholder sessions report their true state
Note that the renderer changes will all disappear when we remove legacy injection of DrmSessionManager into renderers. PiperOrigin-RevId: 281952601
This commit is contained in:
parent
de641380df
commit
ff19262a5e
5 changed files with 11 additions and 10 deletions
|
|
@ -473,7 +473,9 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
|
|||
}
|
||||
|
||||
private boolean shouldWaitForKeys(boolean bufferEncrypted) throws ExoPlaybackException {
|
||||
if (decoderDrmSession == null || (!bufferEncrypted && playClearSamplesWithoutKeys)) {
|
||||
if (decoderDrmSession == null
|
||||
|| (!bufferEncrypted
|
||||
&& (playClearSamplesWithoutKeys || decoderDrmSession.playClearSamplesWithoutKeys()))) {
|
||||
return false;
|
||||
}
|
||||
@DrmSession.State int drmSessionState = decoderDrmSession.getState();
|
||||
|
|
|
|||
|
|
@ -356,7 +356,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
@RequiresNonNull("sessionId")
|
||||
private void doLicense(boolean allowRetry) {
|
||||
if (isPlaceholderSession) {
|
||||
state = STATE_OPENED_WITH_KEYS;
|
||||
return;
|
||||
}
|
||||
byte[] sessionId = Util.castNonNull(this.sessionId);
|
||||
|
|
|
|||
|
|
@ -77,13 +77,9 @@ public interface DrmSession<T extends ExoMediaCrypto> {
|
|||
* The session is being opened.
|
||||
*/
|
||||
int STATE_OPENING = 2;
|
||||
/**
|
||||
* The session is open, but does not yet have the keys required for decryption.
|
||||
*/
|
||||
/** The session is open, but does not have keys required for decryption. */
|
||||
int STATE_OPENED = 3;
|
||||
/**
|
||||
* The session is open and has the keys required for decryption.
|
||||
*/
|
||||
/** The session is open and has keys required for decryption. */
|
||||
int STATE_OPENED_WITH_KEYS = 4;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1191,7 +1191,9 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
|||
}
|
||||
|
||||
private boolean shouldWaitForKeys(boolean bufferEncrypted) throws ExoPlaybackException {
|
||||
if (codecDrmSession == null || (!bufferEncrypted && playClearSamplesWithoutKeys)) {
|
||||
if (codecDrmSession == null
|
||||
|| (!bufferEncrypted
|
||||
&& (playClearSamplesWithoutKeys || codecDrmSession.playClearSamplesWithoutKeys()))) {
|
||||
return false;
|
||||
}
|
||||
@DrmSession.State int drmSessionState = codecDrmSession.getState();
|
||||
|
|
|
|||
|
|
@ -878,7 +878,9 @@ public abstract class SimpleDecoderVideoRenderer extends BaseRenderer {
|
|||
}
|
||||
|
||||
private boolean shouldWaitForKeys(boolean bufferEncrypted) throws ExoPlaybackException {
|
||||
if (decoderDrmSession == null || (!bufferEncrypted && playClearSamplesWithoutKeys)) {
|
||||
if (decoderDrmSession == null
|
||||
|| (!bufferEncrypted
|
||||
&& (playClearSamplesWithoutKeys || decoderDrmSession.playClearSamplesWithoutKeys()))) {
|
||||
return false;
|
||||
}
|
||||
@DrmSession.State int drmSessionState = decoderDrmSession.getState();
|
||||
|
|
|
|||
Loading…
Reference in a new issue