Replace runtime lookups of string integer codes
Make these values compile-time constants, which can be inlined. PiperOrigin-RevId: 249327464
This commit is contained in:
parent
8669d6dc10
commit
21be284318
@ -23,13 +23,13 @@ import com.google.android.exoplayer2.util.Util;
|
||||
public final class WavUtil {
|
||||
|
||||
/** Four character code for "RIFF". */
|
||||
public static final int RIFF_FOURCC = Util.getIntegerCodeForString("RIFF");
|
||||
public static final int RIFF_FOURCC = 0x52494646;
|
||||
/** Four character code for "WAVE". */
|
||||
public static final int WAVE_FOURCC = Util.getIntegerCodeForString("WAVE");
|
||||
public static final int WAVE_FOURCC = 0x57415645;
|
||||
/** Four character code for "fmt ". */
|
||||
public static final int FMT_FOURCC = Util.getIntegerCodeForString("fmt ");
|
||||
public static final int FMT_FOURCC = 0x666d7420;
|
||||
/** Four character code for "data". */
|
||||
public static final int DATA_FOURCC = Util.getIntegerCodeForString("data");
|
||||
public static final int DATA_FOURCC = 0x64617461;
|
||||
|
||||
/** WAVE type value for integer PCM audio data. */
|
||||
private static final int TYPE_PCM = 0x0001;
|
||||
|
@ -24,7 +24,6 @@ import com.google.android.exoplayer2.extractor.ExtractorsFactory;
|
||||
import com.google.android.exoplayer2.extractor.PositionHolder;
|
||||
import com.google.android.exoplayer2.extractor.SeekMap;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
@ -64,7 +63,7 @@ public final class FlvExtractor implements Extractor {
|
||||
private static final int TAG_TYPE_SCRIPT_DATA = 18;
|
||||
|
||||
// FLV container identifier.
|
||||
private static final int FLV_TAG = Util.getIntegerCodeForString("FLV");
|
||||
private static final int FLV_TAG = 0x00464c56;
|
||||
|
||||
private final ParsableByteArray scratch;
|
||||
private final ParsableByteArray headerBuffer;
|
||||
|
@ -35,7 +35,6 @@ import com.google.android.exoplayer2.metadata.id3.Id3Decoder;
|
||||
import com.google.android.exoplayer2.metadata.id3.Id3Decoder.FramePredicate;
|
||||
import com.google.android.exoplayer2.metadata.id3.MlltFrame;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Documented;
|
||||
@ -95,9 +94,9 @@ public final class Mp3Extractor implements Extractor {
|
||||
*/
|
||||
private static final int MPEG_AUDIO_HEADER_MASK = 0xFFFE0C00;
|
||||
|
||||
private static final int SEEK_HEADER_XING = Util.getIntegerCodeForString("Xing");
|
||||
private static final int SEEK_HEADER_INFO = Util.getIntegerCodeForString("Info");
|
||||
private static final int SEEK_HEADER_VBRI = Util.getIntegerCodeForString("VBRI");
|
||||
private static final int SEEK_HEADER_XING = 0x58696e67;
|
||||
private static final int SEEK_HEADER_INFO = 0x496e666f;
|
||||
private static final int SEEK_HEADER_VBRI = 0x56425249;
|
||||
private static final int SEEK_HEADER_UNSET = 0;
|
||||
|
||||
@Flags private final int flags;
|
||||
|
@ -17,7 +17,6 @@ package com.google.android.exoplayer2.extractor.mp4;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@ -51,334 +50,334 @@ import java.util.List;
|
||||
public static final int EXTENDS_TO_END_SIZE = 0;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_ftyp = Util.getIntegerCodeForString("ftyp");
|
||||
public static final int TYPE_ftyp = 0x66747970;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_avc1 = Util.getIntegerCodeForString("avc1");
|
||||
public static final int TYPE_avc1 = 0x61766331;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_avc3 = Util.getIntegerCodeForString("avc3");
|
||||
public static final int TYPE_avc3 = 0x61766333;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_avcC = Util.getIntegerCodeForString("avcC");
|
||||
public static final int TYPE_avcC = 0x61766343;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_hvc1 = Util.getIntegerCodeForString("hvc1");
|
||||
public static final int TYPE_hvc1 = 0x68766331;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_hev1 = Util.getIntegerCodeForString("hev1");
|
||||
public static final int TYPE_hev1 = 0x68657631;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_hvcC = Util.getIntegerCodeForString("hvcC");
|
||||
public static final int TYPE_hvcC = 0x68766343;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_vp08 = Util.getIntegerCodeForString("vp08");
|
||||
public static final int TYPE_vp08 = 0x76703038;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_vp09 = Util.getIntegerCodeForString("vp09");
|
||||
public static final int TYPE_vp09 = 0x76703039;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_vpcC = Util.getIntegerCodeForString("vpcC");
|
||||
public static final int TYPE_vpcC = 0x76706343;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_av01 = Util.getIntegerCodeForString("av01");
|
||||
public static final int TYPE_av01 = 0x61763031;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_av1C = Util.getIntegerCodeForString("av1C");
|
||||
public static final int TYPE_av1C = 0x61763143;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dvav = Util.getIntegerCodeForString("dvav");
|
||||
public static final int TYPE_dvav = 0x64766176;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dva1 = Util.getIntegerCodeForString("dva1");
|
||||
public static final int TYPE_dva1 = 0x64766131;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dvhe = Util.getIntegerCodeForString("dvhe");
|
||||
public static final int TYPE_dvhe = 0x64766865;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dvh1 = Util.getIntegerCodeForString("dvh1");
|
||||
public static final int TYPE_dvh1 = 0x64766831;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dvcC = Util.getIntegerCodeForString("dvcC");
|
||||
public static final int TYPE_dvcC = 0x64766343;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dvvC = Util.getIntegerCodeForString("dvvC");
|
||||
public static final int TYPE_dvvC = 0x64767643;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_s263 = Util.getIntegerCodeForString("s263");
|
||||
public static final int TYPE_s263 = 0x73323633;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_d263 = Util.getIntegerCodeForString("d263");
|
||||
public static final int TYPE_d263 = 0x64323633;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_mdat = Util.getIntegerCodeForString("mdat");
|
||||
public static final int TYPE_mdat = 0x6d646174;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_mp4a = Util.getIntegerCodeForString("mp4a");
|
||||
public static final int TYPE_mp4a = 0x6d703461;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE__mp3 = Util.getIntegerCodeForString(".mp3");
|
||||
public static final int TYPE__mp3 = 0x2e6d7033;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_wave = Util.getIntegerCodeForString("wave");
|
||||
public static final int TYPE_wave = 0x77617665;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_lpcm = Util.getIntegerCodeForString("lpcm");
|
||||
public static final int TYPE_lpcm = 0x6c70636d;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_sowt = Util.getIntegerCodeForString("sowt");
|
||||
public static final int TYPE_sowt = 0x736f7774;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_ac_3 = Util.getIntegerCodeForString("ac-3");
|
||||
public static final int TYPE_ac_3 = 0x61632d33;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dac3 = Util.getIntegerCodeForString("dac3");
|
||||
public static final int TYPE_dac3 = 0x64616333;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_ec_3 = Util.getIntegerCodeForString("ec-3");
|
||||
public static final int TYPE_ec_3 = 0x65632d33;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dec3 = Util.getIntegerCodeForString("dec3");
|
||||
public static final int TYPE_dec3 = 0x64656333;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_ac_4 = Util.getIntegerCodeForString("ac-4");
|
||||
public static final int TYPE_ac_4 = 0x61632d34;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dac4 = Util.getIntegerCodeForString("dac4");
|
||||
public static final int TYPE_dac4 = 0x64616334;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dtsc = Util.getIntegerCodeForString("dtsc");
|
||||
public static final int TYPE_dtsc = 0x64747363;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dtsh = Util.getIntegerCodeForString("dtsh");
|
||||
public static final int TYPE_dtsh = 0x64747368;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dtsl = Util.getIntegerCodeForString("dtsl");
|
||||
public static final int TYPE_dtsl = 0x6474736c;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dtse = Util.getIntegerCodeForString("dtse");
|
||||
public static final int TYPE_dtse = 0x64747365;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_ddts = Util.getIntegerCodeForString("ddts");
|
||||
public static final int TYPE_ddts = 0x64647473;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_tfdt = Util.getIntegerCodeForString("tfdt");
|
||||
public static final int TYPE_tfdt = 0x74666474;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_tfhd = Util.getIntegerCodeForString("tfhd");
|
||||
public static final int TYPE_tfhd = 0x74666864;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_trex = Util.getIntegerCodeForString("trex");
|
||||
public static final int TYPE_trex = 0x74726578;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_trun = Util.getIntegerCodeForString("trun");
|
||||
public static final int TYPE_trun = 0x7472756e;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_sidx = Util.getIntegerCodeForString("sidx");
|
||||
public static final int TYPE_sidx = 0x73696478;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_moov = Util.getIntegerCodeForString("moov");
|
||||
public static final int TYPE_moov = 0x6d6f6f76;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_mvhd = Util.getIntegerCodeForString("mvhd");
|
||||
public static final int TYPE_mvhd = 0x6d766864;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_trak = Util.getIntegerCodeForString("trak");
|
||||
public static final int TYPE_trak = 0x7472616b;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_mdia = Util.getIntegerCodeForString("mdia");
|
||||
public static final int TYPE_mdia = 0x6d646961;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_minf = Util.getIntegerCodeForString("minf");
|
||||
public static final int TYPE_minf = 0x6d696e66;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_stbl = Util.getIntegerCodeForString("stbl");
|
||||
public static final int TYPE_stbl = 0x7374626c;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_esds = Util.getIntegerCodeForString("esds");
|
||||
public static final int TYPE_esds = 0x65736473;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_moof = Util.getIntegerCodeForString("moof");
|
||||
public static final int TYPE_moof = 0x6d6f6f66;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_traf = Util.getIntegerCodeForString("traf");
|
||||
public static final int TYPE_traf = 0x74726166;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_mvex = Util.getIntegerCodeForString("mvex");
|
||||
public static final int TYPE_mvex = 0x6d766578;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_mehd = Util.getIntegerCodeForString("mehd");
|
||||
public static final int TYPE_mehd = 0x6d656864;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_tkhd = Util.getIntegerCodeForString("tkhd");
|
||||
public static final int TYPE_tkhd = 0x746b6864;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_edts = Util.getIntegerCodeForString("edts");
|
||||
public static final int TYPE_edts = 0x65647473;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_elst = Util.getIntegerCodeForString("elst");
|
||||
public static final int TYPE_elst = 0x656c7374;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_mdhd = Util.getIntegerCodeForString("mdhd");
|
||||
public static final int TYPE_mdhd = 0x6d646864;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_hdlr = Util.getIntegerCodeForString("hdlr");
|
||||
public static final int TYPE_hdlr = 0x68646c72;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_stsd = Util.getIntegerCodeForString("stsd");
|
||||
public static final int TYPE_stsd = 0x73747364;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_pssh = Util.getIntegerCodeForString("pssh");
|
||||
public static final int TYPE_pssh = 0x70737368;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_sinf = Util.getIntegerCodeForString("sinf");
|
||||
public static final int TYPE_sinf = 0x73696e66;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_schm = Util.getIntegerCodeForString("schm");
|
||||
public static final int TYPE_schm = 0x7363686d;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_schi = Util.getIntegerCodeForString("schi");
|
||||
public static final int TYPE_schi = 0x73636869;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_tenc = Util.getIntegerCodeForString("tenc");
|
||||
public static final int TYPE_tenc = 0x74656e63;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_encv = Util.getIntegerCodeForString("encv");
|
||||
public static final int TYPE_encv = 0x656e6376;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_enca = Util.getIntegerCodeForString("enca");
|
||||
public static final int TYPE_enca = 0x656e6361;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_frma = Util.getIntegerCodeForString("frma");
|
||||
public static final int TYPE_frma = 0x66726d61;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_saiz = Util.getIntegerCodeForString("saiz");
|
||||
public static final int TYPE_saiz = 0x7361697a;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_saio = Util.getIntegerCodeForString("saio");
|
||||
public static final int TYPE_saio = 0x7361696f;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_sbgp = Util.getIntegerCodeForString("sbgp");
|
||||
public static final int TYPE_sbgp = 0x73626770;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_sgpd = Util.getIntegerCodeForString("sgpd");
|
||||
public static final int TYPE_sgpd = 0x73677064;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_uuid = Util.getIntegerCodeForString("uuid");
|
||||
public static final int TYPE_uuid = 0x75756964;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_senc = Util.getIntegerCodeForString("senc");
|
||||
public static final int TYPE_senc = 0x73656e63;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_pasp = Util.getIntegerCodeForString("pasp");
|
||||
public static final int TYPE_pasp = 0x70617370;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_TTML = Util.getIntegerCodeForString("TTML");
|
||||
public static final int TYPE_TTML = 0x54544d4c;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_vmhd = Util.getIntegerCodeForString("vmhd");
|
||||
public static final int TYPE_vmhd = 0x766d6864;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_mp4v = Util.getIntegerCodeForString("mp4v");
|
||||
public static final int TYPE_mp4v = 0x6d703476;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_stts = Util.getIntegerCodeForString("stts");
|
||||
public static final int TYPE_stts = 0x73747473;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_stss = Util.getIntegerCodeForString("stss");
|
||||
public static final int TYPE_stss = 0x73747373;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_ctts = Util.getIntegerCodeForString("ctts");
|
||||
public static final int TYPE_ctts = 0x63747473;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_stsc = Util.getIntegerCodeForString("stsc");
|
||||
public static final int TYPE_stsc = 0x73747363;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_stsz = Util.getIntegerCodeForString("stsz");
|
||||
public static final int TYPE_stsz = 0x7374737a;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_stz2 = Util.getIntegerCodeForString("stz2");
|
||||
public static final int TYPE_stz2 = 0x73747a32;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_stco = Util.getIntegerCodeForString("stco");
|
||||
public static final int TYPE_stco = 0x7374636f;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_co64 = Util.getIntegerCodeForString("co64");
|
||||
public static final int TYPE_co64 = 0x636f3634;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_tx3g = Util.getIntegerCodeForString("tx3g");
|
||||
public static final int TYPE_tx3g = 0x74783367;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_wvtt = Util.getIntegerCodeForString("wvtt");
|
||||
public static final int TYPE_wvtt = 0x77767474;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_stpp = Util.getIntegerCodeForString("stpp");
|
||||
public static final int TYPE_stpp = 0x73747070;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_c608 = Util.getIntegerCodeForString("c608");
|
||||
public static final int TYPE_c608 = 0x63363038;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_samr = Util.getIntegerCodeForString("samr");
|
||||
public static final int TYPE_samr = 0x73616d72;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_sawb = Util.getIntegerCodeForString("sawb");
|
||||
public static final int TYPE_sawb = 0x73617762;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_udta = Util.getIntegerCodeForString("udta");
|
||||
public static final int TYPE_udta = 0x75647461;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_meta = Util.getIntegerCodeForString("meta");
|
||||
public static final int TYPE_meta = 0x6d657461;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_keys = Util.getIntegerCodeForString("keys");
|
||||
public static final int TYPE_keys = 0x6b657973;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_ilst = Util.getIntegerCodeForString("ilst");
|
||||
public static final int TYPE_ilst = 0x696c7374;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_mean = Util.getIntegerCodeForString("mean");
|
||||
public static final int TYPE_mean = 0x6d65616e;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_name = Util.getIntegerCodeForString("name");
|
||||
public static final int TYPE_name = 0x6e616d65;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_data = Util.getIntegerCodeForString("data");
|
||||
public static final int TYPE_data = 0x64617461;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_emsg = Util.getIntegerCodeForString("emsg");
|
||||
public static final int TYPE_emsg = 0x656d7367;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_st3d = Util.getIntegerCodeForString("st3d");
|
||||
public static final int TYPE_st3d = 0x73743364;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_sv3d = Util.getIntegerCodeForString("sv3d");
|
||||
public static final int TYPE_sv3d = 0x73763364;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_proj = Util.getIntegerCodeForString("proj");
|
||||
public static final int TYPE_proj = 0x70726f6a;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_camm = Util.getIntegerCodeForString("camm");
|
||||
public static final int TYPE_camm = 0x63616d6d;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_alac = Util.getIntegerCodeForString("alac");
|
||||
public static final int TYPE_alac = 0x616c6163;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_alaw = Util.getIntegerCodeForString("alaw");
|
||||
public static final int TYPE_alaw = 0x616c6177;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_ulaw = Util.getIntegerCodeForString("ulaw");
|
||||
public static final int TYPE_ulaw = 0x756c6177;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_Opus = Util.getIntegerCodeForString("Opus");
|
||||
public static final int TYPE_Opus = 0x4f707573;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dOps = Util.getIntegerCodeForString("dOps");
|
||||
public static final int TYPE_dOps = 0x644f7073;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_fLaC = Util.getIntegerCodeForString("fLaC");
|
||||
public static final int TYPE_fLaC = 0x664c6143;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
public static final int TYPE_dfLa = Util.getIntegerCodeForString("dfLa");
|
||||
public static final int TYPE_dfLa = 0x64664c61;
|
||||
|
||||
public final int type;
|
||||
|
||||
|
@ -48,28 +48,28 @@ import java.util.List;
|
||||
private static final String TAG = "AtomParsers";
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_vide = Util.getIntegerCodeForString("vide");
|
||||
private static final int TYPE_vide = 0x76696465;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_soun = Util.getIntegerCodeForString("soun");
|
||||
private static final int TYPE_soun = 0x736f756e;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_text = Util.getIntegerCodeForString("text");
|
||||
private static final int TYPE_text = 0x74657874;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_sbtl = Util.getIntegerCodeForString("sbtl");
|
||||
private static final int TYPE_sbtl = 0x7362746c;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_subt = Util.getIntegerCodeForString("subt");
|
||||
private static final int TYPE_subt = 0x73756274;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_clcp = Util.getIntegerCodeForString("clcp");
|
||||
private static final int TYPE_clcp = 0x636c6370;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_meta = Util.getIntegerCodeForString("meta");
|
||||
private static final int TYPE_meta = 0x6d657461;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_mdta = Util.getIntegerCodeForString("mdta");
|
||||
private static final int TYPE_mdta = 0x6d647461;
|
||||
|
||||
/**
|
||||
* The threshold number of samples to trim from the start/end of an audio track when applying an
|
||||
|
@ -106,7 +106,7 @@ public class FragmentedMp4Extractor implements Extractor {
|
||||
private static final String TAG = "FragmentedMp4Extractor";
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int SAMPLE_GROUP_TYPE_seig = Util.getIntegerCodeForString("seig");
|
||||
private static final int SAMPLE_GROUP_TYPE_seig = 0x73656967;
|
||||
|
||||
private static final byte[] PIFF_SAMPLE_ENCRYPTION_BOX_EXTENDED_TYPE =
|
||||
new byte[] {-94, 57, 79, 82, 90, -101, 79, 20, -94, 68, 108, 66, 124, 100, -115, -12};
|
||||
|
@ -27,7 +27,6 @@ import com.google.android.exoplayer2.metadata.id3.InternalFrame;
|
||||
import com.google.android.exoplayer2.metadata.id3.TextInformationFrame;
|
||||
import com.google.android.exoplayer2.util.Log;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/** Utilities for handling metadata in MP4. */
|
||||
@ -36,41 +35,41 @@ import java.nio.ByteBuffer;
|
||||
private static final String TAG = "MetadataUtil";
|
||||
|
||||
// Codes that start with the copyright character (omitted) and have equivalent ID3 frames.
|
||||
private static final int SHORT_TYPE_NAME_1 = Util.getIntegerCodeForString("nam");
|
||||
private static final int SHORT_TYPE_NAME_2 = Util.getIntegerCodeForString("trk");
|
||||
private static final int SHORT_TYPE_COMMENT = Util.getIntegerCodeForString("cmt");
|
||||
private static final int SHORT_TYPE_YEAR = Util.getIntegerCodeForString("day");
|
||||
private static final int SHORT_TYPE_ARTIST = Util.getIntegerCodeForString("ART");
|
||||
private static final int SHORT_TYPE_ENCODER = Util.getIntegerCodeForString("too");
|
||||
private static final int SHORT_TYPE_ALBUM = Util.getIntegerCodeForString("alb");
|
||||
private static final int SHORT_TYPE_COMPOSER_1 = Util.getIntegerCodeForString("com");
|
||||
private static final int SHORT_TYPE_COMPOSER_2 = Util.getIntegerCodeForString("wrt");
|
||||
private static final int SHORT_TYPE_LYRICS = Util.getIntegerCodeForString("lyr");
|
||||
private static final int SHORT_TYPE_GENRE = Util.getIntegerCodeForString("gen");
|
||||
private static final int SHORT_TYPE_NAME_1 = 0x006e616d;
|
||||
private static final int SHORT_TYPE_NAME_2 = 0x0074726b;
|
||||
private static final int SHORT_TYPE_COMMENT = 0x00636d74;
|
||||
private static final int SHORT_TYPE_YEAR = 0x00646179;
|
||||
private static final int SHORT_TYPE_ARTIST = 0x00415254;
|
||||
private static final int SHORT_TYPE_ENCODER = 0x00746f6f;
|
||||
private static final int SHORT_TYPE_ALBUM = 0x00616c62;
|
||||
private static final int SHORT_TYPE_COMPOSER_1 = 0x00636f6d;
|
||||
private static final int SHORT_TYPE_COMPOSER_2 = 0x00777274;
|
||||
private static final int SHORT_TYPE_LYRICS = 0x006c7972;
|
||||
private static final int SHORT_TYPE_GENRE = 0x0067656e;
|
||||
|
||||
// Codes that have equivalent ID3 frames.
|
||||
private static final int TYPE_COVER_ART = Util.getIntegerCodeForString("covr");
|
||||
private static final int TYPE_GENRE = Util.getIntegerCodeForString("gnre");
|
||||
private static final int TYPE_GROUPING = Util.getIntegerCodeForString("grp");
|
||||
private static final int TYPE_DISK_NUMBER = Util.getIntegerCodeForString("disk");
|
||||
private static final int TYPE_TRACK_NUMBER = Util.getIntegerCodeForString("trkn");
|
||||
private static final int TYPE_TEMPO = Util.getIntegerCodeForString("tmpo");
|
||||
private static final int TYPE_COMPILATION = Util.getIntegerCodeForString("cpil");
|
||||
private static final int TYPE_ALBUM_ARTIST = Util.getIntegerCodeForString("aART");
|
||||
private static final int TYPE_SORT_TRACK_NAME = Util.getIntegerCodeForString("sonm");
|
||||
private static final int TYPE_SORT_ALBUM = Util.getIntegerCodeForString("soal");
|
||||
private static final int TYPE_SORT_ARTIST = Util.getIntegerCodeForString("soar");
|
||||
private static final int TYPE_SORT_ALBUM_ARTIST = Util.getIntegerCodeForString("soaa");
|
||||
private static final int TYPE_SORT_COMPOSER = Util.getIntegerCodeForString("soco");
|
||||
private static final int TYPE_COVER_ART = 0x636f7672;
|
||||
private static final int TYPE_GENRE = 0x676e7265;
|
||||
private static final int TYPE_GROUPING = 0x00677270;
|
||||
private static final int TYPE_DISK_NUMBER = 0x6469736b;
|
||||
private static final int TYPE_TRACK_NUMBER = 0x74726b6e;
|
||||
private static final int TYPE_TEMPO = 0x746d706f;
|
||||
private static final int TYPE_COMPILATION = 0x6370696c;
|
||||
private static final int TYPE_ALBUM_ARTIST = 0x61415254;
|
||||
private static final int TYPE_SORT_TRACK_NAME = 0x736f6e6d;
|
||||
private static final int TYPE_SORT_ALBUM = 0x736f616c;
|
||||
private static final int TYPE_SORT_ARTIST = 0x736f6172;
|
||||
private static final int TYPE_SORT_ALBUM_ARTIST = 0x736f6161;
|
||||
private static final int TYPE_SORT_COMPOSER = 0x736f636f;
|
||||
|
||||
// Types that do not have equivalent ID3 frames.
|
||||
private static final int TYPE_RATING = Util.getIntegerCodeForString("rtng");
|
||||
private static final int TYPE_GAPLESS_ALBUM = Util.getIntegerCodeForString("pgap");
|
||||
private static final int TYPE_TV_SORT_SHOW = Util.getIntegerCodeForString("sosn");
|
||||
private static final int TYPE_TV_SHOW = Util.getIntegerCodeForString("tvsh");
|
||||
private static final int TYPE_RATING = 0x72746e67;
|
||||
private static final int TYPE_GAPLESS_ALBUM = 0x70676170;
|
||||
private static final int TYPE_TV_SORT_SHOW = 0x736f736e;
|
||||
private static final int TYPE_TV_SHOW = 0x74767368;
|
||||
|
||||
// Type for items that are intended for internal use by the player.
|
||||
private static final int TYPE_INTERNAL = Util.getIntegerCodeForString("----");
|
||||
private static final int TYPE_INTERNAL = 0x2d2d2d2d;
|
||||
|
||||
private static final int PICTURE_TYPE_FRONT_COVER = 3;
|
||||
|
||||
|
@ -35,7 +35,6 @@ import com.google.android.exoplayer2.util.Assertions;
|
||||
import com.google.android.exoplayer2.util.MimeTypes;
|
||||
import com.google.android.exoplayer2.util.NalUnitUtil;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
@ -78,7 +77,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
|
||||
private static final int STATE_READING_SAMPLE = 2;
|
||||
|
||||
/** Brand stored in the ftyp atom for QuickTime media. */
|
||||
private static final int BRAND_QUICKTIME = Util.getIntegerCodeForString("qt ");
|
||||
private static final int BRAND_QUICKTIME = 0x71742020;
|
||||
|
||||
/**
|
||||
* When seeking within the source, if the offset is greater than or equal to this value (or the
|
||||
|
@ -18,7 +18,6 @@ package com.google.android.exoplayer2.extractor.mp4;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.extractor.ExtractorInput;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@ -32,32 +31,32 @@ import java.io.IOException;
|
||||
|
||||
private static final int[] COMPATIBLE_BRANDS =
|
||||
new int[] {
|
||||
Util.getIntegerCodeForString("isom"),
|
||||
Util.getIntegerCodeForString("iso2"),
|
||||
Util.getIntegerCodeForString("iso3"),
|
||||
Util.getIntegerCodeForString("iso4"),
|
||||
Util.getIntegerCodeForString("iso5"),
|
||||
Util.getIntegerCodeForString("iso6"),
|
||||
Util.getIntegerCodeForString("avc1"),
|
||||
Util.getIntegerCodeForString("hvc1"),
|
||||
Util.getIntegerCodeForString("hev1"),
|
||||
Util.getIntegerCodeForString("av01"),
|
||||
Util.getIntegerCodeForString("mp41"),
|
||||
Util.getIntegerCodeForString("mp42"),
|
||||
Util.getIntegerCodeForString("3g2a"),
|
||||
Util.getIntegerCodeForString("3g2b"),
|
||||
Util.getIntegerCodeForString("3gr6"),
|
||||
Util.getIntegerCodeForString("3gs6"),
|
||||
Util.getIntegerCodeForString("3ge6"),
|
||||
Util.getIntegerCodeForString("3gg6"),
|
||||
Util.getIntegerCodeForString("M4V "),
|
||||
Util.getIntegerCodeForString("M4A "),
|
||||
Util.getIntegerCodeForString("f4v "),
|
||||
Util.getIntegerCodeForString("kddi"),
|
||||
Util.getIntegerCodeForString("M4VP"),
|
||||
Util.getIntegerCodeForString("qt "), // Apple QuickTime
|
||||
Util.getIntegerCodeForString("MSNV"), // Sony PSP
|
||||
Util.getIntegerCodeForString("dby1"), // Dolby Vision
|
||||
0x69736f6d, // isom
|
||||
0x69736f32, // iso2
|
||||
0x69736f33, // iso3
|
||||
0x69736f34, // iso4
|
||||
0x69736f35, // iso5
|
||||
0x69736f36, // iso6
|
||||
0x61766331, // avc1
|
||||
0x68766331, // hvc1
|
||||
0x68657631, // hev1
|
||||
0x61763031, // av01
|
||||
0x6d703431, // mp41
|
||||
0x6d703432, // mp42
|
||||
0x33673261, // 3g2a
|
||||
0x33673262, // 3g2b
|
||||
0x33677236, // 3gr6
|
||||
0x33677336, // 3gs6
|
||||
0x33676536, // 3ge6
|
||||
0x33676736, // 3gg6
|
||||
0x4d345620, // M4V[space]
|
||||
0x4d344120, // M4A[space]
|
||||
0x66347620, // f4v[space]
|
||||
0x6b646469, // kddi
|
||||
0x4d345650, // M4VP
|
||||
0x71742020, // qt[space][space], Apple QuickTime
|
||||
0x4d534e56, // MSNV, Sony PSP
|
||||
0x64627931, // dby1, Dolby Vision
|
||||
};
|
||||
|
||||
/**
|
||||
@ -188,7 +187,7 @@ import java.io.IOException;
|
||||
*/
|
||||
private static boolean isCompatibleBrand(int brand) {
|
||||
// Accept all brands starting '3gp'.
|
||||
if (brand >>> 8 == Util.getIntegerCodeForString("3gp")) {
|
||||
if (brand >>> 8 == 0x00336770) {
|
||||
return true;
|
||||
}
|
||||
for (int compatibleBrand : COMPATIBLE_BRANDS) {
|
||||
|
@ -19,7 +19,6 @@ import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.ParserException;
|
||||
import com.google.android.exoplayer2.extractor.ExtractorInput;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -34,7 +33,7 @@ import java.io.IOException;
|
||||
public static final int MAX_PAGE_SIZE = EMPTY_PAGE_HEADER_SIZE + MAX_SEGMENT_COUNT
|
||||
+ MAX_PAGE_PAYLOAD;
|
||||
|
||||
private static final int TYPE_OGGS = Util.getIntegerCodeForString("OggS");
|
||||
private static final int TYPE_OGGS = 0x4f676753;
|
||||
|
||||
public int revision;
|
||||
public int type;
|
||||
|
@ -19,7 +19,6 @@ import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.Format;
|
||||
import com.google.android.exoplayer2.util.MimeTypes;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
@ -38,7 +37,7 @@ import java.util.List;
|
||||
*/
|
||||
private static final int SAMPLE_RATE = 48000;
|
||||
|
||||
private static final int OPUS_CODE = Util.getIntegerCodeForString("Opus");
|
||||
private static final int OPUS_CODE = 0x4f707573;
|
||||
private static final byte[] OPUS_SIGNATURE = {'O', 'p', 'u', 's', 'H', 'e', 'a', 'd'};
|
||||
|
||||
private boolean headerRead;
|
||||
|
@ -25,7 +25,6 @@ import com.google.android.exoplayer2.extractor.PositionHolder;
|
||||
import com.google.android.exoplayer2.extractor.SeekMap;
|
||||
import com.google.android.exoplayer2.extractor.TrackOutput;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@ -35,7 +34,7 @@ public final class RawCcExtractor implements Extractor {
|
||||
|
||||
private static final int SCRATCH_SIZE = 9;
|
||||
private static final int HEADER_SIZE = 8;
|
||||
private static final int HEADER_ID = Util.getIntegerCodeForString("RCC\u0001");
|
||||
private static final int HEADER_ID = 0x52434301;
|
||||
private static final int TIMESTAMP_SIZE_V0 = 4;
|
||||
private static final int TIMESTAMP_SIZE_V1 = 8;
|
||||
|
||||
|
@ -27,7 +27,6 @@ import com.google.android.exoplayer2.extractor.PositionHolder;
|
||||
import com.google.android.exoplayer2.extractor.SeekMap;
|
||||
import com.google.android.exoplayer2.extractor.ts.TsPayloadReader.TrackIdGenerator;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@ -45,7 +44,7 @@ public final class Ac3Extractor implements Extractor {
|
||||
private static final int MAX_SNIFF_BYTES = 8 * 1024;
|
||||
private static final int AC3_SYNC_WORD = 0x0B77;
|
||||
private static final int MAX_SYNC_FRAME_SIZE = 2786;
|
||||
private static final int ID3_TAG = Util.getIntegerCodeForString("ID3");
|
||||
private static final int ID3_TAG = 0x00494433;
|
||||
|
||||
private final long firstSampleTimestampUs;
|
||||
private final Ac3Reader reader;
|
||||
|
@ -29,7 +29,6 @@ import com.google.android.exoplayer2.extractor.PositionHolder;
|
||||
import com.google.android.exoplayer2.extractor.SeekMap;
|
||||
import com.google.android.exoplayer2.extractor.ts.TsPayloadReader.TrackIdGenerator;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
|
||||
/** Extracts data from AC-4 bitstreams. */
|
||||
@ -53,7 +52,7 @@ public final class Ac4Extractor implements Extractor {
|
||||
/** The size of the frame header, in bytes. */
|
||||
private static final int FRAME_HEADER_SIZE = 7;
|
||||
|
||||
private static final int ID3_TAG = Util.getIntegerCodeForString("ID3");
|
||||
private static final int ID3_TAG = 0x00494433;
|
||||
|
||||
private final long firstSampleTimestampUs;
|
||||
private final Ac4Reader reader;
|
||||
|
@ -32,7 +32,6 @@ import com.google.android.exoplayer2.extractor.ts.TsPayloadReader.TrackIdGenerat
|
||||
import com.google.android.exoplayer2.util.Assertions;
|
||||
import com.google.android.exoplayer2.util.ParsableBitArray;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
@ -66,7 +65,7 @@ public final class AdtsExtractor implements Extractor {
|
||||
public static final int FLAG_ENABLE_CONSTANT_BITRATE_SEEKING = 1;
|
||||
|
||||
private static final int MAX_PACKET_SIZE = 2 * 1024;
|
||||
private static final int ID3_TAG = Util.getIntegerCodeForString("ID3");
|
||||
private static final int ID3_TAG = 0x00494433;
|
||||
/**
|
||||
* The maximum number of bytes to search when sniffing, excluding the header, before giving up.
|
||||
* Frame sizes are represented by 13-bit fields, so expect a valid frame in the first 8192 bytes.
|
||||
|
@ -101,10 +101,10 @@ public final class TsExtractor implements Extractor {
|
||||
private static final int TS_PAT_PID = 0;
|
||||
private static final int MAX_PID_PLUS_ONE = 0x2000;
|
||||
|
||||
private static final long AC3_FORMAT_IDENTIFIER = Util.getIntegerCodeForString("AC-3");
|
||||
private static final long E_AC3_FORMAT_IDENTIFIER = Util.getIntegerCodeForString("EAC3");
|
||||
private static final long AC4_FORMAT_IDENTIFIER = Util.getIntegerCodeForString("AC-4");
|
||||
private static final long HEVC_FORMAT_IDENTIFIER = Util.getIntegerCodeForString("HEVC");
|
||||
private static final long AC3_FORMAT_IDENTIFIER = 0x41432d33;
|
||||
private static final long E_AC3_FORMAT_IDENTIFIER = 0x45414333;
|
||||
private static final long AC4_FORMAT_IDENTIFIER = 0x41432d34;
|
||||
private static final long HEVC_FORMAT_IDENTIFIER = 0x48455643;
|
||||
|
||||
private static final int BUFFER_SIZE = TS_PACKET_SIZE * 50;
|
||||
private static final int SNIFF_TS_PACKET_COUNT = 5;
|
||||
|
@ -22,7 +22,6 @@ import com.google.android.exoplayer2.extractor.ExtractorInput;
|
||||
import com.google.android.exoplayer2.util.Assertions;
|
||||
import com.google.android.exoplayer2.util.Log;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
|
||||
/** Reads a {@code WavHeader} from an input stream; supports resuming from input failures. */
|
||||
@ -122,11 +121,13 @@ import java.io.IOException;
|
||||
ParsableByteArray scratch = new ParsableByteArray(ChunkHeader.SIZE_IN_BYTES);
|
||||
// Skip all chunks until we hit the data header.
|
||||
ChunkHeader chunkHeader = ChunkHeader.peek(input, scratch);
|
||||
while (chunkHeader.id != Util.getIntegerCodeForString("data")) {
|
||||
final int data = 0x64617461;
|
||||
while (chunkHeader.id != data) {
|
||||
Log.w(TAG, "Ignoring unknown WAV chunk: " + chunkHeader.id);
|
||||
long bytesToSkip = ChunkHeader.SIZE_IN_BYTES + chunkHeader.size;
|
||||
// Override size of RIFF chunk, since it describes its size as the entire file.
|
||||
if (chunkHeader.id == Util.getIntegerCodeForString("RIFF")) {
|
||||
final int riff = 0x52494646;
|
||||
if (chunkHeader.id == riff) {
|
||||
bytesToSkip = ChunkHeader.SIZE_IN_BYTES + 4;
|
||||
}
|
||||
if (bytesToSkip > Integer.MAX_VALUE) {
|
||||
|
@ -61,10 +61,8 @@ public final class Id3Decoder implements MetadataDecoder {
|
||||
|
||||
private static final String TAG = "Id3Decoder";
|
||||
|
||||
/**
|
||||
* The first three bytes of a well formed ID3 tag header.
|
||||
*/
|
||||
public static final int ID3_TAG = Util.getIntegerCodeForString("ID3");
|
||||
/** The first three bytes of a well formed ID3 tag header. */
|
||||
public static final int ID3_TAG = 0x00494433;
|
||||
/**
|
||||
* Length of an ID3 tag header.
|
||||
*/
|
||||
|
@ -19,14 +19,13 @@ import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.extractor.TrackOutput;
|
||||
import com.google.android.exoplayer2.util.Log;
|
||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
|
||||
/** Utility methods for handling CEA-608/708 messages. Defined in A/53 Part 4:2009. */
|
||||
public final class CeaUtil {
|
||||
|
||||
private static final String TAG = "CeaUtil";
|
||||
|
||||
public static final int USER_DATA_IDENTIFIER_GA94 = Util.getIntegerCodeForString("GA94");
|
||||
public static final int USER_DATA_IDENTIFIER_GA94 = 0x47413934;
|
||||
public static final int USER_DATA_TYPE_CODE_MPEG_CC = 0x3;
|
||||
|
||||
private static final int PAYLOAD_TYPE_CC = 4;
|
||||
|
@ -43,8 +43,8 @@ public final class Tx3gDecoder extends SimpleSubtitleDecoder {
|
||||
private static final char BOM_UTF16_BE = '\uFEFF';
|
||||
private static final char BOM_UTF16_LE = '\uFFFE';
|
||||
|
||||
private static final int TYPE_STYL = Util.getIntegerCodeForString("styl");
|
||||
private static final int TYPE_TBOX = Util.getIntegerCodeForString("tbox");
|
||||
private static final int TYPE_STYL = 0x7374796c;
|
||||
private static final int TYPE_TBOX = 0x74626f78;
|
||||
private static final String TX3G_SERIF = "Serif";
|
||||
|
||||
private static final int SIZE_ATOM_HEADER = 8;
|
||||
|
@ -31,13 +31,13 @@ public final class Mp4WebvttDecoder extends SimpleSubtitleDecoder {
|
||||
private static final int BOX_HEADER_SIZE = 8;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_payl = Util.getIntegerCodeForString("payl");
|
||||
private static final int TYPE_payl = 0x7061796c;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_sttg = Util.getIntegerCodeForString("sttg");
|
||||
private static final int TYPE_sttg = 0x73747467;
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
private static final int TYPE_vttc = Util.getIntegerCodeForString("vttc");
|
||||
private static final int TYPE_vttc = 0x76747463;
|
||||
|
||||
private final ParsableByteArray sampleData;
|
||||
private final WebvttCue.Builder builder;
|
||||
|
@ -36,12 +36,12 @@ import java.util.zip.Inflater;
|
||||
*/
|
||||
public final class ProjectionDecoder {
|
||||
|
||||
private static final int TYPE_YTMP = Util.getIntegerCodeForString("ytmp");
|
||||
private static final int TYPE_MSHP = Util.getIntegerCodeForString("mshp");
|
||||
private static final int TYPE_RAW = Util.getIntegerCodeForString("raw ");
|
||||
private static final int TYPE_DFL8 = Util.getIntegerCodeForString("dfl8");
|
||||
private static final int TYPE_MESH = Util.getIntegerCodeForString("mesh");
|
||||
private static final int TYPE_PROJ = Util.getIntegerCodeForString("proj");
|
||||
private static final int TYPE_YTMP = 0x79746d70;
|
||||
private static final int TYPE_MSHP = 0x6d736870;
|
||||
private static final int TYPE_RAW = 0x72617720;
|
||||
private static final int TYPE_DFL8 = 0x64666c38;
|
||||
private static final int TYPE_MESH = 0x6d657368;
|
||||
private static final int TYPE_PROJ = 0x70726f6a;
|
||||
|
||||
// Sanity limits to prevent a bad file from creating an OOM situation. We don't expect a mesh to
|
||||
// exceed these limits.
|
||||
|
Loading…
x
Reference in New Issue
Block a user