After opening an annodex for reading, you can attach various callbacks relevant to the parts of the file you are interested in, including the stream header, track headers, head element, clips and media data. Then, as bytes are read, libannodex will call your callbacks as appropriate.
For tutorial information and examples, refer to the following:
#include <annodex/anx_types.h>
Go to the source code of this file.
Typedefs | |
typedef int(* | AnxReadStream )(ANNODEX *annodex, double timebase, char *utc, void *user_data) |
Signature for a callback called when the 'Annodex' stream header is parsed. | |
typedef int(* | AnxReadTrack )(ANNODEX *annodex, long serialno, char *id, char *content_type, anx_int64_t granule_rate_n, anx_int64_t granule_rate_d, int nr_header_packets, void *user_data) |
Signature for a callback called each time an 'AnxData' track header is parsed. | |
typedef int(* | AnxReadHead )(ANNODEX *annodex, const AnxHead *head, void *user_data) |
Signature for a callback called when the head element is parsed. | |
typedef int(* | AnxReadClip )(ANNODEX *annodex, const AnxClip *clip, void *user_data) |
Signature for a callback called each time a clip element is parsed. | |
typedef int(* | AnxReadRaw )(ANNODEX *annodex, unsigned char *data, long n, long serialno, anx_int64_t granulepos, void *user_data) |
Signature for a callback called each time a raw data packet is found. | |
Functions | |
int | anx_set_read_stream_callback (ANNODEX *annodex, AnxReadStream read_stream, void *user_data) |
Set the function to call each time an 'Annodex' stream header is parsed. | |
void * | anx_get_read_stream_user_data (ANNODEX *annodex) |
Retrieve the user_data associated with an attached AnxReadStream callback. | |
int | anx_set_read_track_callback (ANNODEX *annodex, AnxReadTrack read_track, void *user_data) |
Set the function to call each time an 'AnxData' track header is parsed. | |
void * | anx_get_read_track_user_data (ANNODEX *annodex) |
Retrieve the user_data associated with an attached AnxReadTrack callback. | |
int | anx_set_read_head_callback (ANNODEX *annodex, AnxReadHead read_head, void *user_data) |
Set the function to call when the head element is read. | |
void * | anx_get_read_head_user_data (ANNODEX *annodex) |
Retrieve the user_data associated with an attached AnxReadHead callback. | |
int | anx_set_read_clip_callback (ANNODEX *annodex, AnxReadClip read_clip, void *user_data) |
Set the function to call each time a clip is parsed. | |
void * | anx_get_read_clip_user_data (ANNODEX *annodex) |
Retrieve the user_data associated with an attached AnxReadClip callback. | |
int | anx_set_read_raw_callback (ANNODEX *annodex, AnxReadRaw read_raw, void *user_data) |
Set the function to call each time a raw data packet is read. | |
void * | anx_get_read_raw_user_data (ANNODEX *annodex) |
Retrieve the user_data associated with an attached AnxReadRaw callback. | |
int | anx_set_user_data (ANNODEX *annodex, void *user_data) |
Associate arbitrary data with read callbacks. | |
long | anx_read (ANNODEX *annodex, long n) |
Read from an annodex opened with anx_open() or anx_open_stdio(). | |
long | anx_read_input (ANNODEX *annodex, unsigned char *buf, long n) |
Input data from a memory buffer into an annodex. |
|
Signature for a callback called each time a clip element is parsed.
|
|
Signature for a callback called when the head element is parsed.
|
|
Signature for a callback called each time a raw data packet is found.
|
|
Signature for a callback called when the 'Annodex' stream header is parsed.
|
|
Signature for a callback called each time an 'AnxData' track header is parsed.
|
|
Retrieve the user_data associated with an attached AnxReadClip callback.
|
|
Retrieve the user_data associated with an attached AnxReadHead callback.
|
|
Retrieve the user_data associated with an attached AnxReadRaw callback.
|
|
Retrieve the user_data associated with an attached AnxReadStream callback.
|
|
Retrieve the user_data associated with an attached AnxReadTrack callback.
|
|
Read from an annodex opened with anx_open() or anx_open_stdio(). The annodex is automatically parsed and relevant read callbacks are called, stopping when the required number of bytes have been read, or earlier if any of the read callbacks returned other than ANX_CONTINUE.
|
|
Input data from a memory buffer into an annodex. Usually the annodex would have been created with anx_new(). The annodex is automatically parsed and relevant read callbacks are called, stopping when the required number of bytes have been read, or earlier if any of the read callbacks returned other than ANX_CONTINUE.
|
|
Set the function to call each time a clip is parsed.
|
|
Set the function to call when the head element is read.
|
|
Set the function to call each time a raw data packet is read.
|
|
Set the function to call each time an 'Annodex' stream header is parsed.
|
|
Set the function to call each time an 'AnxData' track header is parsed.
|
|
Associate arbitrary data with read callbacks.
|