int j = 0; ByteBuffer xmlSamplePart = null; for (SubSampleInformationBox.SubSampleEntry subSampleEntry : subs.getEntries()) { j += subSampleEntry.getSampleDelta(); if (j == (i + 1)) {
@Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); long entryCount = IsoTypeReader.readUInt32(content); for (int i = 0; i < entryCount; i++) { SubSampleEntry SubSampleEntry = new SubSampleEntry(); SubSampleEntry.setSampleDelta(IsoTypeReader.readUInt32(content)); int subsampleCount = IsoTypeReader.readUInt16(content); for (int j = 0; j < subsampleCount; j++) { SubSampleEntry.SubsampleEntry subsampleEntry = new SubSampleEntry.SubsampleEntry(); subsampleEntry.setSubsampleSize(getVersion() == 1 ? IsoTypeReader.readUInt32(content) : IsoTypeReader.readUInt16(content)); subsampleEntry.setSubsamplePriority(IsoTypeReader.readUInt8(content)); subsampleEntry.setDiscardable(IsoTypeReader.readUInt8(content)); subsampleEntry.setReserved(IsoTypeReader.readUInt32(content)); SubSampleEntry.getSubsampleEntries().add(subsampleEntry); } entries.add(SubSampleEntry); } }
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, entries.size()); for (SubSampleEntry subSampleEntry : entries) { IsoTypeWriter.writeUInt32(byteBuffer, subSampleEntry.getSampleDelta()); IsoTypeWriter.writeUInt16(byteBuffer, subSampleEntry.getSubsampleCount()); List<SubSampleEntry.SubsampleEntry> subsampleEntries = subSampleEntry.getSubsampleEntries(); for (SubSampleEntry.SubsampleEntry subsampleEntry : subsampleEntries) { if (getVersion() == 1) { IsoTypeWriter.writeUInt32(byteBuffer, subsampleEntry.getSubsampleSize()); } else { IsoTypeWriter.writeUInt16(byteBuffer, CastUtils.l2i(subsampleEntry.getSubsampleSize())); } IsoTypeWriter.writeUInt8(byteBuffer, subsampleEntry.getSubsamplePriority()); IsoTypeWriter.writeUInt8(byteBuffer, subsampleEntry.getDiscardable()); IsoTypeWriter.writeUInt32(byteBuffer, subsampleEntry.getReserved()); } } }
protected void createSubs(long startSample, long endSample, Track track, TrackFragmentBox traf) { SubSampleInformationBox subs = track.getSubsampleInformationBox(); if (subs != null) { SubSampleInformationBox fragmentSubs = new SubSampleInformationBox(); fragmentSubs.setEntries(subs.getEntries().subList(l2i(startSample - 1), l2i(endSample - 1))); traf.addBox(fragmentSubs); } }
List<SubSampleInformationBox> subss = Path.getPaths(isofile, "moof/traf/subs"); if (subss.size() > 0) { subSampleInformationBox = new SubSampleInformationBox(); if (subs != null) { long difFromLastFragment = sampleNumber - lastSubsSample - 1; for (SubSampleInformationBox.SubSampleEntry subSampleEntry : subs.getEntries()) { SubSampleInformationBox.SubSampleEntry se = new SubSampleInformationBox.SubSampleEntry(); se.getSubsampleEntries().addAll(subSampleEntry.getSubsampleEntries()); se.setSampleDelta(subSampleEntry.getSampleDelta()); subSampleInformationBox.getEntries().add(se);
@Override protected long getContentSize() { long size = 8; for (SubSampleEntry entry : entries) { size += 4; size += 2; for (int j = 0; j < entry.getSubsampleEntries().size(); j++) { if (getVersion() == 1) { size += 4; } else { size += 2; } size += 2; size += 4; } } return size; }
List<SubSampleInformationBox> subss = Path.getPaths(isofile, "moof/traf/subs"); if (subss.size() > 0) { subSampleInformationBox = new SubSampleInformationBox(); if (subs != null) { long difFromLastFragment = sampleNumber - lastSubsSample - 1; for (SubSampleInformationBox.SubSampleEntry subSampleEntry : subs.getEntries()) { SubSampleInformationBox.SubSampleEntry se = new SubSampleInformationBox.SubSampleEntry(); se.getSubsampleEntries().addAll(subSampleEntry.getSubsampleEntries()); se.setSampleDelta(subSampleEntry.getSampleDelta()); subSampleInformationBox.getEntries().add(se);
@Override protected long getContentSize() { long size = 8; for (SubSampleEntry entry : entries) { size += 4; size += 2; for (int j = 0; j < entry.getSubsampleEntries().size(); j++) { if (getVersion() == 1) { size += 4; } else { size += 2; } size += 2; size += 4; } } return size; }
final Document ttml = ttmls.get(sampleNo); SubSampleInformationBox.SubSampleEntry subSampleEntry = new SubSampleInformationBox.SubSampleEntry(); subSampleInformationBox.getEntries().add(subSampleEntry); subSampleEntry.setSampleDelta(1); sampleDurations[sampleNo] = extractDuration(ttml);
@Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); long entryCount = IsoTypeReader.readUInt32(content); for (int i = 0; i < entryCount; i++) { SubSampleEntry SubSampleEntry = new SubSampleEntry(); SubSampleEntry.setSampleDelta(IsoTypeReader.readUInt32(content)); int subsampleCount = IsoTypeReader.readUInt16(content); for (int j = 0; j < subsampleCount; j++) { SubSampleEntry.SubsampleEntry subsampleEntry = new SubSampleEntry.SubsampleEntry(); subsampleEntry.setSubsampleSize(getVersion() == 1 ? IsoTypeReader.readUInt32(content) : IsoTypeReader.readUInt16(content)); subsampleEntry.setSubsamplePriority(IsoTypeReader.readUInt8(content)); subsampleEntry.setDiscardable(IsoTypeReader.readUInt8(content)); subsampleEntry.setReserved(IsoTypeReader.readUInt32(content)); SubSampleEntry.getSubsampleEntries().add(subsampleEntry); } entries.add(SubSampleEntry); } }
@Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, entries.size()); for (SubSampleEntry subSampleEntry : entries) { IsoTypeWriter.writeUInt32(byteBuffer, subSampleEntry.getSampleDelta()); IsoTypeWriter.writeUInt16(byteBuffer, subSampleEntry.getSubsampleCount()); List<SubSampleEntry.SubsampleEntry> subsampleEntries = subSampleEntry.getSubsampleEntries(); for (SubSampleEntry.SubsampleEntry subsampleEntry : subsampleEntries) { if (getVersion() == 1) { IsoTypeWriter.writeUInt32(byteBuffer, subsampleEntry.getSubsampleSize()); } else { IsoTypeWriter.writeUInt16(byteBuffer, CastUtils.l2i(subsampleEntry.getSubsampleSize())); } IsoTypeWriter.writeUInt8(byteBuffer, subsampleEntry.getSubsamplePriority()); IsoTypeWriter.writeUInt8(byteBuffer, subsampleEntry.getDiscardable()); IsoTypeWriter.writeUInt32(byteBuffer, subsampleEntry.getReserved()); } } }
final Document ttml = ttmls.get(sampleNo); SubSampleInformationBox.SubSampleEntry subSampleEntry = new SubSampleInformationBox.SubSampleEntry(); subSampleInformationBox.getEntries().add(subSampleEntry); subSampleEntry.setSampleDelta(1); sampleDurations[sampleNo] = extractDuration(ttml);