diff --git a/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java b/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java index 619fc202da..d7e22f00ec 100644 --- a/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java +++ b/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java @@ -386,8 +386,8 @@ public class PlayerActivity extends Activity implements OnClickListener, ExoPlay keyRequestPropertiesArray[i + 1]); } } - return new DefaultDrmSessionManager<>(uuid, - FrameworkMediaDrm.newInstance(uuid), drmCallback, null, mainHandler, eventLogger); + return new DefaultDrmSessionManager<>(uuid, FrameworkMediaDrm.newInstance(uuid), drmCallback, + null, mainHandler, eventLogger); } private void releasePlayer() { diff --git a/library/core/src/main/java/com/google/android/exoplayer2/C.java b/library/core/src/main/java/com/google/android/exoplayer2/C.java index e8c47d9811..d7d0ed40aa 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/C.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/C.java @@ -578,6 +578,26 @@ public final class C { public static final int DEFAULT_MUXED_BUFFER_SIZE = DEFAULT_VIDEO_BUFFER_SIZE + DEFAULT_AUDIO_BUFFER_SIZE + DEFAULT_TEXT_BUFFER_SIZE; + /** + * "cenc" scheme type name as defined in ISO/IEC 23001-7:2016. + */ + public static final String CENC_TYPE_cenc = "cenc"; + + /** + * "cbc1" scheme type name as defined in ISO/IEC 23001-7:2016. + */ + public static final String CENC_TYPE_cbc1 = "cbc1"; + + /** + * "cens" scheme type name as defined in ISO/IEC 23001-7:2016. + */ + public static final String CENC_TYPE_cens = "cens"; + + /** + * "cbcs" scheme type name as defined in ISO/IEC 23001-7:2016. + */ + public static final String CENC_TYPE_cbcs = "cbcs"; + /** * The Nil UUID as defined by * RFC4122. diff --git a/library/core/src/main/java/com/google/android/exoplayer2/RendererCapabilities.java b/library/core/src/main/java/com/google/android/exoplayer2/RendererCapabilities.java index 151453c12c..f841a1b8b5 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/RendererCapabilities.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/RendererCapabilities.java @@ -27,11 +27,11 @@ public interface RendererCapabilities { * {@link #FORMAT_HANDLED}, {@link #FORMAT_EXCEEDS_CAPABILITIES}, * {@link #FORMAT_UNSUPPORTED_SUBTYPE} and {@link #FORMAT_UNSUPPORTED_TYPE}. */ - int FORMAT_SUPPORT_MASK = 0b11; + int FORMAT_SUPPORT_MASK = 0b111; /** * The {@link Renderer} is capable of rendering the format. */ - int FORMAT_HANDLED = 0b11; + int FORMAT_HANDLED = 0b100; /** * The {@link Renderer} is capable of rendering formats with the same mime type, but the * properties of the format exceed the renderer's capability. @@ -40,7 +40,16 @@ public interface RendererCapabilities { * {@link MimeTypes#VIDEO_H264}, but the format's resolution exceeds the maximum limit supported * by the underlying H264 decoder. */ - int FORMAT_EXCEEDS_CAPABILITIES = 0b10; + int FORMAT_EXCEEDS_CAPABILITIES = 0b011; + /** + * The {@link Renderer} is capable of rendering formats with the same mime type, but the + * drm scheme used is not supported. + *
+ * Example: The {@link Renderer} is capable of rendering H264 and the format's mime type is
+ * {@link MimeTypes#VIDEO_H264}, but the format indicates cbcs encryption, which is not supported
+ * by the underlying content decryption module.
+ */
+ int FORMAT_UNSUPPORTED_DRM = 0b010;
/**
* The {@link Renderer} is a general purpose renderer for formats of the same top-level type,
* but is not capable of rendering the format or any other format with the same mime type because
@@ -49,7 +58,7 @@ public interface RendererCapabilities {
* Example: The {@link Renderer} is a general purpose audio renderer and the format's
* mime type matches audio/[subtype], but there does not exist a suitable decoder for [subtype].
*/
- int FORMAT_UNSUPPORTED_SUBTYPE = 0b01;
+ int FORMAT_UNSUPPORTED_SUBTYPE = 0b001;
/**
* The {@link Renderer} is not capable of rendering the format, either because it does not
* support the format's top-level type, or because it's a specialized renderer for a different
@@ -58,40 +67,40 @@ public interface RendererCapabilities {
* Example: The {@link Renderer} is a general purpose video renderer, but the format has an
* audio mime type.
*/
- int FORMAT_UNSUPPORTED_TYPE = 0b00;
+ int FORMAT_UNSUPPORTED_TYPE = 0b000;
/**
* A mask to apply to the result of {@link #supportsFormat(Format)} to obtain one of
* {@link #ADAPTIVE_SEAMLESS}, {@link #ADAPTIVE_NOT_SEAMLESS} and {@link #ADAPTIVE_NOT_SUPPORTED}.
*/
- int ADAPTIVE_SUPPORT_MASK = 0b1100;
+ int ADAPTIVE_SUPPORT_MASK = 0b11000;
/**
* The {@link Renderer} can seamlessly adapt between formats.
*/
- int ADAPTIVE_SEAMLESS = 0b1000;
+ int ADAPTIVE_SEAMLESS = 0b10000;
/**
* The {@link Renderer} can adapt between formats, but may suffer a brief discontinuity
* (~50-100ms) when adaptation occurs.
*/
- int ADAPTIVE_NOT_SEAMLESS = 0b0100;
+ int ADAPTIVE_NOT_SEAMLESS = 0b01000;
/**
* The {@link Renderer} does not support adaptation between formats.
*/
- int ADAPTIVE_NOT_SUPPORTED = 0b0000;
+ int ADAPTIVE_NOT_SUPPORTED = 0b00000;
/**
* A mask to apply to the result of {@link #supportsFormat(Format)} to obtain one of
* {@link #TUNNELING_SUPPORTED} and {@link #TUNNELING_NOT_SUPPORTED}.
*/
- int TUNNELING_SUPPORT_MASK = 0b10000;
+ int TUNNELING_SUPPORT_MASK = 0b100000;
/**
* The {@link Renderer} supports tunneled output.
*/
- int TUNNELING_SUPPORTED = 0b10000;
+ int TUNNELING_SUPPORTED = 0b100000;
/**
* The {@link Renderer} does not support tunneled output.
*/
- int TUNNELING_NOT_SUPPORTED = 0b00000;
+ int TUNNELING_NOT_SUPPORTED = 0b000000;
/**
* Returns the track type that the {@link Renderer} handles. For example, a video renderer will
diff --git a/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java b/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java
index 68eba76b11..cafbe6e8f7 100644
--- a/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java
+++ b/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java
@@ -25,6 +25,7 @@ import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.support.annotation.IntDef;
+import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
@@ -306,6 +307,26 @@ public class DefaultDrmSessionManager