Commit 1624135c by mishragaurav Committed by Oliver Woodman

Parse widevine tag in manifest for secure decryption.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128345063
parent abcd1051
Showing with 73 additions and 100 deletions
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/raw sampleMimeType = audio/raw
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/raw sampleMimeType = audio/raw
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/raw sampleMimeType = audio/raw
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/raw sampleMimeType = audio/raw
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 8: ...@@ -10,7 +10,6 @@ track 8:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
...@@ -215,7 +214,6 @@ track 9: ...@@ -215,7 +214,6 @@ track 9:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 1: ...@@ -10,7 +10,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
...@@ -156,7 +155,6 @@ track 2: ...@@ -156,7 +155,6 @@ track 2:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 1: ...@@ -10,7 +10,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
...@@ -124,7 +123,6 @@ track 2: ...@@ -124,7 +123,6 @@ track 2:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 1: ...@@ -10,7 +10,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
...@@ -80,7 +79,6 @@ track 2: ...@@ -80,7 +79,6 @@ track 2:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 1: ...@@ -10,7 +10,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
...@@ -36,7 +35,6 @@ track 2: ...@@ -36,7 +35,6 @@ track 2:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/ac3 sampleMimeType = audio/ac3
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mpeg sampleMimeType = audio/mpeg
maxInputSize = 4096 maxInputSize = 4096
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mpeg sampleMimeType = audio/mpeg
maxInputSize = 4096 maxInputSize = 4096
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mpeg sampleMimeType = audio/mpeg
maxInputSize = 4096 maxInputSize = 4096
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mpeg sampleMimeType = audio/mpeg
maxInputSize = 4096 maxInputSize = 4096
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = 36722 maxInputSize = 36722
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
...@@ -156,7 +155,6 @@ track 1: ...@@ -156,7 +155,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
maxInputSize = 294 maxInputSize = 294
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = 36722 maxInputSize = 36722
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
...@@ -156,7 +155,6 @@ track 1: ...@@ -156,7 +155,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
maxInputSize = 294 maxInputSize = 294
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = 36722 maxInputSize = 36722
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
...@@ -156,7 +155,6 @@ track 1: ...@@ -156,7 +155,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
maxInputSize = 294 maxInputSize = 294
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = 36722 maxInputSize = 36722
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
...@@ -156,7 +155,6 @@ track 1: ...@@ -156,7 +155,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
maxInputSize = 294 maxInputSize = 294
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = video/avc sampleMimeType = video/avc
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = 1080 width = 1080
height = 720 height = 720
frameRate = -1.0 frameRate = -1.0
...@@ -156,7 +155,6 @@ track 1: ...@@ -156,7 +155,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/opus sampleMimeType = audio/opus
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/opus sampleMimeType = audio/opus
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/opus sampleMimeType = audio/opus
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/opus sampleMimeType = audio/opus
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/opus sampleMimeType = audio/opus
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/x-flac sampleMimeType = audio/x-flac
maxInputSize = 768000 maxInputSize = 768000
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/vorbis sampleMimeType = audio/vorbis
maxInputSize = 65025 maxInputSize = 65025
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/vorbis sampleMimeType = audio/vorbis
maxInputSize = 65025 maxInputSize = 65025
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/vorbis sampleMimeType = audio/vorbis
maxInputSize = 65025 maxInputSize = 65025
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/vorbis sampleMimeType = audio/vorbis
maxInputSize = 65025 maxInputSize = 65025
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/vorbis sampleMimeType = audio/vorbis
maxInputSize = 65025 maxInputSize = 65025
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mp4a-latm sampleMimeType = audio/mp4a-latm
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
...@@ -611,7 +610,6 @@ track 1: ...@@ -611,7 +610,6 @@ track 1:
containerMimeType = null containerMimeType = null
sampleMimeType = application/id3 sampleMimeType = application/id3
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 192: ...@@ -10,7 +10,6 @@ track 192:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mpeg-L2 sampleMimeType = audio/mpeg-L2
maxInputSize = 4096 maxInputSize = 4096
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
...@@ -50,7 +49,6 @@ track 224: ...@@ -50,7 +49,6 @@ track 224:
containerMimeType = null containerMimeType = null
sampleMimeType = video/mpeg2 sampleMimeType = video/mpeg2
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = 640 width = 640
height = 426 height = 426
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 2: ...@@ -10,7 +10,6 @@ track 2:
containerMimeType = null containerMimeType = null
sampleMimeType = video/mpeg2 sampleMimeType = video/mpeg2
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = 640 width = 640
height = 426 height = 426
frameRate = -1.0 frameRate = -1.0
...@@ -43,7 +42,6 @@ track 3: ...@@ -43,7 +42,6 @@ track 3:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/mpeg-L2 sampleMimeType = audio/mpeg-L2
maxInputSize = 4096 maxInputSize = 4096
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
...@@ -83,7 +81,6 @@ track 21: ...@@ -83,7 +81,6 @@ track 21:
containerMimeType = null containerMimeType = null
sampleMimeType = application/id3 sampleMimeType = application/id3
maxInputSize = -1 maxInputSize = -1
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/raw sampleMimeType = audio/raw
maxInputSize = 32768 maxInputSize = 32768
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/raw sampleMimeType = audio/raw
maxInputSize = 32768 maxInputSize = 32768
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/raw sampleMimeType = audio/raw
maxInputSize = 32768 maxInputSize = 32768
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -10,7 +10,6 @@ track 0: ...@@ -10,7 +10,6 @@ track 0:
containerMimeType = null containerMimeType = null
sampleMimeType = audio/raw sampleMimeType = audio/raw
maxInputSize = 32768 maxInputSize = 32768
requiresSecureDecryption = false
width = -1 width = -1
height = -1 height = -1
frameRate = -1.0 frameRate = -1.0
......
...@@ -61,7 +61,7 @@ public final class FormatTest extends TestCase { ...@@ -61,7 +61,7 @@ public final class FormatTest extends TestCase {
Format formatToParcel = new Format("id", MimeTypes.VIDEO_MP4, MimeTypes.VIDEO_H264, null, Format formatToParcel = new Format("id", MimeTypes.VIDEO_MP4, MimeTypes.VIDEO_H264, null,
1024, 2048, 1920, 1080, 24, 90, 2, 6, 44100, C.ENCODING_PCM_24BIT, 1001, 1002, 0, "und", 1024, 2048, 1920, 1080, 24, 90, 2, 6, 44100, C.ENCODING_PCM_24BIT, 1001, 1002, 0, "und",
Format.OFFSET_SAMPLE_RELATIVE, INIT_DATA, drmInitData, false); Format.OFFSET_SAMPLE_RELATIVE, INIT_DATA, drmInitData);
Parcel parcel = Parcel.obtain(); Parcel parcel = Parcel.obtain();
formatToParcel.writeToParcel(parcel, 0); formatToParcel.writeToParcel(parcel, 0);
......
...@@ -148,8 +148,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media ...@@ -148,8 +148,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
if (allowPassthrough(mimeType) && mediaCodecSelector.getPassthroughDecoderInfo() != null) { if (allowPassthrough(mimeType) && mediaCodecSelector.getPassthroughDecoderInfo() != null) {
return ADAPTIVE_NOT_SEAMLESS | FORMAT_HANDLED; return ADAPTIVE_NOT_SEAMLESS | FORMAT_HANDLED;
} }
MediaCodecInfo decoderInfo = mediaCodecSelector.getDecoderInfo(mimeType, MediaCodecInfo decoderInfo = mediaCodecSelector.getDecoderInfo(mimeType, false);
format.requiresSecureDecryption);
if (decoderInfo == null) { if (decoderInfo == null) {
return FORMAT_UNSUPPORTED_SUBTYPE; return FORMAT_UNSUPPORTED_SUBTYPE;
} }
......
...@@ -39,6 +39,11 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable { ...@@ -39,6 +39,11 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
private int hashCode; private int hashCode;
/** /**
* Number of {@link SchemeData}s.
*/
public final int schemeDataCount;
/**
* @param schemeDatas Scheme initialization data for possibly multiple DRM schemes. * @param schemeDatas Scheme initialization data for possibly multiple DRM schemes.
*/ */
public DrmInitData(List<SchemeData> schemeDatas) { public DrmInitData(List<SchemeData> schemeDatas) {
...@@ -66,10 +71,12 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable { ...@@ -66,10 +71,12 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
} }
} }
this.schemeDatas = schemeDatas; this.schemeDatas = schemeDatas;
schemeDataCount = schemeDatas.length;
} }
/* package */ DrmInitData(Parcel in) { /* package */ DrmInitData(Parcel in) {
schemeDatas = in.createTypedArray(SchemeData.CREATOR); schemeDatas = in.createTypedArray(SchemeData.CREATOR);
schemeDataCount = schemeDatas.length;
} }
/** /**
...@@ -87,6 +94,16 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable { ...@@ -87,6 +94,16 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
return null; return null;
} }
/**
* Retrieves the {@link SchemeData} at a given index.
*
* @param index index of the scheme to return.
* @return The {@link SchemeData} at the index.
*/
public SchemeData get(int index) {
return schemeDatas[index];
}
@Override @Override
public int hashCode() { public int hashCode() {
if (hashCode == 0) { if (hashCode == 0) {
...@@ -160,6 +177,10 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable { ...@@ -160,6 +177,10 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
* The initialization data. * The initialization data.
*/ */
public final byte[] data; public final byte[] data;
/**
* Whether secure decryption is required.
*/
public final boolean requiresSecureDecryption;
/** /**
* @param uuid The {@link UUID} of the DRM scheme, or {@link C#UUID_NIL} if the data is * @param uuid The {@link UUID} of the DRM scheme, or {@link C#UUID_NIL} if the data is
...@@ -168,15 +189,28 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable { ...@@ -168,15 +189,28 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
* @param data The initialization data. * @param data The initialization data.
*/ */
public SchemeData(UUID uuid, String mimeType, byte[] data) { public SchemeData(UUID uuid, String mimeType, byte[] data) {
this(uuid, mimeType, data, false);
}
/**
* @param uuid The {@link UUID} of the DRM scheme, or {@link C#UUID_NIL} if the data is
* universal (i.e. applies to all schemes).
* @param mimeType The mimeType of the initialization data.
* @param data The initialization data.
* @param requiresSecureDecryption Whether secure decryption is required.
*/
public SchemeData(UUID uuid, String mimeType, byte[] data, boolean requiresSecureDecryption) {
this.uuid = Assertions.checkNotNull(uuid); this.uuid = Assertions.checkNotNull(uuid);
this.mimeType = Assertions.checkNotNull(mimeType); this.mimeType = Assertions.checkNotNull(mimeType);
this.data = Assertions.checkNotNull(data); this.data = Assertions.checkNotNull(data);
this.requiresSecureDecryption = requiresSecureDecryption;
} }
/* package */ SchemeData(Parcel in) { /* package */ SchemeData(Parcel in) {
uuid = new UUID(in.readLong(), in.readLong()); uuid = new UUID(in.readLong(), in.readLong());
mimeType = in.readString(); mimeType = in.readString();
data = in.createByteArray(); data = in.createByteArray();
requiresSecureDecryption = in.readByte() != 0;
} }
/** /**
...@@ -226,6 +260,7 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable { ...@@ -226,6 +260,7 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
dest.writeLong(uuid.getLeastSignificantBits()); dest.writeLong(uuid.getLeastSignificantBits());
dest.writeString(mimeType); dest.writeString(mimeType);
dest.writeByteArray(data); dest.writeByteArray(data);
dest.writeByte((byte) (requiresSecureDecryption ? 1 : 0));
} }
@SuppressWarnings("hiding") @SuppressWarnings("hiding")
......
...@@ -315,25 +315,30 @@ public class DashManifestParser extends DefaultHandler ...@@ -315,25 +315,30 @@ public class DashManifestParser extends DefaultHandler
**/ **/
protected SchemeData parseContentProtection(XmlPullParser xpp) protected SchemeData parseContentProtection(XmlPullParser xpp)
throws XmlPullParserException, IOException { throws XmlPullParserException, IOException {
SchemeData schemeData = null; byte[] data = null;
UUID uuid = null;
boolean seenPsshElement = false; boolean seenPsshElement = false;
boolean requiresSecureDecoder = false;
do { do {
xpp.next(); xpp.next();
// The cenc:pssh element is defined in 23001-7:2015. // The cenc:pssh element is defined in 23001-7:2015.
if (XmlPullParserUtil.isStartTag(xpp, "cenc:pssh") && xpp.next() == XmlPullParser.TEXT) { if (XmlPullParserUtil.isStartTag(xpp, "cenc:pssh") && xpp.next() == XmlPullParser.TEXT) {
seenPsshElement = true; seenPsshElement = true;
byte[] data = Base64.decode(xpp.getText(), Base64.DEFAULT); data = Base64.decode(xpp.getText(), Base64.DEFAULT);
UUID uuid = PsshAtomUtil.parseUuid(data); uuid = PsshAtomUtil.parseUuid(data);
if (uuid != null) { } else if (XmlPullParserUtil.isStartTag(xpp, "widevine:license")) {
schemeData = new SchemeData(uuid, MimeTypes.VIDEO_MP4, data); String robustnessLevel = xpp.getAttributeValue(null, "robustness_level");
} requiresSecureDecoder = robustnessLevel != null && robustnessLevel.startsWith("HW");
} }
} while (!XmlPullParserUtil.isEndTag(xpp, "ContentProtection")); } while (!XmlPullParserUtil.isEndTag(xpp, "ContentProtection"));
if (seenPsshElement && schemeData == null) { if (!seenPsshElement) {
return null;
} else if (uuid != null) {
return new SchemeData(uuid, MimeTypes.VIDEO_MP4, data, requiresSecureDecoder);
} else {
Log.w(TAG, "Skipped unsupported ContentProtection element"); Log.w(TAG, "Skipped unsupported ContentProtection element");
return null; return null;
} }
return schemeData;
} }
/** /**
......
...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.video; ...@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.video;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlaybackException; import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.drm.DrmInitData;
import com.google.android.exoplayer2.drm.DrmSessionManager; import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.mediacodec.MediaCodecInfo; import com.google.android.exoplayer2.mediacodec.MediaCodecInfo;
import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer; import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer;
...@@ -175,8 +176,13 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -175,8 +176,13 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
if (!MimeTypes.isVideo(mimeType)) { if (!MimeTypes.isVideo(mimeType)) {
return FORMAT_UNSUPPORTED_TYPE; return FORMAT_UNSUPPORTED_TYPE;
} }
DrmInitData drmInitData = format.drmInitData;
boolean requiresSecureDecryption = false;
for (int i = 0; i < drmInitData.schemeDataCount; i++) {
requiresSecureDecryption |= drmInitData.get(i).requiresSecureDecryption;
}
MediaCodecInfo decoderInfo = mediaCodecSelector.getDecoderInfo(mimeType, MediaCodecInfo decoderInfo = mediaCodecSelector.getDecoderInfo(mimeType,
format.requiresSecureDecryption); requiresSecureDecryption);
if (decoderInfo == null) { if (decoderInfo == null) {
return FORMAT_UNSUPPORTED_SUBTYPE; return FORMAT_UNSUPPORTED_SUBTYPE;
} }
......
...@@ -145,7 +145,6 @@ public final class FakeTrackOutput implements TrackOutput, Dumper.Dumpable { ...@@ -145,7 +145,6 @@ public final class FakeTrackOutput implements TrackOutput, Dumper.Dumpable {
.add("containerMimeType", format.containerMimeType) .add("containerMimeType", format.containerMimeType)
.add("sampleMimeType", format.sampleMimeType) .add("sampleMimeType", format.sampleMimeType)
.add("maxInputSize", format.maxInputSize) .add("maxInputSize", format.maxInputSize)
.add("requiresSecureDecryption", format.requiresSecureDecryption)
.add("width", format.width) .add("width", format.width)
.add("height", format.height) .add("height", format.height)
.add("frameRate", format.frameRate) .add("frameRate", format.frameRate)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment