• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SampleTableBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.coremedia.iso.boxes.SampleTableBox的典型用法代码示例。如果您正苦于以下问题:Java SampleTableBox类的具体用法?Java SampleTableBox怎么用?Java SampleTableBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SampleTableBox类属于com.coremedia.iso.boxes包,在下文中一共展示了SampleTableBox类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: createStsd

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


示例17: createStsz

import com.coremedia.iso.boxes.SampleTableBox; //导入依赖的package包/类
private void createStsz(Track track, SampleTableBox stbl) {
    SampleSizeBox stsz = new SampleSizeBox();
    stsz.setSampleSizes(track2SampleSizes.get(track));
    stbl.addBox(stsz);
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:6,代码来源:SrsMp4Muxer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ContainerResourceFailedEvent类代码示例发布时间:2022-05-22
下一篇:
Java AllocateRequestProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap