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


Java TrackRunBox.getEntries方法代码示例

本文整理汇总了Java中com.coremedia.iso.boxes.fragment.TrackRunBox.getEntries方法的典型用法代码示例。如果您正苦于以下问题:Java TrackRunBox.getEntries方法的具体用法?Java TrackRunBox.getEntries怎么用?Java TrackRunBox.getEntries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.coremedia.iso.boxes.fragment.TrackRunBox的用法示例。


在下文中一共展示了TrackRunBox.getEntries方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDuration

import com.coremedia.iso.boxes.fragment.TrackRunBox; //导入方法依赖的package包/类
@Override
public long getDuration() {
    long dur = 0;
    for (IsoFile fragment : fragments) {
        TrackRunBox trun = (TrackRunBox) Path.getPath(fragment, "/moof[0]/traf[0]/trun[0]");
        for (TrackRunBox.Entry entry : trun.getEntries()) {
            dur += entry.getSampleDuration();
        }
    }
    return dur;
}
 
开发者ID:sannies,项目名称:mp4parser-smooth-streaming,代码行数:12,代码来源:SmoothStreamingTrack.java

示例2: getCompositionTimeEntries

import com.coremedia.iso.boxes.fragment.TrackRunBox; //导入方法依赖的package包/类
@Override
public List<CompositionTimeToSample.Entry> getCompositionTimeEntries() {
    List<CompositionTimeToSample.Entry> entries = new LinkedList<CompositionTimeToSample.Entry>();
    for (IsoFile fragment : fragments) {
        TrackRunBox trun = (TrackRunBox) Path.getPath(fragment, "/moof[0]/traf[0]/trun[0]");
        for (TrackRunBox.Entry entry : trun.getEntries()) {
            entries.add(new CompositionTimeToSample.Entry(l2i(entry.getSampleCompositionTimeOffset()), 1));
        }
    }
    return entries;
}
 
开发者ID:sannies,项目名称:mp4parser-smooth-streaming,代码行数:12,代码来源:SmoothStreamingTrack.java

示例3: getOffsets

import com.coremedia.iso.boxes.fragment.TrackRunBox; //导入方法依赖的package包/类
Map<Long, Long> getOffsets(MovieFragmentBox moof, long trackId, TrackExtendsBox trex) {
    Map<Long, Long> offsets2Sizes = new HashMap<Long, Long>();
    List<TrackFragmentBox> traf = moof.getBoxes(TrackFragmentBox.class);
    for (TrackFragmentBox trackFragmentBox : traf) {
        if (trackFragmentBox.getTrackFragmentHeaderBox().getTrackId() == trackId) {
            long baseDataOffset;
            if (trackFragmentBox.getTrackFragmentHeaderBox().hasBaseDataOffset()) {
                baseDataOffset = trackFragmentBox.getTrackFragmentHeaderBox().getBaseDataOffset();
            } else {
                baseDataOffset = moof.getOffset();
            }

            for (TrackRunBox trun : trackFragmentBox.getBoxes(TrackRunBox.class)) {
                long sampleBaseOffset = baseDataOffset + trun.getDataOffset();
                final TrackFragmentHeaderBox tfhd = ((TrackFragmentBox) trun.getParent()).getTrackFragmentHeaderBox();

                long offset = 0;
                for (TrackRunBox.Entry entry : trun.getEntries()) {
                    final long sampleSize;
                    if (trun.isSampleSizePresent()) {
                        sampleSize = entry.getSampleSize();
                        offsets2Sizes.put(offset + sampleBaseOffset, sampleSize);
                        offset += sampleSize;
                    } else {
                        if (tfhd.hasDefaultSampleSize()) {
                            sampleSize = tfhd.getDefaultSampleSize();
                            offsets2Sizes.put(offset + sampleBaseOffset, sampleSize);
                            offset += sampleSize;
                        } else {
                            if (trex == null) {
                                throw new RuntimeException("File doesn't contain trex box but track fragments aren't fully self contained. Cannot determine sample size.");
                            }
                            sampleSize = trex.getDefaultSampleSize();
                            offsets2Sizes.put(offset + sampleBaseOffset, sampleSize);
                            offset += sampleSize;
                        }
                    }
                }
            }
        }
    }
    return offsets2Sizes;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:44,代码来源:SampleList.java


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