protected Box createStbl(StreamingTrack streamingTrack) { SampleTableBox stbl = new SampleTableBox(); stbl.addBox(streamingTrack.getSampleDescriptionBox()); stbl.addBox(new TimeToSampleBox()); stbl.addBox(new SampleToChunkBox()); stbl.addBox(new SampleSizeBox()); stbl.addBox(new StaticChunkOffsetBox()); return stbl; }
protected void createStsz(Track track, SampleTableBox stbl) { SampleSizeBox stsz = new SampleSizeBox(); stsz.setSampleSizes(track2SampleSizes.get(track)); stbl.addBox(stsz); }
protected void createSubs(Track track, SampleTableBox stbl) { if (track.getSubsampleInformationBox() != null) { stbl.addBox(track.getSubsampleInformationBox()); } }
protected void createCtts(Track track, SampleTableBox stbl) { List<CompositionTimeToSample.Entry> compositionTimeToSampleEntries = track.getCompositionTimeEntries(); if (compositionTimeToSampleEntries != null && !compositionTimeToSampleEntries.isEmpty()) { CompositionTimeToSample ctts = new CompositionTimeToSample(); ctts.setEntries(compositionTimeToSampleEntries); stbl.addBox(ctts); } }
protected void createStsd(Track track, SampleTableBox stbl) { SampleDescriptionBox stsd = new SampleDescriptionBox(); stsd.setBoxes(track.getSampleEntries()); stbl.addBox(stsd); }
protected void createStsd(Track track, SampleTableBox stbl) { SampleDescriptionBox stsd = new SampleDescriptionBox(); stsd.setBoxes(track.getSampleEntries()); stbl.addBox(stsd); }
protected void createStss(Track track, SampleTableBox stbl) { long[] syncSamples = track.getSyncSamples(); if (syncSamples != null && syncSamples.length > 0) { SyncSampleBox stss = new SyncSampleBox(); stss.setSampleNumber(syncSamples); stbl.addBox(stss); } }
stbl.addBox(chunkOffsetBoxes.get(targetTrack));
protected void createSdtp(Track track, SampleTableBox stbl) { if (track.getSampleDependencies() != null && !track.getSampleDependencies().isEmpty()) { SampleDependencyTypeBox sdtp = new SampleDependencyTypeBox(); sdtp.setEntries(track.getSampleDependencies()); stbl.addBox(sdtp); } }
protected void createStsc(Track track, Map<Track, int[]> chunks, SampleTableBox stbl) { int[] tracksChunkSizes = chunks.get(track); SampleToChunkBox stsc = new SampleToChunkBox(); stsc.setEntries(new LinkedList<SampleToChunkBox.Entry>()); long lastChunkSize = Integer.MIN_VALUE; // to be sure the first chunks hasn't got the same size long lastSampleDescriptionIndex = Integer.MIN_VALUE; List<Sample> samples = track.getSamples(); int currentSampleIndex = 0; List<SampleEntry> sampleEntries = track.getSampleEntries(); for (int i = 0; i < tracksChunkSizes.length; i++) { Sample sample = samples.get(currentSampleIndex); int currentSampleDescriptionIndex = sampleEntries.indexOf(sample.getSampleEntry()) + 1; // one base if (lastChunkSize != tracksChunkSizes[i] || lastSampleDescriptionIndex != currentSampleDescriptionIndex) { stsc.getEntries().add(new SampleToChunkBox.Entry(i + 1, tracksChunkSizes[i], currentSampleDescriptionIndex)); lastChunkSize = tracksChunkSizes[i]; lastSampleDescriptionIndex = currentSampleDescriptionIndex; } currentSampleIndex += tracksChunkSizes[i]; } stbl.addBox(stsc); }
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); }
if (stss == null) { stss = new SyncSampleBox(); stbl.addBox(stss);
protected void createStsz(Track track, SampleTableBox stbl) { SampleSizeBox stsz = new SampleSizeBox(); stsz.setSampleSizes(track2SampleSizes.get(track)); stbl.addBox(stsz); }
protected void createSubs(Track track, SampleTableBox stbl) { if (track.getSubsampleInformationBox() != null) { stbl.addBox(track.getSubsampleInformationBox()); } }
protected void createStsd(Track track, SampleTableBox stbl) { SampleDescriptionBox stsd = new SampleDescriptionBox(); stsd.setBoxes(track.getSampleEntries()); stbl.addBox(stsd); }
protected void createStsd(Track track, SampleTableBox stbl) { SampleDescriptionBox stsd = new SampleDescriptionBox(); stsd.setBoxes(track.getSampleEntries()); stbl.addBox(stsd); }