当前位置: 首页>>代码示例>>Java>>正文


Java SampleTableBox类代码示例

本文整理汇总了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);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:17,代码来源:MP4Builder.java

示例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);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:23,代码来源:MP4Builder.java

示例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);
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:17,代码来源:SrsMp4Muxer.java

示例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);
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:23,代码来源:SrsMp4Muxer.java

示例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);
}
 
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:22,代码来源:MP4Reader.java

示例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);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:22,代码来源:MP4Builder.java

示例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);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:19,代码来源:MP4Builder.java

示例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;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:13,代码来源:MP4Builder.java

示例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);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:9,代码来源:MP4Builder.java

示例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;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:10,代码来源:FragmentedMp4Builder.java

示例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;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:11,代码来源:SrsMp4Muxer.java

示例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);
    }
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:9,代码来源:SrsMp4Muxer.java

示例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;
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:14,代码来源:MP4Builder.java

示例14: createStsd

import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
protected void createStsd(Track track, SampleTableBox stbl) {
    stbl.addBox(track.getSampleDescriptionBox());
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:4,代码来源:MP4Builder.java

示例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);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:6,代码来源:MP4Builder.java


注:本文中的com.coremedia.iso.boxes.SampleTableBox类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。