Writing with OggzHungry callbacks

You can add packets to the Oggz packet queue only when it is "hungry" by providing an OggzHungry callback. More...

You can add packets to the Oggz packet queue only when it is "hungry" by providing an OggzHungry callback.

An OggzHungry callback will:

Once you have set such a callback with oggz_write_set_hungry_callback(), simply call oggz_write() or oggz_write_output() repeatedly, and Oggz will call your callback to provide packets when it is hungry.

This process is illustrated in the following diagram:

hungry.png

The following example code generates a stream of ten packets, each containing a single byte ('A', 'B', ... , 'J'):