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); } } }
protected void getContent(ByteBuffer byteBuffer) { try { appleDataBox.getBox(new ByteBufferByteChannel(byteBuffer)); } catch (IOException e) { throw new RuntimeException("The Channel is based on a ByteBuffer and therefore it shouldn't throw any exception"); } }
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); } } }
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); } } }
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); } } }
protected void getContent(ByteBuffer byteBuffer) { try { appleDataBox.getBox(new ByteBufferByteChannel(byteBuffer)); } catch (IOException e) { throw new RuntimeException("The Channel is based on a ByteBuffer and therefore it shouldn't throw any exception"); } }
protected final void parseChildBoxes(ByteBuffer content) { try { while (content.remaining() >= 8) { // 8 is the minimal size for a sane box boxes.add(boxParser.parseBox(new ByteBufferByteChannel(content), this)); } if (content.remaining() != 0) { setDeadBytes(content.slice()); LOG.severe("Some sizes are wrong"); } } catch (IOException e) { throw new RuntimeException(e); } }
protected final void parseChildBoxes(ByteBuffer content) { try { while (content.remaining() >= 8) { // 8 is the minimal size for a sane box boxes.add(boxParser.parseBox(new ByteBufferByteChannel(content), this)); } if (content.remaining() != 0) { setDeadBytes(content.slice()); LOG.warning("Something's wrong with the sizes. There are dead bytes in a container box."); } } catch (IOException e) { throw new RuntimeException(e); } }
protected final void parseChildBoxes(ByteBuffer content) { try { while (content.remaining() >= 8) { // 8 is the minimal size for a sane box boxes.add(boxParser.parseBox(new ByteBufferByteChannel(content), this)); } if (content.remaining() != 0) { setDeadBytes(content.slice()); LOG.warning("Something's wrong with the sizes. There are dead bytes in a container box."); } } catch (IOException e) { throw new RuntimeException(e); } }
protected final void parseChildBoxes(ByteBuffer content) { try { while (content.remaining() >= 8) { // 8 is the minimal size for a sane box boxes.add(boxParser.parseBox(new ByteBufferByteChannel(content), this)); } if (content.remaining() != 0) { setDeadBytes(content.slice()); LOG.severe("Some sizes are wrong"); } } catch (IOException e) { throw new RuntimeException(e); } }
public void _parseChildBoxes(ByteBuffer content) { while (content.remaining() > 8) { try { boxes.add(boxParser.parseBox(new ByteBufferByteChannel(content), this)); } catch (IOException e) { throw new RuntimeException(e); } } setDeadBytes(content.slice()); }
public void _parseChildBoxes(ByteBuffer content) { while (content.remaining() > 8) { try { boxes.add(boxParser.parseBox(new ByteBufferByteChannel(content), this)); } catch (IOException e) { throw new RuntimeException(e); } } setDeadBytes(content.slice()); }
@Override public void _parseDetails(ByteBuffer content) { int pos = content.position(); content.get(new byte[4]); String isHdlr = IsoTypeReader.read4cc(content); if ("hdlr".equals(isHdlr)) { // this is apple bullshit - it's NO FULLBOX content.position(pos); version = -1; flags = -1; } else { content.position(pos); version = IsoTypeReader.readUInt8(content); flags = IsoTypeReader.readUInt24(content); } while (content.remaining() >= 8) { try { boxes.add(boxParser.parseBox(new ByteBufferByteChannel(content), this)); } catch (IOException e) { throw new RuntimeException("Sebastian needs to fix 7518765283"); } } if (content.remaining() > 0) { throw new RuntimeException("Sebastian needs to fix it 90732r26537"); } }
@Override public void _parseDetails(ByteBuffer content) { int pos = content.position(); content.get(new byte[4]); String isHdlr = IsoTypeReader.read4cc(content); if ("hdlr".equals(isHdlr)) { // this is apple bullshit - it's NO FULLBOX content.position(pos); version = -1; flags = -1; } else { content.position(pos); version = IsoTypeReader.readUInt8(content); flags = IsoTypeReader.readUInt24(content); } while (content.remaining() >= 8) { try { boxes.add(boxParser.parseBox(new ByteBufferByteChannel(content), this)); } catch (IOException e) { throw new RuntimeException("Sebastian needs to fix 7518765283"); } } if (content.remaining() > 0) { throw new RuntimeException("Sebastian needs to fix it 90732r26537"); } }
@Override public void _parseDetails(ByteBuffer content) { long dataBoxSize = IsoTypeReader.readUInt32(content); String thisShouldBeData = IsoTypeReader.read4cc(content); assert "data".equals(thisShouldBeData); appleDataBox = new AppleDataBox(); try { appleDataBox.parse(new ByteBufferByteChannel(content), null, content.remaining(), null); } catch (IOException e) { throw new RuntimeException(e); } appleDataBox.setParent(this); }
@Override public void _parseDetails(ByteBuffer content) { long dataBoxSize = IsoTypeReader.readUInt32(content); String thisShouldBeData = IsoTypeReader.read4cc(content); assert "data".equals(thisShouldBeData); appleDataBox = new AppleDataBox(); try { appleDataBox.parse(new ByteBufferByteChannel(content), null, content.remaining(), null); } catch (IOException e) { throw new RuntimeException(e); } appleDataBox.setParent(this); }
sps.add(nal.slice()); nal.position(1); new SequenceParameterSetRbsp(Channels.newInputStream(new ByteBufferByteChannel(nal.slice()))); System.err.println("Stored SPS"); break;
public VideoParameterSet(ByteBuffer vps) throws IOException { this.vps = vps; CAVLCReader r = new CAVLCReader(Channels.newInputStream(new ByteBufferByteChannel((ByteBuffer) vps.position(0)))); vps_parameter_set_id = r.readU(4, "vps_parameter_set_id"); int vps_reserved_three_2bits = r.readU(2, "vps_reserved_three_2bits");
public int getFrameRate(ByteBuffer vps) throws IOException { CAVLCReader r = new CAVLCReader(Channels.newInputStream(new ByteBufferByteChannel((ByteBuffer) vps.position(0)))); int vps_parameter_set_id = r.readU(4, "vps_parameter_set_id"); int vps_reserved_three_2bits = r.readU(2, "vps_reserved_three_2bits");