To finish using an OGGZ handle, it should be closed with oggz_close().
For details, see <oggz/oggz_io.h> .
#include <stdio.h>
#include <sys/types.h>
#include <ogg/ogg.h>
#include <oggz/oggz_constants.h>
#include <oggz/oggz_table.h>
#include <oggz/oggz_off_t.h>
#include <oggz/oggz_read.h>
#include <oggz/oggz_seek.h>
#include <oggz/oggz_write.h>
#include <oggz/oggz_io.h>
#include <oggz/oggz_comments.h>
#include <oggz/oggz_deprecated.h>
Go to the source code of this file.
Typedefs | |
typedef void | OGGZ |
An opaque handle to an Ogg file. | |
Functions | |
OGGZ * | oggz_new (int flags) |
Create a new OGGZ object. | |
OGGZ * | oggz_open (const char *filename, int flags) |
Open an Ogg file, creating an OGGZ handle for it. | |
OGGZ * | oggz_open_stdio (FILE *file, int flags) |
Create an OGGZ handle associated with a stdio stream. | |
int | oggz_flush (OGGZ *oggz) |
Ensure any associated io streams are flushed. | |
long | oggz_run (OGGZ *oggz) |
Run an OGGZ until completion, or error. | |
int | oggz_run_set_blocksize (OGGZ *oggz, long blocksize) |
Set the blocksize to use internally for oggz_run(). | |
int | oggz_close (OGGZ *oggz) |
Close an OGGZ handle. | |
int | oggz_get_bos (OGGZ *oggz, long serialno) |
Determine if a given logical bitstream is at bos (beginning of stream). | |
int | oggz_get_eos (OGGZ *oggz, long serialno) |
Determine if a given logical bitstream is at eos (end of stream). | |
int | oggz_get_numtracks (OGGZ *oggz) |
Query the number of tracks (logical bitstreams). | |
long | oggz_serialno_new (OGGZ *oggz) |
Request a new serialno, as required for a new stream, ensuring the serialno is not yet used for any other streams managed by this OGGZ. |
typedef void OGGZ |
An opaque handle to an Ogg file.
This is returned by oggz_open() or oggz_new(), and is passed to all other oggz_* functions.
int oggz_close | ( | OGGZ * | oggz | ) |
Close an OGGZ handle.
oggz | An OGGZ handle |
0 | Success | |
OGGZ_ERR_BAD_OGGZ | oggz does not refer to an existing OGGZ | |
OGGZ_ERR_SYSTEM | System error; check errno for details |
int oggz_flush | ( | OGGZ * | oggz | ) |
Ensure any associated io streams are flushed.
oggz | An OGGZ handle |
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_SYSTEM | System error; check errno for details |
int oggz_get_bos | ( | OGGZ * | oggz, | |
long | serialno | |||
) |
Determine if a given logical bitstream is at bos (beginning of stream).
oggz | An OGGZ handle | |
serialno | Identify a logical bitstream within oggz, or -1 to query if all logical bitstreams in oggz are at bos |
1 | The given stream is at bos | |
0 | The given stream is not at bos | |
OGGZ_ERR_BAD_SERIALNO | serialno does not identify an existing logical bitstream in oggz. |
int oggz_get_eos | ( | OGGZ * | oggz, | |
long | serialno | |||
) |
Determine if a given logical bitstream is at eos (end of stream).
oggz | An OGGZ handle | |
serialno | Identify a logical bitstream within oggz, or -1 to query if all logical bitstreams in oggz are at eos |
1 | The given stream is at eos | |
0 | The given stream is not at eos | |
OGGZ_ERR_BAD_SERIALNO | serialno does not identify an existing logical bitstream in oggz. |
int oggz_get_numtracks | ( | OGGZ * | oggz | ) |
Query the number of tracks (logical bitstreams).
When reading, this number is incremented every time a new track is found, so the returned value is only correct once the OGGZ is no longer at bos (beginning of stream): see oggz_get_bos() for determining this.
oggz | An OGGZ handle |
OGGZ_ERR_BAD_SERIALNO | serialno does not identify an existing logical bitstream in oggz. |
OGGZ* oggz_new | ( | int | flags | ) |
Create a new OGGZ object.
flags | OGGZ_READ or OGGZ_WRITE |
NULL | on system error; check errno for details |
OGGZ* oggz_open | ( | const char * | filename, | |
int | flags | |||
) |
Open an Ogg file, creating an OGGZ handle for it.
filename | The file to open | |
flags | OGGZ_READ or OGGZ_WRITE |
NULL | System error; check errno for details |
OGGZ* oggz_open_stdio | ( | FILE * | file, | |
int | flags | |||
) |
Create an OGGZ handle associated with a stdio stream.
file | An open FILE handle | |
flags | OGGZ_READ or OGGZ_WRITE |
NULL | System error; check errno for details |
long oggz_run | ( | OGGZ * | oggz | ) |
Run an OGGZ until completion, or error.
This is a convenience function which repeatedly calls oggz_read() or oggz_write() as appropriate. For an OGGZ opened for reading, an OggzReadPacket or OggzReadPage callback should have been set before calling this function. For an OGGZ opened for writing, either an OggzHungry callback should have been set before calling this function, or you can use this function to write out all unwritten Ogg pages which are pending.
oggz | An OGGZ handle previously opened for either reading or writing |
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_SYSTEM | System error; check errno for details | |
OGGZ_ERR_STOP_OK | Operation was stopped by a user callback returning OGGZ_STOP_OK | |
OGGZ_ERR_STOP_ERR | Operation was stopped by a user callback returning OGGZ_STOP_ERR | |
OGGZ_ERR_RECURSIVE_WRITE | Attempt to initiate writing from within an OggzHungry callback |
int oggz_run_set_blocksize | ( | OGGZ * | oggz, | |
long | blocksize | |||
) |
Set the blocksize to use internally for oggz_run().
oggz | An OGGZ handle previously opened for either reading or writing | |
blocksize | The blocksize to use within oggz_run() |
0 | Success | |
OGGZ_ERR_BAD_OGGZ | oggz does not refer to an existing OGGZ | |
OGGZ_ERR_INVALID | Invalid blocksize (run_blocksize <= 0) |
long oggz_serialno_new | ( | OGGZ * | oggz | ) |
Request a new serialno, as required for a new stream, ensuring the serialno is not yet used for any other streams managed by this OGGZ.
oggz | An OGGZ handle |