Generic semantics

oggz_new() - Create an anonymous OGGZ object, which you can later handle via memory buffers

To finish using an OGGZ handle, it should be closed with oggz_close().

Reading Ogg data

To read from Ogg files or streams you must instantiate an OGGZ handle with flags set to OGGZ_READ, and provide an OggzReadPacket callback with oggz_set_read_callback(). See the Oggz Read API section for details.

Writing Ogg data

To write to Ogg files or streams you must instantiate an OGGZ handle with flags set to OGGZ_WRITE, and provide an OggzWritePacket callback with oggz_set_write_callback(). See the Oggz Write API section for details.

Seeking on Ogg data

To seek while reading Ogg files or streams you must instantiate an OGGZ handle for reading, and ensure that an OggzMetric function is defined to translate packet positions into units such as time. See the Oggz Seek API section for details.

Overriding the IO methods

When an OGGZ handle is instantiated by oggz_open() or oggz_open_stdio(), Oggz uses stdio functions internally to access the raw data. However for some applications, the raw data cannot be accessed via stdio – this commonly occurs when integrating with media frameworks. For such applications, you can provide Oggz with custom IO methods that it should use to access the raw data. Oggz will then use these custom methods, rather than using stdio methods, to access the raw data internally.

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.

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.