private boolean matchSampleSizes(TrakBox trakBox1, TrakBox trakBox2) { SampleSizesBox stsz1 = NodeBox.findFirstPath(trakBox1, SampleSizesBox.class, Box.path("mdia.minf.stbl.stsz")); SampleSizesBox stsz2 = NodeBox.findFirstPath(trakBox1, SampleSizesBox.class, Box.path("mdia.minf.stbl.stsz")); return stsz1.getDefaultSize() == stsz2.getDefaultSize(); }
private int getFrameSize() { int size = stsz.getDefaultSize(); Box box = stsd.getBoxes().get(sampleToChunk[s2cIndex].getEntry() - 1); if (box instanceof AudioSampleEntry) { return ((AudioSampleEntry) box).calcFrameSize(); } return size; }
private int getFrameSize() { int size = stsz.getDefaultSize(); Box box = stsd.getBoxes().get(sampleToChunk[s2cIndex].getEntry() - 1); if (box instanceof AudioSampleEntry) { return ((AudioSampleEntry) box).calcFrameSize(); } return size; }
private int getFrameSize() { int size = stsz.getDefaultSize(); Box box = stsd.getBoxes().get(sampleToChunk[s2cIndex].getEntry() - 1); if (box instanceof AudioSampleEntry) { return ((AudioSampleEntry) box).calcFrameSize(); } return size; }
private static void appendSampleSizes(TrakBox trakBox1, TrakBox trakBox2) { SampleSizesBox stsz1 = trakBox1.getStsz(); SampleSizesBox stsz2 = trakBox2.getStsz(); if (stsz1.getDefaultSize() != stsz2.getDefaultSize()) throw new IllegalArgumentException("Can't append to track that has different default sample size"); SampleSizesBox stszr; if (stsz1.getDefaultSize() > 0) { stszr = SampleSizesBox.createSampleSizesBox(stsz1.getDefaultSize(), stsz1.getCount() + stsz2.getCount()); } else { stszr = SampleSizesBox.createSampleSizesBox2(addAllInt(stsz1.getSizes(), stsz2.getSizes())); } NodeBox.findFirstPath(trakBox1, NodeBox.class, Box.path("mdia.minf.stbl")).replace("stsz", stszr); }
public AbstractMP4DemuxerTrack create(TrakBox trak) { SampleSizesBox stsz = findFirst(trak, SampleSizesBox.class, "mdia", "minf", "stbl", "stsz"); if (stsz.getDefaultSize() == 0) return new FramesMP4DemuxerTrack(movie, trak, input); else return new PCMMP4DemuxerTrack(movie, trak, input); }
public int getFrameCount() { SampleSizesBox stsz = findFirst(this, SampleSizesBox.class, "mdia", "minf", "stbl", "stsz"); return stsz.getDefaultSize() != 0 ? stsz.getCount() : stsz.getSizes().length; }
public AbstractMP4DemuxerTrack create(TrakBox trak) { SampleSizesBox stsz = findFirst(trak, SampleSizesBox.class, "mdia", "minf", "stbl", "stsz"); if (stsz.getDefaultSize() == 0) return new FramesMP4DemuxerTrack(movie, trak, input); else return new PCMMP4DemuxerTrack(movie, trak, input); }
public int getFrameCount() { SampleSizesBox stsz = findFirst(this, SampleSizesBox.class, "mdia", "minf", "stbl", "stsz"); return stsz.getDefaultSize() != 0 ? stsz.getCount() : stsz.getSizes().length; }
private AbstractMP4DemuxerTrack fromTrakBox(TrakBox trak) { SampleSizesBox stsz = NodeBox.findFirstPath(trak, SampleSizesBox.class, Box.path("mdia.minf.stbl.stsz")); if (stsz.getDefaultSize() == 0) return newTrack(trak); return new PCMMP4DemuxerTrack(movie, trak, input); }
public int getFrameCount() { SampleSizesBox stsz = NodeBox.findFirstPath(this, SampleSizesBox.class, Box.path("mdia.minf.stbl.stsz")); return stsz.getDefaultSize() != 0 ? stsz.getCount() : stsz.getSizes().length; }
public PCMMP4DemuxerTrack(MovieBox movie, TrakBox trak, SeekableByteChannel input) { super(trak); this.movie = movie; this.input = input; SampleSizesBox stsz = findFirst(trak, SampleSizesBox.class, "mdia", "minf", "stbl", "stsz"); defaultSampleSize = stsz.getDefaultSize(); int chunks = 0; for (int i = 1; i < sampleToChunks.length; i++) { int ch = (int) (sampleToChunks[i].getFirst() - sampleToChunks[i - 1].getFirst()); totalFrames += ch * sampleToChunks[i - 1].getCount(); chunks += ch; } totalFrames += sampleToChunks[sampleToChunks.length - 1].getCount() * (chunkOffsets.length - chunks); }
public PCMMP4DemuxerTrack(MovieBox movie, TrakBox trak, SeekableByteChannel input) { super(trak); this.movie = movie; this.input = input; SampleSizesBox stsz = findFirst(trak, SampleSizesBox.class, "mdia", "minf", "stbl", "stsz"); defaultSampleSize = stsz.getDefaultSize(); int chunks = 0; for (int i = 1; i < sampleToChunks.length; i++) { int ch = (int) (sampleToChunks[i].getFirst() - sampleToChunks[i - 1].getFirst()); totalFrames += ch * sampleToChunks[i - 1].getCount(); chunks += ch; } totalFrames += sampleToChunks[sampleToChunks.length - 1].getCount() * (chunkOffsets.length - chunks); }
public PCMMP4DemuxerTrack(MovieBox movie, TrakBox trak, SeekableByteChannel input) { super(trak); this.movie = movie; this.input = input; SampleSizesBox stsz = NodeBox.findFirstPath(trak, SampleSizesBox.class, Box.path("mdia.minf.stbl.stsz")); defaultSampleSize = stsz.getDefaultSize(); int chunks = 0; for (int i = 1; i < sampleToChunks.length; i++) { int ch = (int) (sampleToChunks[i].getFirst() - sampleToChunks[i - 1].getFirst()); totalFrames += ch * sampleToChunks[i - 1].getCount(); chunks += ch; } totalFrames += sampleToChunks[sampleToChunks.length - 1].getCount() * (chunkOffsets.length - chunks); }
if (stsz.getDefaultSize() > 0) { size = getFrameSize(); } else {
if (stsz.getDefaultSize() > 0) { size = getFrameSize(); } else {
if (stsz.getDefaultSize() > 0) { size = getFrameSize(); } else {