本文整理汇总了Java中com.coremedia.iso.BoxParser类的典型用法代码示例。如果您正苦于以下问题:Java BoxParser类的具体用法?Java BoxParser怎么用?Java BoxParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BoxParser类属于com.coremedia.iso包,在下文中一共展示了BoxParser类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
/**
* Read the box's content from a byte channel without parsing it. Parsing is done on-demand.
*
* @param readableByteChannel the (part of the) iso file to parse
* @param contentSize expected contentSize of the box
* @param boxParser creates inner boxes
* @throws IOException in case of an I/O error.
*/
@DoNotParseDetail
public void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
if (readableByteChannel instanceof FileChannel && contentSize > MEM_MAP_THRESHOLD) {
// todo: if I map this here delayed I could use transferFrom/transferTo in the getBox method
// todo: potentially this could speed up writing.
//
// It's quite expensive to map a file into the memory. Just do it when the box is larger than a MB.
content = ((FileChannel) readableByteChannel).map(FileChannel.MapMode.READ_ONLY, ((FileChannel) readableByteChannel).position(), contentSize);
((FileChannel) readableByteChannel).position(((FileChannel) readableByteChannel).position() + contentSize);
} else {
assert contentSize < Integer.MAX_VALUE;
content = ChannelHelper.readFully(readableByteChannel, contentSize);
}
if (isParsed() == false) {
parseDetails();
}
}
示例2: listBoxes
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
private static void listBoxes(Object box, BoxParser boxParser, int level) {
StringBuilder space = new StringBuilder();
for (int i = 0; i < level; i++) {
System.out.print(" ");
}
if (box instanceof Container) {
System.out.println(space.toString() + boxSize(box) + box);
Container container = (Container) box;
for (Box item : container.getBoxes()) {
listBoxes(item, boxParser, level + 1);
}
} else if (box instanceof Box) {
System.out.println(boxSize((Box) box) + space.toString() + box);
} else {
System.out.println("---->" + box);
}
}
示例3: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
public void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
if (readableByteChannel instanceof FileChannel && contentSize > 1024 * 1024) {
// It's quite expensive to map a file into the memory. Just do it when the box is larger than a MB.
data = ((FileChannel) readableByteChannel).map(FileChannel.MapMode.READ_ONLY, ((FileChannel) readableByteChannel).position(), contentSize);
((FileChannel) readableByteChannel).position(((FileChannel) readableByteChannel).position() + contentSize);
} else {
assert contentSize < Integer.MAX_VALUE;
data = ChannelHelper.readFully(readableByteChannel, contentSize);
}
}
示例4: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
public void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
this.header = header;
this.contentSize = contentSize;
if (readableByteChannel instanceof FileChannel && (contentSize > AbstractBox.MEM_MAP_THRESHOLD)) {
this.fileChannel = ((FileChannel) readableByteChannel);
this.startPosition = ((FileChannel) readableByteChannel).position();
((FileChannel) readableByteChannel).position(((FileChannel) readableByteChannel).position() + contentSize);
} else {
content = ChannelHelper.readFully(readableByteChannel, l2i(contentSize));
cache.put(0l, new SoftReference<ByteBuffer>(content));
}
}
示例5: main
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
IsoFile file =
new IsoFile("D:/Thunisoft/MyEclipse/workspaces/ͳһ����Ƶƽ̨/streamer/web/mp4/test1.mp4");
BoxParser boxParser = new PropertyBoxParserImpl();
listBoxes(file, boxParser, 1);
}
示例6: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
@Override
public void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
this.boxParser = boxParser;
super.parse(readableByteChannel, header, contentSize, boxParser);
}
示例7: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
@Override
public void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
this.boxParser = boxParser;
super.parse(readableByteChannel, header, contentSize, boxParser);
}
示例8: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
public void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
}
示例9: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
@Override
public void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
super.parse(readableByteChannel, header, contentSize, boxParser); //To change body of overridden methods use File | Settings | File Templates.
}
示例10: setBoxParser
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
public void setBoxParser(BoxParser boxParser) {
this.boxParser = boxParser;
}
示例11: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
@Override
public void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
}
示例12: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
@Override
public void parse(DataSource dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
}
示例13: parse
import com.coremedia.iso.BoxParser; //导入依赖的package包/类
void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException;