|
liboggz 1.1.3
|
Oggz parses Ogg bitstreams, forming ogg_packet structures, and calling your OggzReadPacket callback(s). More...
Typedefs | |
| typedef int(* | OggzReadPacket) (OGGZ *oggz, oggz_packet *packet, long serialno, void *user_data) |
| This is the signature of a callback which you must provide for Oggz to call whenever it finds a new packet in the Ogg stream associated with oggz. | |
| typedef int(* | OggzReadPage) (OGGZ *oggz, const ogg_page *og, long serialno, void *user_data) |
| This is the signature of a callback which you must provide for Oggz to call whenever it finds a new page in the Ogg stream associated with oggz. | |
Functions | |
| int | oggz_set_read_callback (OGGZ *oggz, long serialno, OggzReadPacket read_packet, void *user_data) |
| Set a callback for Oggz to call when a new Ogg packet is found in the stream. | |
| int | oggz_set_read_page (OGGZ *oggz, long serialno, OggzReadPage read_page, void *user_data) |
| Set a callback for Oggz to call when a new Ogg page is found in the stream. | |
| long | oggz_read (OGGZ *oggz, long n) |
| Read n bytes into oggz, calling any read callbacks on the fly. | |
| long | oggz_read_input (OGGZ *oggz, unsigned char *buf, long n) |
| Input data into oggz. | |
Oggz parses Ogg bitstreams, forming ogg_packet structures, and calling your OggzReadPacket callback(s).
You provide Ogg data to Oggz with oggz_read() or oggz_read_input(), and independently process it in OggzReadPacket callbacks. It is possible to set a different callback per serialno (ie. for each logical bitstream in the Ogg bitstream - see the Ogg basics section for more detail).
When using an OGGZ* opened with the OGGZ_AUTO flag set, Oggz will internally calculate the granulepos for each packet, even though these are not all recorded in the file: only the last packet ending on a page will have its granulepos recorded in the page header. Within a OggzReadPacket callback, calling oggz_tell_granulepos() will retrieve the calculated granulepos.
See Oggz Seek API for information on seeking on interleaved Ogg data, and for working with calculated granulepos values.
| typedef int(* OggzReadPacket) (OGGZ *oggz, oggz_packet *packet, long serialno, void *user_data) |
This is the signature of a callback which you must provide for Oggz to call whenever it finds a new packet in the Ogg stream associated with oggz.
| oggz | The OGGZ handle |
| packet | The packet, including its position in the stream. |
| serialno | Identify the logical bistream in oggz that contains packet |
| user_data | A generic pointer you have provided earlier |
| typedef int(* OggzReadPage) (OGGZ *oggz, const ogg_page *og, long serialno, void *user_data) |
This is the signature of a callback which you must provide for Oggz to call whenever it finds a new page in the Ogg stream associated with oggz.
| oggz | The OGGZ handle |
| op | The full ogg_page (see <ogg/ogg.h>) |
| user_data | A generic pointer you have provided earlier |
| long oggz_read | ( | OGGZ * | oggz, |
| long | n ) |
Read n bytes into oggz, calling any read callbacks on the fly.
| oggz | An OGGZ handle previously opened for reading |
| n | A count of bytes to ingest |
| > 0 | The number of bytes successfully ingested. |
| 0 | End of file |
| OGGZ_ERR_BAD_OGGZ | oggz does not refer to an existing OGGZ |
| OGGZ_ERR_INVALID | Operation not suitable for this OGGZ |
| OGGZ_ERR_SYSTEM | System error; check errno for details |
| OGGZ_ERR_STOP_OK | Reading was stopped by a user callback returning OGGZ_STOP_OK |
| OGGZ_ERR_STOP_ERR | Reading was stopped by a user callback returning OGGZ_STOP_ERR |
| OGGZ_ERR_HOLE_IN_DATA | Hole (sequence number gap) detected in input data |
| OGGZ_ERR_OUT_OF_MEMORY | Out of memory |
| long oggz_read_input | ( | OGGZ * | oggz, |
| unsigned char * | buf, | ||
| long | n ) |
Input data into oggz.
| oggz | An OGGZ handle previously opened for reading |
| buf | A memory buffer |
| n | A count of bytes to input |
| > 0 | The number of bytes successfully ingested. |
| OGGZ_ERR_BAD_OGGZ | oggz does not refer to an existing OGGZ |
| OGGZ_ERR_INVALID | Operation not suitable for this OGGZ |
| OGGZ_ERR_STOP_OK | Reading was stopped by a user callback returning OGGZ_STOP_OK |
| OGGZ_ERR_STOP_ERR | Reading was stopped by a user callback returning OGGZ_STOP_ERR |
| OGGZ_ERR_HOLE_IN_DATA | Hole (sequence number gap) detected in input data |
| OGGZ_ERR_OUT_OF_MEMORY | Out of memory |
| int oggz_set_read_callback | ( | OGGZ * | oggz, |
| long | serialno, | ||
| OggzReadPacket | read_packet, | ||
| void * | user_data ) |
Set a callback for Oggz to call when a new Ogg packet is found in the stream.
| oggz | An OGGZ handle previously opened for reading |
| serialno | Identify the logical bitstream in oggz to attach this callback to, or -1 to attach this callback to all unattached logical bitstreams in oggz. |
| read_packet | Your callback function |
| user_data | Arbitrary data you wish to pass to your callback |
| 0 | Success |
| OGGZ_ERR_BAD_SERIALNO | serialno does not identify an existing logical bitstream in oggz. |
| OGGZ_ERR_BAD_OGGZ | oggz does not refer to an existing OGGZ |
| OGGZ_ERR_INVALID | Operation not suitable for this OGGZ |
| OGGZ_ERR_OUT_OF_MEMORY | Out of memory |
| int oggz_set_read_page | ( | OGGZ * | oggz, |
| long | serialno, | ||
| OggzReadPage | read_page, | ||
| void * | user_data ) |
Set a callback for Oggz to call when a new Ogg page is found in the stream.
| oggz | An OGGZ handle previously opened for reading |
| serialno | Identify the logical bitstream in oggz to attach this callback to, or -1 to attach this callback to all unattached logical bitstreams in oggz. |
| read_page | Your OggzReadPage callback function |
| user_data | Arbitrary data you wish to pass to your callback |
| 0 | Success |
| OGGZ_ERR_BAD_OGGZ | oggz does not refer to an existing OGGZ |
| OGGZ_ERR_INVALID | Operation not suitable for this OGGZ |
| OGGZ_ERR_OUT_OF_MEMORY | Out of memory |