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
7e02e58e
authored
Feb 23, 2017
by
ojw28
Committed by
GitHub
Feb 23, 2017
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #2372 from wasabeef/dev-v2-cenc-clearkey
Added support for CENC ClearKey
parents
3fc3349e
e0f7a124
Hide 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 @
7e02e58e
...
...
@@ -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"
,
"samples"
:
[
{
...
...
demo/src/main/java/com/google/android/exoplayer2/demo/SampleChooserActivity.java
View file @
7e02e58e
...
...
@@ -267,6 +267,8 @@ public class SampleChooserActivity extends Activity {
return
C
.
WIDEVINE_UUID
;
case
"playready"
:
return
C
.
PLAYREADY_UUID
;
case
"cenc"
:
return
C
.
CENC_UUID
;
default
:
try
{
return
UUID
.
fromString
(
typeString
);
...
...
library/src/main/java/com/google/android/exoplayer2/C.java
View file @
7e02e58e
...
...
@@ -444,6 +444,12 @@ public final class C {
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.
* <p></p>
* 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 @
7e02e58e
...
...
@@ -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.extractor.mp4.PsshAtomUtil
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.Util
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
...
...
@@ -102,6 +103,11 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
/** Releases an existing offline license. */
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
int
MSG_PROVISION
=
0
;
...
...
@@ -339,6 +345,21 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
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
;
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