Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e0f7a124
authored
Feb 22, 2017
by
wasabeef
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Added support for CENC ClearKey
parent
6a844ebc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
0 deletions
demo/src/main/assets/media.exolist.json
demo/src/main/java/com/google/android/exoplayer2/demo/SampleChooserActivity.java
library/src/main/java/com/google/android/exoplayer2/C.java
library/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java
demo/src/main/assets/media.exolist.json
View file @
e0f7a124
...
@@ -278,6 +278,18 @@
...
@@ -278,6 +278,18 @@
]
]
},
},
{
{
"name"
:
"ClearKey DASH"
,
"samples"
:
[
{
"name"
:
"Big Buck Bunny (CENC ClearKey)"
,
"uri"
:
"http://html5.cablelabs.com:8100/cenc/ck/dash.mpd"
,
"extension"
:
"mpd"
,
"drm_scheme"
:
"cenc"
,
"drm_license_url"
:
"https://wasabeef.jp/demos/cenc-ck-dash.json"
}
]
},
{
"name"
:
"SmoothStreaming"
,
"name"
:
"SmoothStreaming"
,
"samples"
:
[
"samples"
:
[
{
{
...
...
demo/src/main/java/com/google/android/exoplayer2/demo/SampleChooserActivity.java
View file @
e0f7a124
...
@@ -267,6 +267,8 @@ public class SampleChooserActivity extends Activity {
...
@@ -267,6 +267,8 @@ public class SampleChooserActivity extends Activity {
return
C
.
WIDEVINE_UUID
;
return
C
.
WIDEVINE_UUID
;
case
"playready"
:
case
"playready"
:
return
C
.
PLAYREADY_UUID
;
return
C
.
PLAYREADY_UUID
;
case
"cenc"
:
return
C
.
CENC_UUID
;
default
:
default
:
try
{
try
{
return
UUID
.
fromString
(
typeString
);
return
UUID
.
fromString
(
typeString
);
...
...
library/src/main/java/com/google/android/exoplayer2/C.java
View file @
e0f7a124
...
@@ -444,6 +444,12 @@ public final class C {
...
@@ -444,6 +444,12 @@ public final class C {
public
static
final
UUID
UUID_NIL
=
new
UUID
(
0L
,
0L
);
public
static
final
UUID
UUID_NIL
=
new
UUID
(
0L
,
0L
);
/**
/**
* UUID for the PSSH box and MPEG-DASH Content Protection.
* <a href="https://w3c.github.io/encrypted-media/format-registry/initdata/cenc.html">W3C</a>.
*/
public
static
final
UUID
CENC_UUID
=
new
UUID
(
0x1077EFECC0B24D02
L
,
0xACE33C1E52E2FB4B
L
);
/**
* UUID for the Widevine DRM scheme.
* UUID for the Widevine DRM scheme.
* <p></p>
* <p></p>
* Widevine is supported on Android devices running Android 4.3 (API Level 18) and up.
* Widevine is supported on Android devices running Android 4.3 (API Level 18) and up.
...
...
library/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSessionManager.java
View file @
e0f7a124
...
@@ -35,6 +35,7 @@ import com.google.android.exoplayer2.drm.ExoMediaDrm.OnEventListener;
...
@@ -35,6 +35,7 @@ import com.google.android.exoplayer2.drm.ExoMediaDrm.OnEventListener;
import
com.google.android.exoplayer2.drm.ExoMediaDrm.ProvisionRequest
;
import
com.google.android.exoplayer2.drm.ExoMediaDrm.ProvisionRequest
;
import
com.google.android.exoplayer2.extractor.mp4.PsshAtomUtil
;
import
com.google.android.exoplayer2.extractor.mp4.PsshAtomUtil
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.RetentionPolicy
;
...
@@ -102,6 +103,11 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
...
@@ -102,6 +103,11 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
/** Releases an existing offline license. */
/** Releases an existing offline license. */
public
static
final
int
MODE_RELEASE
=
3
;
public
static
final
int
MODE_RELEASE
=
3
;
/**
* The format to use when ClearKey encryption.
*/
private
static
final
String
CENC_INIT_DATA_FORMAT
=
"cenc"
;
private
static
final
String
TAG
=
"OfflineDrmSessionMngr"
;
private
static
final
String
TAG
=
"OfflineDrmSessionMngr"
;
private
static
final
int
MSG_PROVISION
=
0
;
private
static
final
int
MSG_PROVISION
=
0
;
...
@@ -337,6 +343,21 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
...
@@ -337,6 +343,21 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
schemeInitData
=
psshData
;
schemeInitData
=
psshData
;
}
}
}
}
if
(
C
.
CENC_UUID
.
equals
(
uuid
))
{
// If "video/mp4" and "audio/mp4" are not supported as CENC schema, change it to "cenc".
// Before 7.1.x in API 25, "video/mp4" and "audio/mp4" are not supported.
if
(
MimeTypes
.
VIDEO_MP4
.
equals
(
schemeMimeType
)
||
MimeTypes
.
AUDIO_MP4
.
equals
(
schemeMimeType
))
{
if
(
Util
.
SDK_INT
>=
26
)
{
// Nothing to do.
}
else
if
(
Util
.
SDK_INT
==
25
&&
!
MediaDrm
.
isCryptoSchemeSupported
(
uuid
,
schemeMimeType
))
{
schemeMimeType
=
CENC_INIT_DATA_FORMAT
;
}
else
if
(
Util
.
SDK_INT
<=
24
)
{
schemeMimeType
=
CENC_INIT_DATA_FORMAT
;
}
}
}
}
}
state
=
STATE_OPENING
;
state
=
STATE_OPENING
;
openInternal
(
true
);
openInternal
(
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment