protected void createStts(Track track, SampleTableBox stbl) { TimeToSampleBox.Entry lastEntry = null; List<TimeToSampleBox.Entry> entries = new ArrayList<TimeToSampleBox.Entry>(); for (long delta : track.getSampleDurations()) { if (lastEntry != null && lastEntry.getDelta() == delta) { lastEntry.setCount(lastEntry.getCount() + 1); } else { lastEntry = new TimeToSampleBox.Entry(1, delta); entries.add(lastEntry); } } TimeToSampleBox stts = new TimeToSampleBox(); stts.setEntries(entries); stbl.addBox(stts); }
public List<TimeToSampleBox.Entry> getDecodingTimeEntries() { if (tracks[0].getDecodingTimeEntries() != null && !tracks[0].getDecodingTimeEntries().isEmpty()) { List<long[]> lists = new LinkedList<long[]>(); for (Track track : tracks) { lists.add(TimeToSampleBox.blowupTimeToSamples(track.getDecodingTimeEntries())); } LinkedList<TimeToSampleBox.Entry> returnDecodingEntries = new LinkedList<TimeToSampleBox.Entry>(); for (long[] list : lists) { for (long nuDecodingTime : list) { if (returnDecodingEntries.isEmpty() || returnDecodingEntries.getLast().getDelta() != nuDecodingTime) { TimeToSampleBox.Entry e = new TimeToSampleBox.Entry(1, nuDecodingTime); returnDecodingEntries.add(e); } else { TimeToSampleBox.Entry e = returnDecodingEntries.getLast(); e.setCount(e.getCount() + 1); } } } return returnDecodingEntries; } else { return null; } }
@Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); int entryCount = l2i(IsoTypeReader.readUInt32(content)); entries = new ArrayList<Entry>(entryCount); for (int i = 0; i < entryCount; i++) { entries.add(new Entry(IsoTypeReader.readUInt32(content), IsoTypeReader.readUInt32(content))); } }
protected Box createStbl(Movie movie, Track track) { SampleTableBox stbl = new SampleTableBox(); stbl.addBox(track.getSampleDescriptionBox()); stbl.addBox(new TimeToSampleBox()); //stbl.addBox(new SampleToChunkBox()); stbl.addBox(new StaticChunkOffsetBox()); return stbl; }
sampleDependencies = new ArrayList<SampleDependencyTypeBox.Entry>(); decodingTimeEntries.addAll(stbl.getTimeToSampleBox().getEntries()); if (stbl.getCompositionTimeToSample() != null) { compositionTimeEntries.addAll(stbl.getCompositionTimeToSample().getEntries()); decodingTimes = TimeToSampleBox.blowupTimeToSamples(decodingTimeEntries);
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, entries.size()); for (Entry entry : entries) { IsoTypeWriter.writeUInt32(byteBuffer, entry.getCount()); IsoTypeWriter.writeUInt32(byteBuffer, entry.getDelta()); } }
sampleDependencies = new LinkedList<SampleDependencyTypeBox.Entry>(); decodingTimeEntries.addAll(stbl.getTimeToSampleBox().getEntries()); if (stbl.getCompositionTimeToSample() != null) { compositionTimeEntries.addAll(stbl.getCompositionTimeToSample().getEntries());
protected Box createStbl(Movie movie, Track track) { SampleTableBox stbl = new SampleTableBox(); stbl.addBox(track.getSampleDescriptionBox()); stbl.addBox(new TimeToSampleBox()); //stbl.addBox(new SampleToChunkBox()); stbl.addBox(new StaticChunkOffsetBox()); return stbl; }
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, entries.size()); for (Entry entry : entries) { IsoTypeWriter.writeUInt32(byteBuffer, entry.getCount()); IsoTypeWriter.writeUInt32(byteBuffer, entry.getDelta()); } }
sampleDependencies = new LinkedList<SampleDependencyTypeBox.Entry>(); decodingTimeEntries.addAll(stbl.getTimeToSampleBox().getEntries()); if (stbl.getCompositionTimeToSample() != null) { compositionTimeEntries.addAll(stbl.getCompositionTimeToSample().getEntries());
protected void createStts(Track track, SampleTableBox stbl) { TimeToSampleBox.Entry lastEntry = null; List<TimeToSampleBox.Entry> entries = new ArrayList<>(); for (long delta : track.getSampleDurations()) { if (lastEntry != null && lastEntry.getDelta() == delta) { lastEntry.setCount(lastEntry.getCount() + 1); } else { lastEntry = new TimeToSampleBox.Entry(1, delta); entries.add(lastEntry); } } TimeToSampleBox stts = new TimeToSampleBox(); stts.setEntries(entries); stbl.addBox(stts); }
protected Box createStbl(Movie movie, Track track) { SampleTableBox stbl = new SampleTableBox(); createStsd(track, stbl); stbl.addBox(new TimeToSampleBox()); stbl.addBox(new SampleToChunkBox()); stbl.addBox(new SampleSizeBox()); stbl.addBox(new StaticChunkOffsetBox()); return stbl; }
public List<TimeToSampleBox.Entry> getDecodingTimeEntries() { if (origTrack.getDecodingTimeEntries() != null && !origTrack.getDecodingTimeEntries().isEmpty()) { // todo optimize! too much long is allocated but then not used long[] decodingTimes = TimeToSampleBox.blowupTimeToSamples(origTrack.getDecodingTimeEntries()); long[] nuDecodingTimes = new long[toSample - fromSample]; System.arraycopy(decodingTimes, fromSample, nuDecodingTimes, 0, toSample - fromSample); LinkedList<TimeToSampleBox.Entry> returnDecodingEntries = new LinkedList<TimeToSampleBox.Entry>(); for (long nuDecodingTime : nuDecodingTimes) { if (returnDecodingEntries.isEmpty() || returnDecodingEntries.getLast().getDelta() != nuDecodingTime) { TimeToSampleBox.Entry e = new TimeToSampleBox.Entry(1, nuDecodingTime); returnDecodingEntries.add(e); } else { TimeToSampleBox.Entry e = returnDecodingEntries.getLast(); e.setCount(e.getCount() + 1); } } return returnDecodingEntries; } else { return null; } }
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, entries.size()); for (Entry entry : entries) { IsoTypeWriter.writeUInt32(byteBuffer, entry.getCount()); IsoTypeWriter.writeUInt32(byteBuffer, entry.getDelta()); } }
@Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); int entryCount = l2i(IsoTypeReader.readUInt32(content)); entries = new ArrayList<Entry>(entryCount); for (int i = 0; i < entryCount; i++) { entries.add(new Entry(IsoTypeReader.readUInt32(content), IsoTypeReader.readUInt32(content))); } }
protected void createStts(Track track, SampleTableBox stbl) { TimeToSampleBox.Entry lastEntry = null; List<TimeToSampleBox.Entry> entries = new ArrayList<>(); for (long delta : track.getSampleDurations()) { if (lastEntry != null && lastEntry.getDelta() == delta) { lastEntry.setCount(lastEntry.getCount() + 1); } else { lastEntry = new TimeToSampleBox.Entry(1, delta); entries.add(lastEntry); } } TimeToSampleBox stts = new TimeToSampleBox(); stts.setEntries(entries); stbl.addBox(stts); }
protected Box createStbl() { SampleTableBox stbl = new SampleTableBox(); stbl.addBox(source.getSampleDescriptionBox()); stbl.addBox(new TimeToSampleBox()); stbl.addBox(new SampleToChunkBox()); stbl.addBox(new SampleSizeBox()); stbl.addBox(new StaticChunkOffsetBox()); return stbl; }
public List<TimeToSampleBox.Entry> getDecodingTimeEntries() { if (origTrack.getDecodingTimeEntries() != null && !origTrack.getDecodingTimeEntries().isEmpty()) { // todo optimize! too much long is allocated but then not used long[] decodingTimes = TimeToSampleBox.blowupTimeToSamples(origTrack.getDecodingTimeEntries()); long[] nuDecodingTimes = new long[toSample - fromSample]; System.arraycopy(decodingTimes, fromSample, nuDecodingTimes, 0, toSample - fromSample); LinkedList<TimeToSampleBox.Entry> returnDecodingEntries = new LinkedList<TimeToSampleBox.Entry>(); for (long nuDecodingTime : nuDecodingTimes) { if (returnDecodingEntries.isEmpty() || returnDecodingEntries.getLast().getDelta() != nuDecodingTime) { TimeToSampleBox.Entry e = new TimeToSampleBox.Entry(1, nuDecodingTime); returnDecodingEntries.add(e); } else { TimeToSampleBox.Entry e = returnDecodingEntries.getLast(); e.setCount(e.getCount() + 1); } } return returnDecodingEntries; } else { return null; } }
@Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); int entryCount = l2i(IsoTypeReader.readUInt32(content)); entries = new ArrayList<Entry>(entryCount); for (int i = 0; i < entryCount; i++) { entries.add(new Entry(IsoTypeReader.readUInt32(content), IsoTypeReader.readUInt32(content))); } }
protected void createStts(Track track, SampleTableBox stbl) { TimeToSampleBox.Entry lastEntry = null; List<TimeToSampleBox.Entry> entries = new ArrayList<>(); for (long delta : track.getSampleDurations()) { if (lastEntry != null && lastEntry.getDelta() == delta) { lastEntry.setCount(lastEntry.getCount() + 1); } else { lastEntry = new TimeToSampleBox.Entry(1, delta); entries.add(lastEntry); } } TimeToSampleBox stts = new TimeToSampleBox(); stts.setEntries(entries); stbl.addBox(stts); }