private void initConverterDataFromPage (final ConverterData converterData) throws JorbisReadException { // Initializes and resets StreamState. converterData.joggData.streamState.init (converterData.joggData.page.serialno ()); converterData.joggData.streamState.reset (); // Initializes the Info and Comment objects. converterData.jorbisData.info.init (); converterData.jorbisData.comment.init (); // Check the page (serial number and stuff). if (converterData.joggData.streamState.pagein (converterData.joggData.page) == -1) { throw new JorbisReadException ("We got an error while reading the first header page."); } /* * Try to extract a packet. All other return values than "1" indicates * there's something wrong. */ if (converterData.joggData.streamState.packetout (converterData.joggData.packet) != 1) { throw new JorbisReadException ("We got an error while reading the first header packet."); } /* * We give the packet to the Info object, so that it can extract the * Comment-related information, among other things. If this fails, it's * not Vorbis data. */ if (converterData.jorbisData.info.synthesis_headerin (converterData.jorbisData.comment, converterData.joggData.packet) < 0) { throw new JorbisReadException ("We got an error while interpreting the first packet. Apparantly, it's not Vorbis data."); } }
void destroy(){ clear(); }
StreamState(int serialno){ this(); init(serialno); }
body_expand(op.bytes); lacing_expand(lacing_val);
/** * Reads a packet. * * @return true if a packet was read, false if we've reached the end of the stream. */ protected boolean readPacket () throws IOException { int result; while ((result = _stream.packetout(_packet)) != 1) { if (result == 0 && !readPage()) { return false; } } return true; }
/** * Reads in a page. * * @return true if a page was read, false if we've reached the end of the stream. */ protected boolean readPage () throws IOException { int result; while ((result = _sync.pageout(_page)) != 1) { if (result == 0 && !readChunk()) { return false; } } _stream.pagein(_page); return true; }
joggStreamState.clear(); if( jorbisBlock != null ) jorbisBlock.clear(); index = 0; joggStreamState = new StreamState(); jorbisBlock = new Block(jorbisDspState); jorbisDspState = new DspState();
private void initJOrbis() { oy = new SyncState(); os = new StreamState(); og = new Page(); op = new Packet(); vi = new Info(); vc = new Comment(); vd = new DspState(); vb = new Block(vd); buffer = null; bytes = 0; oy.init(); }
public void flush() { os.reset(); oy.reset(); inputStream.flush(); }
public int pageout(Page og){ if((e_o_s!=0&&lacing_fill!=0)|| /* 'were done, now flush' case */ body_fill-body_returned>4096|| /* 'page nominal size' case */ lacing_fill>=255|| /* 'segment table full' case */ (lacing_fill!=0&&b_o_s==0)){ /* 'initial header page' case */ return flush(og); } return 0; }
throw new IOException("Input is not an Ogg bitstream."); _stream.init(_page.serialno()); _stream.reset(); if (_stream.pagein(_page) < 0) { throw new IOException("Error reading first page of Ogg bitstream data."); if (_stream.packetout(_packet) != 1) { throw new IOException("Error reading initial header packet.");
void destroy() { clear(); }
StreamState(int serialno){ this(); init(serialno); }
body_expand(op.bytes); lacing_expand(lacing_val);
/** * Reads a packet. * * @return true if a packet was read, false if we've reached the end of the stream. */ protected boolean readPacket () throws IOException { int result; while ((result = _stream.packetout(_packet)) != 1) { if (result == 0 && !readPage()) { return false; } } return true; }
/** * Reads in a page. * * @return true if a page was read, false if we've reached the end of the stream. */ protected boolean readPage () throws IOException { int result; while ((result = _sync.pageout(_page)) != 1) { if (result == 0 && !readChunk()) { return false; } } _stream.pagein(_page); return true; }