public SampleDescriptionBox getSampleDescriptionBox() { return trackBox.getSampleTableBox().getSampleDescriptionBox(); }
@Override public int size() { return l2i(trackBox.getSampleTableBox().getSampleSizeBox().getSampleCount()); }
public FragmentedMp4SampleList(long track, Container isofile, RandomAccessSource randomAccess) { this.isofile = isofile; this.randomAccess = randomAccess; List<TrackBox> tbs = Path.getPaths(isofile, "moov[0]/trak"); for (TrackBox tb : tbs) { if (tb.getTrackHeaderBox().getTrackId() == track) { trackBox = tb; } } if (trackBox == null) { throw new RuntimeException("This MP4 does not contain track " + track); } List<TrackExtendsBox> trexs = Path.getPaths(isofile, "moov[0]/mvex[0]/trex"); for (TrackExtendsBox box : trexs) { if (box.getTrackId() == trackBox.getTrackHeaderBox().getTrackId()) { trex = box; } } sampleEntries = new ArrayList<>(trackBox.getSampleTableBox().getSampleDescriptionBox().getBoxes(SampleEntry.class)); if (sampleEntries.size() != trackBox.getSampleTableBox().getSampleDescriptionBox().getBoxes().size()) throw new AssertionError("stsd contains not only sample entries. Something's wrong here! Bailing out"); sampleCache = (SoftReference<Sample>[]) Array.newInstance(SoftReference.class, size()); initAllFragments(); }
public ClassicMp4ContainerSource(InputStream is) throws IOException { readableByteChannel = Channels.newChannel(new TeeInputStream(is, baos)); BasicContainer container = new BasicContainer(); BoxParser boxParser = new PropertyBoxParserImpl(); Box current = null; while (current == null || !"moov".equals(current.getType())) { current = boxParser.parseBox(readableByteChannel, null); container.addBox(current); } // Either mdat was already read (yeahh sucks but what can you do if it's in the beginning) // or it's still coming for (TrackBox trackBox : Path.<TrackBox>getPaths(container, "moov[0]/trak")) { Mp4StreamingTrack mp4StreamingTrack = new Mp4StreamingTrack(trackBox); tracks.put(trackBox, mp4StreamingTrack); if (trackBox.getSampleTableBox().getCompositionTimeToSample() != null) { mp4StreamingTrack.addTrackExtension(new CompositionTimeTrackExtension()); } mp4StreamingTrack.addTrackExtension(new TrackIdTrackExtension(trackBox.getTrackHeaderBox().getTrackId())); currentChunks.put(trackBox, 1L); currentSamples.put(trackBox, 1L); } }
throw new RuntimeException("This MP4 does not contain track " + track); sampleEntries = new ArrayList<>(trackBox.getSampleTableBox().getSampleDescriptionBox().getBoxes(SampleEntry.class)); if (sampleEntries.size() != trackBox.getSampleTableBox().getSampleDescriptionBox().getBoxes().size()) throw new AssertionError("stsd contains not only sample entries. Something's wrong here! Bailing out"); chunkOffsets = trackBox.getSampleTableBox().getChunkOffsetBox().getChunkOffsets(); long[] chunkSizes = new long[chunkOffsets.length]; ssb = trackBox.getSampleTableBox().getSampleSizeBox(); List<SampleToChunkBox.Entry> s2chunkEntries = trackBox.getSampleTableBox().getSampleToChunkBox().getEntries(); SampleToChunkBox.Entry[] entries = s2chunkEntries.toArray(new SampleToChunkBox.Entry[s2chunkEntries.size()]);
long _currentChunk = currentChunks.get(trackBox); long _currentSample = currentSamples.get(trackBox); long[] chunkOffsets = trackBox.getSampleTableBox().getChunkOffsetBox().getChunkOffsets(); SampleToChunkBox stsc = firstInLine.getSampleTableBox().getSampleToChunkBox(); for (SampleToChunkBox.Entry _entry : stsc.getEntries()) { if (currentChunk >= _entry.getFirstChunk()) { SampleTableBox stbl = firstInLine.getSampleTableBox();
long[] chunkSizes = trackBox.getSampleTableBox().getSampleToChunkBox().blowup(chunkOffsetBox.getChunkOffsets().length);
@Override public int size() { return l2i(trackBox.getSampleTableBox().getSampleSizeBox().getSampleCount()); }
public FragmentedMp4SampleList(long track, Container isofile, RandomAccessSource randomAccess) { this.isofile = isofile; this.randomAccess = randomAccess; List<TrackBox> tbs = Path.getPaths(isofile, "moov[0]/trak"); for (TrackBox tb : tbs) { if (tb.getTrackHeaderBox().getTrackId() == track) { trackBox = tb; } } if (trackBox == null) { throw new RuntimeException("This MP4 does not contain track " + track); } List<TrackExtendsBox> trexs = Path.getPaths(isofile, "moov[0]/mvex[0]/trex"); for (TrackExtendsBox box : trexs) { if (box.getTrackId() == trackBox.getTrackHeaderBox().getTrackId()) { trex = box; } } sampleEntries = new ArrayList<>(trackBox.getSampleTableBox().getSampleDescriptionBox().getBoxes(SampleEntry.class)); if (sampleEntries.size() != trackBox.getSampleTableBox().getSampleDescriptionBox().getBoxes().size()) throw new AssertionError("stsd contains not only sample entries. Something's wrong here! Bailing out"); sampleCache = (SoftReference<Sample>[]) Array.newInstance(SoftReference.class, size()); initAllFragments(); }
SampleTableBox stbl = trak.getSampleTableBox(); // mdia/minf/stbl if (stbl != null) { if (log.isDebugEnabled()) {
SampleTableBox stbl = trak.getSampleTableBox(); // mdia/minf/stbl if (stbl != null) { if (log.isDebugEnabled()) {
SampleTableBox stbl = trak.getSampleTableBox(); // mdia/minf/stbl if (stbl != null) { if (log.isDebugEnabled()) {
SampleTableBox stbl = trak.getSampleTableBox(); // mdia/minf/stbl if (stbl != null) { if (log.isDebugEnabled()) {
throw new RuntimeException("This MP4 does not contain track " + track); sampleEntries = new ArrayList<>(trackBox.getSampleTableBox().getSampleDescriptionBox().getBoxes(SampleEntry.class)); if (sampleEntries.size() != trackBox.getSampleTableBox().getSampleDescriptionBox().getBoxes().size()) throw new AssertionError("stsd contains not only sample entries. Something's wrong here! Bailing out"); chunkOffsets = trackBox.getSampleTableBox().getChunkOffsetBox().getChunkOffsets(); long[] chunkSizes = new long[chunkOffsets.length]; ssb = trackBox.getSampleTableBox().getSampleSizeBox(); List<SampleToChunkBox.Entry> s2chunkEntries = trackBox.getSampleTableBox().getSampleToChunkBox().getEntries(); SampleToChunkBox.Entry[] entries = s2chunkEntries.toArray(new SampleToChunkBox.Entry[s2chunkEntries.size()]);
long[] chunkSizes = trackBox.getSampleTableBox().getSampleToChunkBox().blowup(chunkOffsetBox.getChunkOffsets().length);