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 ParsableBox 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; }
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 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 Box createStbl(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; }
protected ParsableBox 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; }