本文整理汇总了Java中com.coremedia.iso.boxes.TrackBox.addBox方法的典型用法代码示例。如果您正苦于以下问题:Java TrackBox.addBox方法的具体用法?Java TrackBox.addBox怎么用?Java TrackBox.addBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.coremedia.iso.boxes.TrackBox
的用法示例。
在下文中一共展示了TrackBox.addBox方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTrak
import com.coremedia.iso.boxes.TrackBox; //导入方法依赖的package包/类
protected Box createTrak(Track track, Movie movie) {
LOG.fine("Creating Track " + track);
TrackBox trackBox = new TrackBox();
trackBox.addBox(createTkhd(movie, track));
trackBox.addBox(createMdia(track, movie));
return trackBox;
}
示例2: createTrackBox
import com.coremedia.iso.boxes.TrackBox; //导入方法依赖的package包/类
protected TrackBox createTrackBox(Track track, Mp4Movie movie) {
TrackBox trackBox = new TrackBox();
TrackHeaderBox tkhd = new TrackHeaderBox();
tkhd.setEnabled(true);
tkhd.setInMovie(true);
tkhd.setInPreview(true);
if (track.isAudio()) {
tkhd.setMatrix(Matrix.ROTATE_0);
} else {
tkhd.setMatrix(movie.getMatrix());
}
tkhd.setAlternateGroup(0);
tkhd.setCreationTime(track.getCreationTime());
tkhd.setDuration(track.getDuration() * getTimescale(movie) / track.getTimeScale());
tkhd.setHeight(track.getHeight());
tkhd.setWidth(track.getWidth());
tkhd.setLayer(0);
tkhd.setModificationTime(new Date());
tkhd.setTrackId(track.getTrackId() + 1);
tkhd.setVolume(track.getVolume());
trackBox.addBox(tkhd);
MediaBox mdia = new MediaBox();
trackBox.addBox(mdia);
MediaHeaderBox mdhd = new MediaHeaderBox();
mdhd.setCreationTime(track.getCreationTime());
mdhd.setDuration(track.getDuration());
mdhd.setTimescale(track.getTimeScale());
mdhd.setLanguage("eng");
mdia.addBox(mdhd);
HandlerBox hdlr = new HandlerBox();
hdlr.setName(track.isAudio() ? "SoundHandle" : "VideoHandle");
hdlr.setHandlerType(track.getHandler());
mdia.addBox(hdlr);
MediaInformationBox minf = new MediaInformationBox();
minf.addBox(track.getMediaHeaderBox());
DataInformationBox dinf = new DataInformationBox();
DataReferenceBox dref = new DataReferenceBox();
dinf.addBox(dref);
DataEntryUrlBox url = new DataEntryUrlBox();
url.setFlags(1);
dref.addBox(url);
minf.addBox(dinf);
Box stbl = createStbl(track);
minf.addBox(stbl);
mdia.addBox(minf);
return trackBox;
}
示例3: createTrackBox
import com.coremedia.iso.boxes.TrackBox; //导入方法依赖的package包/类
private TrackBox createTrackBox(Track track, Mp4Movie movie) {
TrackBox trackBox = new TrackBox();
TrackHeaderBox tkhd = new TrackHeaderBox();
tkhd.setEnabled(true);
tkhd.setInMovie(true);
tkhd.setInPreview(true);
if (track.isAudio()) {
tkhd.setMatrix(Matrix.ROTATE_0);
} else {
tkhd.setMatrix(movie.getMatrix());
}
tkhd.setAlternateGroup(0);
tkhd.setCreationTime(track.getCreationTime());
tkhd.setModificationTime(track.getCreationTime());
tkhd.setDuration(track.getDuration() * getTimescale(movie) / track.getTimeScale());
tkhd.setHeight(track.getHeight());
tkhd.setWidth(track.getWidth());
tkhd.setLayer(0);
tkhd.setModificationTime(new Date());
tkhd.setTrackId(track.getTrackId() + 1);
tkhd.setVolume(track.getVolume());
trackBox.addBox(tkhd);
MediaBox mdia = new MediaBox();
trackBox.addBox(mdia);
MediaHeaderBox mdhd = new MediaHeaderBox();
mdhd.setCreationTime(track.getCreationTime());
mdhd.setModificationTime(track.getCreationTime());
mdhd.setDuration(track.getDuration());
mdhd.setTimescale(track.getTimeScale());
mdhd.setLanguage("eng");
mdia.addBox(mdhd);
HandlerBox hdlr = new HandlerBox();
hdlr.setName(track.isAudio() ? "SoundHandle" : "VideoHandle");
hdlr.setHandlerType(track.getHandler());
mdia.addBox(hdlr);
MediaInformationBox minf = new MediaInformationBox();
minf.addBox(track.getMediaHeaderBox());
DataInformationBox dinf = new DataInformationBox();
DataReferenceBox dref = new DataReferenceBox();
dinf.addBox(dref);
DataEntryUrlBox url = new DataEntryUrlBox();
url.setFlags(1);
dref.addBox(url);
minf.addBox(dinf);
Box stbl = createStbl(track);
minf.addBox(stbl);
mdia.addBox(minf);
return trackBox;
}