本文整理汇总了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();
}
示例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);
}
}
}
示例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);
}
}
}
示例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());
}
示例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;
}