byte[] body_data; // unsigned char // bytes from packet bodies
int body_storage; // long //storage elements allocated
int body_fill; // long //elements stored; fill mark
int body_returned; // long //elements of fill returned
int[] lacing_vals; // The values that will go to the segment table
long[] granule_vals; // ogg_int64_t //granulepos values for headers. Not compact this way, but it is simple coupled to the lacing fifo
int lacing_storage; // long
int lacing_fill; // long
int lacing_packet; // long
int lacing_returned; // long
byte[] header; // unsigned char header[282]; //working space for header encode
int header_fill;
int e_o_s; //set when we have buffered the last packet in the logical bitstream
int b_o_s; //set after we've written the initial page of a logical bitstream
int serialno; // long
int pageno; // long
long packetno; // ogg_int64_t // sequence number for decode; the framing knows where there's a hole in the data, but we need coupling so
// that the codec (which is in a seperate abstraction layer) also knows about the gap
long granulepos; // ogg_int64_t
public ogg_stream_state () {
header = new byte[ 282 ];
}
public ogg_stream_state( int _serialno ) {
header = new byte[ 282 ];
body_storage = 16*1024;
// body_data = _ogg_malloc(os->body_storage*sizeof(*os->body_data));
body_data = new byte[ body_storage ];
lacing_storage = 1024;
lacing_vals = new int[ lacing_storage ];
granule_vals = new long[ lacing_storage ];
serialno = _serialno;
}
public int getSerialNo() {
return serialno;
}
// Helpers for ogg_stream_encode; this keeps the structure and what's happening fairly clear
// make sure we have the buffer storage
_os_body_expand( op.bytes );
_os_lacing_expand( lacing_vals_local );
/* Copy in the submitted packet. Yes, the copy is a waste; this is
* the liability of overly clean abstraction for the time being. It
* will actually be fairly easy to eliminate the extra copy in the future */