mirror of
https://github.com/androidx/media.git
synced 2025-05-14 02:59:52 +08:00
Clarify DRM error deferral comments
- I don't think the session recovering later would work, because the codec will be configured not to use it. - I'm not sure session recovery makes sense in general, and our implementations do not do this. Document it as a terminal state for now. PiperOrigin-RevId: 340204194
This commit is contained in:
parent
be1fd23666
commit
1d12d03283
@ -603,8 +603,8 @@ public abstract class DecoderAudioRenderer<
|
||||
if (mediaCrypto == null) {
|
||||
DrmSessionException drmError = decoderDrmSession.getError();
|
||||
if (drmError != null) {
|
||||
// Continue for now. We may be able to avoid failure if the session recovers, or if a new
|
||||
// input format causes the session to be replaced before it's used.
|
||||
// Continue for now. We may be able to avoid failure if a new input format causes the
|
||||
// session to be replaced without it having been used.
|
||||
} else {
|
||||
// The drm session isn't open yet.
|
||||
return;
|
||||
|
@ -66,12 +66,11 @@ public interface DrmSession {
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({STATE_RELEASED, STATE_ERROR, STATE_OPENING, STATE_OPENED, STATE_OPENED_WITH_KEYS})
|
||||
@interface State {}
|
||||
/**
|
||||
* The session has been released.
|
||||
*/
|
||||
/** The session has been released. This is a terminal state. */
|
||||
int STATE_RELEASED = 0;
|
||||
/**
|
||||
* The session has encountered an error. {@link #getError()} can be used to retrieve the cause.
|
||||
* This is a terminal state.
|
||||
*/
|
||||
int STATE_ERROR = 1;
|
||||
/**
|
||||
|
@ -499,8 +499,8 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
||||
if (sessionMediaCrypto == null) {
|
||||
@Nullable DrmSessionException drmError = codecDrmSession.getError();
|
||||
if (drmError != null) {
|
||||
// Continue for now. We may be able to avoid failure if the session recovers, or if a
|
||||
// new input format causes the session to be replaced before it's used.
|
||||
// Continue for now. We may be able to avoid failure if a new input format causes the
|
||||
// session to be replaced without it having been used.
|
||||
} else {
|
||||
// The drm session isn't open yet.
|
||||
return;
|
||||
|
@ -661,8 +661,8 @@ public abstract class DecoderVideoRenderer extends BaseRenderer {
|
||||
if (mediaCrypto == null) {
|
||||
DrmSessionException drmError = decoderDrmSession.getError();
|
||||
if (drmError != null) {
|
||||
// Continue for now. We may be able to avoid failure if the session recovers, or if a new
|
||||
// input format causes the session to be replaced before it's used.
|
||||
// Continue for now. We may be able to avoid failure if a new input format causes the
|
||||
// session to be replaced without it having been used.
|
||||
} else {
|
||||
// The drm session isn't open yet.
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user