trackToSample.put(track, 0); trackToTime.put(track, 0.0); chunkOffsetBoxes.put(track, new StaticChunkOffsetBox());
private static void correctChunkOffsets(IsoFile tempIsoFile, long correction) { List<SampleTableBox> sampleTableBoxes = Path.getPaths(tempIsoFile, "/moov[0]/trak/mdia[0]/minf[0]/stbl[0]"); for (SampleTableBox sampleTableBox : sampleTableBoxes) { List<Box> stblChildren = new ArrayList<Box>(sampleTableBox.getBoxes()); ChunkOffsetBox chunkOffsetBox = Path.getPath(sampleTableBox, "stco"); if (chunkOffsetBox == null) { stblChildren.remove(Path.getPath(sampleTableBox, "co64")); } stblChildren.remove(chunkOffsetBox); assert chunkOffsetBox != null; long[] cOffsets = chunkOffsetBox.getChunkOffsets(); for (int i = 0; i < cOffsets.length; i++) { cOffsets[i] += correction; } StaticChunkOffsetBox cob = new StaticChunkOffsetBox(); cob.setChunkOffsets(cOffsets); stblChildren.add(cob); sampleTableBox.setBoxes(stblChildren); } }
@Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); int entryCount = CastUtils.l2i(IsoTypeReader.readUInt32(content)); chunkOffsets = new long[entryCount]; for (int i = 0; i < entryCount; i++) { chunkOffsets[i] = IsoTypeReader.readUInt32(content); } }
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, chunkOffsets.length); for (long chunkOffset : chunkOffsets) { IsoTypeWriter.writeUInt32(byteBuffer, chunkOffset); } }
long[] offsets = chunkOffsetBox.getChunkOffsets(); for (int i = 0; i < offsets.length; i++) { offsets[i] += dataOffset;
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, chunkOffsets.length); for (long chunkOffset : chunkOffsets) { IsoTypeWriter.writeUInt32(byteBuffer, chunkOffset); } }
long[] offsets = chunkOffsetBox.getChunkOffsets(); for (int i = 0; i < offsets.length; i++) { offsets[i] += dataOffset;
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; }
private void correctChunkOffsets(IsoFile tempIsoFile, long correction) { List<Box> chunkOffsetBoxes = Path.getPaths(tempIsoFile, "/moov[0]/trak/mdia[0]/minf[0]/stbl[0]/stco[0]"); for (Box chunkOffsetBox : chunkOffsetBoxes) { LinkedList<Box> stblChildren = new LinkedList<Box>(chunkOffsetBox.getParent().getBoxes()); stblChildren.remove(chunkOffsetBox); long[] cOffsets = ((ChunkOffsetBox) chunkOffsetBox).getChunkOffsets(); for (int i = 0; i < cOffsets.length; i++) { cOffsets[i] += correction; } StaticChunkOffsetBox cob = new StaticChunkOffsetBox(); cob.setChunkOffsets(cOffsets); stblChildren.add(cob); chunkOffsetBox.getParent().setBoxes(stblChildren); } }
@Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); int entryCount = CastUtils.l2i(IsoTypeReader.readUInt32(content)); chunkOffsets = new long[entryCount]; for (int i = 0; i < entryCount; i++) { chunkOffsets[i] = IsoTypeReader.readUInt32(content); } }
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; }
trackToSample.put(track, 0); trackToTime.put(track, 0.0); chunkOffsetBoxes.put(track, new StaticChunkOffsetBox());
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; }