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


Java Box.getBox方法代码示例

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


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

示例1: finishMovie

import com.coremedia.iso.boxes.Box; //导入方法依赖的package包/类
public void finishMovie(boolean error) throws Exception {
    if (mdat.getContentSize() != 0) {
        flushCurrentMdat();
    }

    for (Track track : currentMp4Movie.getTracks()) {
        List<Sample> samples = track.getSamples();
        long[] sizes = new long[samples.size()];
        for (int i = 0; i < sizes.length; i++) {
            sizes[i] = samples.get(i).getSize();
        }
        track2SampleSizes.put(track, sizes);
    }

    Box moov = createMovieBox(currentMp4Movie);
    moov.getBox(fc);
    fos.flush();

    fc.close();
    fos.close();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:22,代码来源:MP4Builder.java

示例2: writeChildBoxes

import com.coremedia.iso.boxes.Box; //导入方法依赖的package包/类
protected final void writeChildBoxes(ByteBuffer bb) {
    WritableByteChannel wbc = new ByteBufferByteChannel(bb);
    for (Box box : boxes) {
        try {
            box.getBox(wbc);
        } catch (IOException e) {
            // cannot happen since my WritableByteChannel won't throw any excpetion
            throw new RuntimeException("Cannot happen.", e);
        }

    }
}
 
开发者ID:begeekmyfriend,项目名称:mp4parser_android,代码行数:13,代码来源:FullContainerBox.java

示例3: writeChildBoxes

import com.coremedia.iso.boxes.Box; //导入方法依赖的package包/类
protected final void writeChildBoxes(ByteBuffer bb) {
    WritableByteChannel wbc = new ByteBufferByteChannel(bb);
    for (Box box : boxes) {
        try {
            box.getBox(wbc);
        } catch (IOException e) {
            // My WritableByteChannel won't throw any excpetion
            throw new RuntimeException("Cannot happen to me", e);
        }
    }
}
 
开发者ID:begeekmyfriend,项目名称:mp4parser_android,代码行数:12,代码来源:AbstractContainerBox.java

示例4: _writeChildBoxes

import com.coremedia.iso.boxes.Box; //导入方法依赖的package包/类
public void _writeChildBoxes(ByteBuffer bb) {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    WritableByteChannel wbc = Channels.newChannel(baos);
    try {
        for (Box box : boxes) {
            box.getBox(wbc);
        }
        wbc.close();
    } catch (IOException e) {
        throw new RuntimeException("Cannot happen. Everything should be in memory and therefore no exceptions.");
    }
    bb.put(baos.toByteArray());
}
 
开发者ID:begeekmyfriend,项目名称:mp4parser_android,代码行数:14,代码来源:SampleEntry.java

示例5: finishMovie

import com.coremedia.iso.boxes.Box; //导入方法依赖的package包/类
private void finishMovie() throws IOException {
    if (flushBytes > 0) {
        fos.flush();
        flushBytes = 0;
    }
    if (mdat.getSize() != 0) {
        // flush cached mdat box
        long oldPosition = fc.position();
        fc.position(mdatOffset);
        mdat.setContentSize(recFileSize - mdat.getHeaderSize() - mdatOffset);
        mdat.getBox(fc);
        fc.position(oldPosition);
        mdat.setContentSize(0);
        fos.flush();
    }

    for (Track track : mp4Movie.getTracks().values()) {
        List<Sample> samples = track.getSamples();
        long[] sizes = new long[samples.size()];
        for (int i = 0; i < sizes.length; i++) {
            sizes[i] = samples.get(i).getSize();
        }
        track2SampleSizes.put(track, sizes);
    }

    Box moov = createMovieBox(mp4Movie);
    moov.getBox(fc);
    fos.flush();

    fc.close();
    fos.close();
    mp4Movie.getTracks().clear();
    track2SampleSizes.clear();
    recFileSize = 0;
    flushBytes = 0;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:37,代码来源:SrsMp4Muxer.java


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