Parse widevine tag in manifest for secure decryption.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=128345063
This commit is contained in:
parent
abcd10513a
commit
1624135c20
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/raw
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/raw
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/raw
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/raw
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 8:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mp4a-latm
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
@ -215,7 +214,6 @@ track 9:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
@ -156,7 +155,6 @@ track 2:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/ac3
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
@ -124,7 +123,6 @@ track 2:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/ac3
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
@ -80,7 +79,6 @@ track 2:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/ac3
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
@ -36,7 +35,6 @@ track 2:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/ac3
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mpeg
|
||||
maxInputSize = 4096
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mpeg
|
||||
maxInputSize = 4096
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mpeg
|
||||
maxInputSize = 4096
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mpeg
|
||||
maxInputSize = 4096
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = 36722
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
@ -156,7 +155,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mp4a-latm
|
||||
maxInputSize = 294
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = 36722
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
@ -156,7 +155,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mp4a-latm
|
||||
maxInputSize = 294
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = 36722
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
@ -156,7 +155,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mp4a-latm
|
||||
maxInputSize = 294
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = 36722
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
@ -156,7 +155,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mp4a-latm
|
||||
maxInputSize = 294
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/avc
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = 1080
|
||||
height = 720
|
||||
frameRate = -1.0
|
||||
@ -156,7 +155,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mp4a-latm
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/opus
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/opus
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/opus
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/opus
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/opus
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/x-flac
|
||||
maxInputSize = 768000
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/vorbis
|
||||
maxInputSize = 65025
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/vorbis
|
||||
maxInputSize = 65025
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/vorbis
|
||||
maxInputSize = 65025
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/vorbis
|
||||
maxInputSize = 65025
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/vorbis
|
||||
maxInputSize = 65025
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mp4a-latm
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
@ -611,7 +610,6 @@ track 1:
|
||||
containerMimeType = null
|
||||
sampleMimeType = application/id3
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 192:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mpeg-L2
|
||||
maxInputSize = 4096
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
@ -50,7 +49,6 @@ track 224:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/mpeg2
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = 640
|
||||
height = 426
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 2:
|
||||
containerMimeType = null
|
||||
sampleMimeType = video/mpeg2
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = 640
|
||||
height = 426
|
||||
frameRate = -1.0
|
||||
@ -43,7 +42,6 @@ track 3:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/mpeg-L2
|
||||
maxInputSize = 4096
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
@ -83,7 +81,6 @@ track 21:
|
||||
containerMimeType = null
|
||||
sampleMimeType = application/id3
|
||||
maxInputSize = -1
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/raw
|
||||
maxInputSize = 32768
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/raw
|
||||
maxInputSize = 32768
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/raw
|
||||
maxInputSize = 32768
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -10,7 +10,6 @@ track 0:
|
||||
containerMimeType = null
|
||||
sampleMimeType = audio/raw
|
||||
maxInputSize = 32768
|
||||
requiresSecureDecryption = false
|
||||
width = -1
|
||||
height = -1
|
||||
frameRate = -1.0
|
||||
|
@ -61,7 +61,7 @@ public final class FormatTest extends TestCase {
|
||||
|
||||
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",
|
||||
Format.OFFSET_SAMPLE_RELATIVE, INIT_DATA, drmInitData, false);
|
||||
Format.OFFSET_SAMPLE_RELATIVE, INIT_DATA, drmInitData);
|
||||
|
||||
Parcel parcel = Parcel.obtain();
|
||||
formatToParcel.writeToParcel(parcel, 0);
|
||||
|
@ -104,10 +104,6 @@ public final class Format implements Parcelable {
|
||||
* not applicable.
|
||||
*/
|
||||
public final int maxInputSize;
|
||||
/**
|
||||
* Whether the decoder is required to support secure decryption.
|
||||
*/
|
||||
public final boolean requiresSecureDecryption;
|
||||
/**
|
||||
* Initialization data that must be provided to the decoder. Will not be null, but may be empty
|
||||
* if initialization data is not required.
|
||||
@ -203,7 +199,7 @@ public final class Format implements Parcelable {
|
||||
float frameRate, List<byte[]> initializationData) {
|
||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, NO_VALUE, width,
|
||||
height, frameRate, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, 0,
|
||||
null, OFFSET_SAMPLE_RELATIVE, initializationData, null, false);
|
||||
null, OFFSET_SAMPLE_RELATIVE, initializationData, null);
|
||||
}
|
||||
|
||||
public static Format createVideoSampleFormat(String id, String sampleMimeType, String codecs,
|
||||
@ -219,7 +215,7 @@ public final class Format implements Parcelable {
|
||||
DrmInitData drmInitData) {
|
||||
return new Format(id, null, sampleMimeType, codecs, bitrate, maxInputSize, width, height,
|
||||
frameRate, rotationDegrees, pixelWidthHeightRatio, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, 0, null, OFFSET_SAMPLE_RELATIVE, initializationData, drmInitData, false);
|
||||
NO_VALUE, 0, null, OFFSET_SAMPLE_RELATIVE, initializationData, drmInitData);
|
||||
}
|
||||
|
||||
// Audio.
|
||||
@ -229,8 +225,7 @@ public final class Format implements Parcelable {
|
||||
List<byte[]> initializationData, int selectionFlags, String language) {
|
||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, channelCount, sampleRate, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, selectionFlags, language, OFFSET_SAMPLE_RELATIVE, initializationData, null,
|
||||
false);
|
||||
NO_VALUE, selectionFlags, language, OFFSET_SAMPLE_RELATIVE, initializationData, null);
|
||||
}
|
||||
|
||||
public static Format createAudioSampleFormat(String id, String sampleMimeType, String codecs,
|
||||
@ -257,7 +252,7 @@ public final class Format implements Parcelable {
|
||||
return new Format(id, null, sampleMimeType, codecs, bitrate, maxInputSize, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, channelCount, sampleRate, pcmEncoding, encoderDelay,
|
||||
encoderPadding, selectionFlags, language, OFFSET_SAMPLE_RELATIVE, initializationData,
|
||||
drmInitData, false);
|
||||
drmInitData);
|
||||
}
|
||||
|
||||
// Text.
|
||||
@ -266,7 +261,7 @@ public final class Format implements Parcelable {
|
||||
String sampleMimeType, String codecs, int bitrate, int selectionFlags, String language) {
|
||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE,
|
||||
selectionFlags, language, OFFSET_SAMPLE_RELATIVE, null, null, false);
|
||||
selectionFlags, language, OFFSET_SAMPLE_RELATIVE, null, null);
|
||||
}
|
||||
|
||||
public static Format createTextSampleFormat(String id, String sampleMimeType, String codecs,
|
||||
@ -280,7 +275,7 @@ public final class Format implements Parcelable {
|
||||
long subsampleOffsetUs) {
|
||||
return new Format(id, null, sampleMimeType, codecs, bitrate, NO_VALUE, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE,
|
||||
selectionFlags, language, subsampleOffsetUs, null, drmInitData, false);
|
||||
selectionFlags, language, subsampleOffsetUs, null, drmInitData);
|
||||
}
|
||||
|
||||
// Image.
|
||||
@ -289,7 +284,7 @@ public final class Format implements Parcelable {
|
||||
int bitrate, List<byte[]> initializationData, String language, DrmInitData drmInitData) {
|
||||
return new Format(id, null, sampleMimeType, codecs, bitrate, NO_VALUE, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, 0, language,
|
||||
OFFSET_SAMPLE_RELATIVE, initializationData, drmInitData, false);
|
||||
OFFSET_SAMPLE_RELATIVE, initializationData, drmInitData);
|
||||
}
|
||||
|
||||
// Generic.
|
||||
@ -298,22 +293,21 @@ public final class Format implements Parcelable {
|
||||
String sampleMimeType, int bitrate) {
|
||||
return new Format(id, containerMimeType, sampleMimeType, null, bitrate, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE,
|
||||
0, null, OFFSET_SAMPLE_RELATIVE, null, null, false);
|
||||
0, null, OFFSET_SAMPLE_RELATIVE, null, null);
|
||||
}
|
||||
|
||||
public static Format createSampleFormat(String id, String sampleMimeType, String codecs,
|
||||
int bitrate, DrmInitData drmInitData) {
|
||||
return new Format(id, null, sampleMimeType, codecs, bitrate, NO_VALUE, NO_VALUE, NO_VALUE,
|
||||
NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, 0, null,
|
||||
OFFSET_SAMPLE_RELATIVE, null, drmInitData, false);
|
||||
OFFSET_SAMPLE_RELATIVE, null, drmInitData);
|
||||
}
|
||||
|
||||
/* package */ Format(String id, String containerMimeType, String sampleMimeType, String codecs,
|
||||
int bitrate, int maxInputSize, int width, int height, float frameRate, int rotationDegrees,
|
||||
float pixelWidthHeightRatio, int channelCount, int sampleRate, int pcmEncoding,
|
||||
int encoderDelay, int encoderPadding, int selectionFlags, String language,
|
||||
long subsampleOffsetUs, List<byte[]> initializationData, DrmInitData drmInitData,
|
||||
boolean requiresSecureDecryption) {
|
||||
long subsampleOffsetUs, List<byte[]> initializationData, DrmInitData drmInitData) {
|
||||
this.id = id;
|
||||
this.containerMimeType = containerMimeType;
|
||||
this.sampleMimeType = sampleMimeType;
|
||||
@ -336,7 +330,6 @@ public final class Format implements Parcelable {
|
||||
this.initializationData = initializationData == null ? Collections.<byte[]>emptyList()
|
||||
: initializationData;
|
||||
this.drmInitData = drmInitData;
|
||||
this.requiresSecureDecryption = requiresSecureDecryption;
|
||||
}
|
||||
|
||||
/* package */ Format(Parcel in) {
|
||||
@ -365,21 +358,20 @@ public final class Format implements Parcelable {
|
||||
initializationData.add(in.createByteArray());
|
||||
}
|
||||
drmInitData = in.readParcelable(DrmInitData.class.getClassLoader());
|
||||
requiresSecureDecryption = in.readInt() == 1;
|
||||
}
|
||||
|
||||
public Format copyWithMaxInputSize(int maxInputSize) {
|
||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize,
|
||||
width, height, frameRate, rotationDegrees, pixelWidthHeightRatio, channelCount, sampleRate,
|
||||
pcmEncoding, encoderDelay, encoderPadding, selectionFlags, language, subsampleOffsetUs,
|
||||
initializationData, drmInitData, requiresSecureDecryption);
|
||||
initializationData, drmInitData);
|
||||
}
|
||||
|
||||
public Format copyWithSubsampleOffsetUs(long subsampleOffsetUs) {
|
||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize,
|
||||
width, height, frameRate, rotationDegrees, pixelWidthHeightRatio, channelCount, sampleRate,
|
||||
pcmEncoding, encoderDelay, encoderPadding, selectionFlags, language, subsampleOffsetUs,
|
||||
initializationData, drmInitData, requiresSecureDecryption);
|
||||
initializationData, drmInitData);
|
||||
}
|
||||
|
||||
public Format copyWithContainerInfo(String id, int bitrate, int width, int height,
|
||||
@ -387,7 +379,7 @@ public final class Format implements Parcelable {
|
||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize,
|
||||
width, height, frameRate, rotationDegrees, pixelWidthHeightRatio, channelCount, sampleRate,
|
||||
pcmEncoding, encoderDelay, encoderPadding, selectionFlags, language, subsampleOffsetUs,
|
||||
initializationData, drmInitData, requiresSecureDecryption);
|
||||
initializationData, drmInitData);
|
||||
}
|
||||
|
||||
public Format copyWithManifestFormatInfo(Format manifestFormat,
|
||||
@ -400,26 +392,24 @@ public final class Format implements Parcelable {
|
||||
String language = this.language == null ? manifestFormat.language : this.language;
|
||||
DrmInitData drmInitData = (preferManifestDrmInitData && manifestFormat.drmInitData != null)
|
||||
|| this.drmInitData == null ? manifestFormat.drmInitData : this.drmInitData;
|
||||
boolean requiresSecureDecryption = this.requiresSecureDecryption
|
||||
|| manifestFormat.requiresSecureDecryption;
|
||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize, width,
|
||||
height, frameRate, rotationDegrees, pixelWidthHeightRatio, channelCount, sampleRate,
|
||||
pcmEncoding, encoderDelay, encoderPadding, selectionFlags, language, subsampleOffsetUs,
|
||||
initializationData, drmInitData, requiresSecureDecryption);
|
||||
initializationData, drmInitData);
|
||||
}
|
||||
|
||||
public Format copyWithGaplessInfo(int encoderDelay, int encoderPadding) {
|
||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize,
|
||||
width, height, frameRate, rotationDegrees, pixelWidthHeightRatio, channelCount, sampleRate,
|
||||
pcmEncoding, encoderDelay, encoderPadding, selectionFlags, language, subsampleOffsetUs,
|
||||
initializationData, drmInitData, requiresSecureDecryption);
|
||||
initializationData, drmInitData);
|
||||
}
|
||||
|
||||
public Format copyWithDrmInitData(DrmInitData drmInitData) {
|
||||
return new Format(id, containerMimeType, sampleMimeType, codecs, bitrate, maxInputSize,
|
||||
width, height, frameRate, rotationDegrees, pixelWidthHeightRatio, channelCount, sampleRate,
|
||||
pcmEncoding, encoderDelay, encoderPadding, selectionFlags, language, subsampleOffsetUs,
|
||||
initializationData, drmInitData, requiresSecureDecryption);
|
||||
initializationData, drmInitData);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -486,7 +476,6 @@ public final class Format implements Parcelable {
|
||||
}
|
||||
Format other = (Format) obj;
|
||||
if (bitrate != other.bitrate || maxInputSize != other.maxInputSize
|
||||
|| requiresSecureDecryption != other.requiresSecureDecryption
|
||||
|| width != other.width || height != other.height || frameRate != other.frameRate
|
||||
|| rotationDegrees != other.rotationDegrees
|
||||
|| pixelWidthHeightRatio != other.pixelWidthHeightRatio
|
||||
@ -565,7 +554,6 @@ public final class Format implements Parcelable {
|
||||
dest.writeByteArray(initializationData.get(i));
|
||||
}
|
||||
dest.writeParcelable(drmInitData, 0);
|
||||
dest.writeInt(requiresSecureDecryption ? 1 : 0);
|
||||
}
|
||||
|
||||
public static final Creator<Format> CREATOR = new Creator<Format>() {
|
||||
|
@ -148,8 +148,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
|
||||
if (allowPassthrough(mimeType) && mediaCodecSelector.getPassthroughDecoderInfo() != null) {
|
||||
return ADAPTIVE_NOT_SEAMLESS | FORMAT_HANDLED;
|
||||
}
|
||||
MediaCodecInfo decoderInfo = mediaCodecSelector.getDecoderInfo(mimeType,
|
||||
format.requiresSecureDecryption);
|
||||
MediaCodecInfo decoderInfo = mediaCodecSelector.getDecoderInfo(mimeType, false);
|
||||
if (decoderInfo == null) {
|
||||
return FORMAT_UNSUPPORTED_SUBTYPE;
|
||||
}
|
||||
|
@ -38,6 +38,11 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
||||
// Lazily initialized hashcode.
|
||||
private int hashCode;
|
||||
|
||||
/**
|
||||
* Number of {@link SchemeData}s.
|
||||
*/
|
||||
public final int schemeDataCount;
|
||||
|
||||
/**
|
||||
* @param schemeDatas Scheme initialization data for possibly multiple DRM schemes.
|
||||
*/
|
||||
@ -66,10 +71,12 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
||||
}
|
||||
}
|
||||
this.schemeDatas = schemeDatas;
|
||||
schemeDataCount = schemeDatas.length;
|
||||
}
|
||||
|
||||
/* package */ DrmInitData(Parcel in) {
|
||||
schemeDatas = in.createTypedArray(SchemeData.CREATOR);
|
||||
schemeDataCount = schemeDatas.length;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -87,6 +94,16 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
||||
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
|
||||
public int hashCode() {
|
||||
if (hashCode == 0) {
|
||||
@ -160,6 +177,10 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
||||
* The initialization 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
|
||||
@ -168,15 +189,28 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
||||
* @param data The initialization 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.mimeType = Assertions.checkNotNull(mimeType);
|
||||
this.data = Assertions.checkNotNull(data);
|
||||
this.requiresSecureDecryption = requiresSecureDecryption;
|
||||
}
|
||||
|
||||
/* package */ SchemeData(Parcel in) {
|
||||
uuid = new UUID(in.readLong(), in.readLong());
|
||||
mimeType = in.readString();
|
||||
data = in.createByteArray();
|
||||
requiresSecureDecryption = in.readByte() != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -226,6 +260,7 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
||||
dest.writeLong(uuid.getLeastSignificantBits());
|
||||
dest.writeString(mimeType);
|
||||
dest.writeByteArray(data);
|
||||
dest.writeByte((byte) (requiresSecureDecryption ? 1 : 0));
|
||||
}
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
|
@ -315,25 +315,30 @@ public class DashManifestParser extends DefaultHandler
|
||||
**/
|
||||
protected SchemeData parseContentProtection(XmlPullParser xpp)
|
||||
throws XmlPullParserException, IOException {
|
||||
SchemeData schemeData = null;
|
||||
byte[] data = null;
|
||||
UUID uuid = null;
|
||||
boolean seenPsshElement = false;
|
||||
boolean requiresSecureDecoder = false;
|
||||
do {
|
||||
xpp.next();
|
||||
// The cenc:pssh element is defined in 23001-7:2015.
|
||||
if (XmlPullParserUtil.isStartTag(xpp, "cenc:pssh") && xpp.next() == XmlPullParser.TEXT) {
|
||||
seenPsshElement = true;
|
||||
byte[] data = Base64.decode(xpp.getText(), Base64.DEFAULT);
|
||||
UUID uuid = PsshAtomUtil.parseUuid(data);
|
||||
if (uuid != null) {
|
||||
schemeData = new SchemeData(uuid, MimeTypes.VIDEO_MP4, data);
|
||||
}
|
||||
data = Base64.decode(xpp.getText(), Base64.DEFAULT);
|
||||
uuid = PsshAtomUtil.parseUuid(data);
|
||||
} else if (XmlPullParserUtil.isStartTag(xpp, "widevine:license")) {
|
||||
String robustnessLevel = xpp.getAttributeValue(null, "robustness_level");
|
||||
requiresSecureDecoder = robustnessLevel != null && robustnessLevel.startsWith("HW");
|
||||
}
|
||||
} 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");
|
||||
return null;
|
||||
}
|
||||
return schemeData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -18,6 +18,7 @@ package com.google.android.exoplayer2.video;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
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.mediacodec.MediaCodecInfo;
|
||||
import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer;
|
||||
@ -175,8 +176,13 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||
if (!MimeTypes.isVideo(mimeType)) {
|
||||
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,
|
||||
format.requiresSecureDecryption);
|
||||
requiresSecureDecryption);
|
||||
if (decoderInfo == null) {
|
||||
return FORMAT_UNSUPPORTED_SUBTYPE;
|
||||
}
|
||||
|
@ -145,7 +145,6 @@ public final class FakeTrackOutput implements TrackOutput, Dumper.Dumpable {
|
||||
.add("containerMimeType", format.containerMimeType)
|
||||
.add("sampleMimeType", format.sampleMimeType)
|
||||
.add("maxInputSize", format.maxInputSize)
|
||||
.add("requiresSecureDecryption", format.requiresSecureDecryption)
|
||||
.add("width", format.width)
|
||||
.add("height", format.height)
|
||||
.add("frameRate", format.frameRate)
|
||||
|
Loading…
x
Reference in New Issue
Block a user