本文整理汇总了Java中com.coremedia.iso.boxes.SampleTableBox类的典型用法代码示例。如果您正苦于以下问题:Java SampleTableBox类的具体用法?Java SampleTableBox怎么用?Java SampleTableBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SampleTableBox类属于com.coremedia.iso.boxes包,在下文中一共展示了SampleTableBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStts
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
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);
}
示例2: createStco
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
protected void createStco(Track track, SampleTableBox stbl) {
ArrayList<Long> chunksOffsets = new ArrayList<>();
long lastOffset = -1;
for (Sample sample : track.getSamples()) {
long offset = sample.getOffset();
if (lastOffset != -1 && lastOffset != offset) {
lastOffset = -1;
}
if (lastOffset == -1) {
chunksOffsets.add(offset);
}
lastOffset = offset + sample.getSize();
}
long[] chunkOffsetsLong = new long[chunksOffsets.size()];
for (int a = 0; a < chunksOffsets.size(); a++) {
chunkOffsetsLong[a] = chunksOffsets.get(a);
}
StaticChunkOffsetBox stco = new StaticChunkOffsetBox();
stco.setChunkOffsets(chunkOffsetsLong);
stbl.addBox(stco);
}
示例3: createStts
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
private 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);
}
示例4: createStco
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
private void createStco(Track track, SampleTableBox stbl) {
ArrayList<Long> chunksOffsets = new ArrayList<>();
long lastOffset = -1;
for (Sample sample : track.getSamples()) {
long offset = sample.getOffset();
if (lastOffset != -1 && lastOffset != offset) {
lastOffset = -1;
}
if (lastOffset == -1) {
chunksOffsets.add(offset);
}
lastOffset = offset + sample.getSize();
}
long[] chunkOffsetsLong = new long[chunksOffsets.size()];
for (int a = 0; a < chunksOffsets.size(); a++) {
chunkOffsetsLong[a] = chunksOffsets.get(a);
}
StaticChunkOffsetBox stco = new StaticChunkOffsetBox();
stco.setChunkOffsets(chunkOffsetsLong);
stbl.addBox(stco);
}
示例5: processVideoBox
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
/**
* Process the video information contained in the atoms.
*
* @param stbl
* @param scale timescale
*/
private void processVideoBox(SampleTableBox stbl, long scale) {
AvcConfigurationBox avcC = (AvcConfigurationBox) Path.getPath(isoFile, "/moov/trak/mdia/minf/stbl/stsd/drmi/avcC");
if (avcC != null) {
long videoConfigContentSize = avcC.getContentSize();
log.debug("AVCC size: {}", videoConfigContentSize);
// ByteBuffer byteBuffer = ByteBuffer.allocate((int) videoConfigContentSize);
// avc1.avcDecoderConfigurationRecord.getContent(byteBuffer);
// byteBuffer.flip();
// videoDecoderBytes = new byte[byteBuffer.limit()];
// byteBuffer.get(videoDecoderBytes);
} else {
log.warn("avcC atom not found");
}
processVideoStbl(stbl, scale);
}
示例6: createCtts
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
protected void createCtts(Track track, SampleTableBox stbl) {
int[] sampleCompositions = track.getSampleCompositions();
if (sampleCompositions == null) {
return;
}
CompositionTimeToSample.Entry lastEntry = null;
List<CompositionTimeToSample.Entry> entries = new ArrayList<>();
for (int a = 0; a < sampleCompositions.length; a++) {
int offset = sampleCompositions[a];
if (lastEntry != null && lastEntry.getOffset() == offset) {
lastEntry.setCount(lastEntry.getCount() + 1);
} else {
lastEntry = new CompositionTimeToSample.Entry(1, offset);
entries.add(lastEntry);
}
}
CompositionTimeToSample ctts = new CompositionTimeToSample();
ctts.setEntries(entries);
stbl.addBox(ctts);
}
示例7: createStts
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
protected void createStts(Track track, SampleTableBox stbl) {
TimeToSampleBox.Entry lastEntry = null;
List<TimeToSampleBox.Entry> entries = new ArrayList<>();
long[] deltas = track.getSampleDurations();
for (int a = 0; a < deltas.length; a++) {
long delta = deltas[a];
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);
}
示例8: createStbl
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
protected Box createStbl(Track track) {
SampleTableBox stbl = new SampleTableBox();
createStsd(track, stbl);
createStts(track, stbl);
createStss(track, stbl);
createStsc(track, stbl);
createStsz(track, stbl);
createStco(track, stbl);
return stbl;
}
示例9: createStss
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
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);
}
}
示例10: createStbl
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
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;
}
示例11: createStbl
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
private Box createStbl(Track track) {
SampleTableBox stbl = new SampleTableBox();
createStsd(track, stbl);
createStts(track, stbl);
createStss(track, stbl);
createStsc(track, stbl);
createStsz(track, stbl);
createStco(track, stbl);
return stbl;
}
示例12: createStss
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
private 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);
}
}
示例13: createStbl
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
protected Box createStbl(Track track) {
SampleTableBox stbl = new SampleTableBox();
createStsd(track, stbl);
createStts(track, stbl);
createCtts(track, stbl);
createStss(track, stbl);
createStsc(track, stbl);
createStsz(track, stbl);
createStco(track, stbl);
return stbl;
}
示例14: createStsd
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
protected void createStsd(Track track, SampleTableBox stbl) {
stbl.addBox(track.getSampleDescriptionBox());
}
示例15: createStsz
import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
protected void createStsz(Track track, SampleTableBox stbl) {
SampleSizeBox stsz = new SampleSizeBox();
stsz.setSampleSizes(track2SampleSizes.get(track));
stbl.addBox(stsz);
}