ToxAV


Description:

Public audio/video API for Tox clients.

This API can handle multiple calls. Each call has its state, in very rare occasions the library can change the state of the call without apps knowledge.

Events and callbacks

As in Core API, events are handled by callbacks. One callback can be registered per event. All events have a callback function type named `toxav_{event}_cb` and a function to register it named `toxav_callback_{event}`. Passing a NULL callback will result in no callback being registered for that event. Only one callback per event can be registered, so if a client needs multiple event listeners, it needs to implement the dispatch functionality itself. Unlike Core API, lack of some event handlers will cause the the library to drop calls before they are started. Hanging up call from a callback causes undefined behaviour.

Threading implications

Unlike the Core API, this API is fully thread-safe. The library will ensure the proper synchronization of parallel calls.

A common way to run ToxAV (multiple or single instance) is to have a thread, separate from tox instance thread, running a simple toxav_iterate loop, sleeping for toxav_iteration_interval * milliseconds on each iteration.

An important thing to note is that events are triggered from both tox and toxav thread (see above). Audio and video receive frame events are triggered from toxav thread while all the other events are triggered from tox thread.

Tox thread has priority with mutex mechanisms. Any api function can fail if mutexes are held by tox thread in which case they will set SYNC error code.

Content:

Classes:

Enums:

Delegates: