mirror of
https://github.com/androidx/media.git
synced 2025-05-18 04:59:54 +08:00
Support VPx in ISO-BMFF (MP4) Container
Netflix created a spec to encapsulate VPx codecs in ISO-BMFF (MP4) Container [1]. This CL adds support for VP8 and VP9 video codecs in the MP4 container. [1] https://github.com/Netflix/vp9-dash/blob/master/Downloads/VPCodecISOMediaFileFormatBinding.pdf ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=123160650
This commit is contained in:
parent
ced7de15a9
commit
9609302b3d
@ -271,6 +271,8 @@ import java.util.UUID;
|
||||
"https://storage.googleapis.com/exoplayer-test-media-1/ogg/play.ogg", Util.TYPE_OTHER),
|
||||
Sample.newSample("Google Glass (WebM Video with Vorbis Audio)",
|
||||
"http://demos.webmproject.org/exoplayer/glass_vp9_vorbis.webm", Util.TYPE_OTHER),
|
||||
Sample.newSample("Google Glass (VP9 in MP4/ISO-BMFF)",
|
||||
"http://demos.webmproject.org/exoplayer/glass.mp4", Util.TYPE_OTHER),
|
||||
Sample.newSample("Google Glass DASH - VP9 and Opus",
|
||||
"http://demos.webmproject.org/dash/201410/vp9_glass/manifest_vp9_opus.mpd",
|
||||
Util.TYPE_DASH),
|
||||
|
@ -123,6 +123,9 @@ import java.util.List;
|
||||
public static final int TYPE_mean = Util.getIntegerCodeForString("mean");
|
||||
public static final int TYPE_name = Util.getIntegerCodeForString("name");
|
||||
public static final int TYPE_data = Util.getIntegerCodeForString("data");
|
||||
public static final int TYPE_vp08 = Util.getIntegerCodeForString("vp08");
|
||||
public static final int TYPE_vp09 = Util.getIntegerCodeForString("vp09");
|
||||
public static final int TYPE_vpcC = Util.getIntegerCodeForString("vpcC");
|
||||
public static final int TYPE_DASHES = Util.getIntegerCodeForString("----");
|
||||
|
||||
public final int type;
|
||||
|
@ -589,9 +589,10 @@ import java.util.List;
|
||||
if (childAtomType == Atom.TYPE_avc1 || childAtomType == Atom.TYPE_avc3
|
||||
|| childAtomType == Atom.TYPE_encv || childAtomType == Atom.TYPE_mp4v
|
||||
|| childAtomType == Atom.TYPE_hvc1 || childAtomType == Atom.TYPE_hev1
|
||||
|| childAtomType == Atom.TYPE_s263) {
|
||||
parseVideoSampleEntry(stsd, childStartPosition, childAtomSize, trackId, rotationDegrees,
|
||||
drmInitData, out, i);
|
||||
|| childAtomType == Atom.TYPE_s263 || childAtomType == Atom.TYPE_vp08
|
||||
|| childAtomType == Atom.TYPE_vp09) {
|
||||
parseVideoSampleEntry(stsd, childAtomType, childStartPosition, childAtomSize, trackId,
|
||||
rotationDegrees, drmInitData, out, i);
|
||||
} else if (childAtomType == Atom.TYPE_mp4a || childAtomType == Atom.TYPE_enca
|
||||
|| childAtomType == Atom.TYPE_ac_3 || childAtomType == Atom.TYPE_ec_3
|
||||
|| childAtomType == Atom.TYPE_dtsc || childAtomType == Atom.TYPE_dtse
|
||||
@ -619,8 +620,9 @@ import java.util.List;
|
||||
return out;
|
||||
}
|
||||
|
||||
private static void parseVideoSampleEntry(ParsableByteArray parent, int position, int size,
|
||||
int trackId, int rotationDegrees, DrmInitData drmInitData, StsdData out, int entryIndex) {
|
||||
private static void parseVideoSampleEntry(ParsableByteArray parent, int atomType, int position,
|
||||
int size, int trackId, int rotationDegrees, DrmInitData drmInitData, StsdData out,
|
||||
int entryIndex) {
|
||||
parent.setPosition(position + Atom.HEADER_SIZE);
|
||||
|
||||
parent.skipBytes(24);
|
||||
@ -673,6 +675,9 @@ import java.util.List;
|
||||
} else if (childAtomType == Atom.TYPE_pasp) {
|
||||
pixelWidthHeightRatio = parsePaspFromParent(parent, childStartPosition);
|
||||
pixelWidthHeightRatioFromPasp = true;
|
||||
} else if (childAtomType == Atom.TYPE_vpcC) {
|
||||
Assertions.checkState(mimeType == null);
|
||||
mimeType = (atomType == Atom.TYPE_vp08) ? MimeTypes.VIDEO_VP8 : MimeTypes.VIDEO_VP9;
|
||||
}
|
||||
childPosition += childAtomSize;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user