|
gavl
|
Typedefs | |
| typedef struct gavl_audio_sink_s | gavl_audio_sink_t |
| Audio sink. | |
| typedef struct gavl_video_sink_s | gavl_video_sink_t |
| Video sink. | |
| typedef struct gavl_packet_sink_s | gavl_packet_sink_t |
| Packet sink. | |
| typedef gavl_audio_frame_t *(* | gavl_audio_sink_get_func) (void *priv) |
| Prototype for getting a frame buffer. | |
| typedef gavl_sink_status_t(* | gavl_audio_sink_put_func) (void *priv, gavl_audio_frame_t *f) |
| Prototype for putting a frame. | |
| typedef gavl_video_frame_t *(* | gavl_video_sink_get_func) (void *priv) |
| Prototype for getting a frame buffer. | |
| typedef gavl_sink_status_t(* | gavl_video_sink_put_func) (void *priv, gavl_video_frame_t *f) |
| Prototype for putting a frame. | |
| typedef gavl_packet_t *(* | gavl_packet_sink_get_func) (void *priv) |
| Prototype for getting a packet buffer. | |
| typedef gavl_sink_status_t(* | gavl_packet_sink_put_func) (void *priv, gavl_packet_t *p) |
| Prototype for putting a frame. | |
Enumerations | |
| enum | gavl_sink_status_t { GAVL_SINK_ERROR , GAVL_SINK_OK } |
| Return status of the sink functions. More... | |
Functions | |
| GAVL_PUBLIC gavl_audio_sink_t * | gavl_audio_sink_create (gavl_audio_sink_get_func get_func, gavl_audio_sink_put_func put_func, void *priv, const gavl_audio_format_t *format) |
| Create an audio sink. | |
| GAVL_PUBLIC void | gavl_audio_sink_set_lock_funcs (gavl_audio_sink_t *sink, gavl_connector_lock_func_t lock_func, gavl_connector_lock_func_t unlock_func, void *priv) |
| Set lock functions. | |
| GAVL_PUBLIC void | gavl_audio_sink_set_free_func (gavl_audio_sink_t *sink, gavl_connector_free_func_t free_func) |
| Set free function. | |
| GAVL_PUBLIC const gavl_audio_format_t * | gavl_audio_sink_get_format (gavl_audio_sink_t *s) |
| Get the format. | |
| GAVL_PUBLIC gavl_audio_frame_t * | gavl_audio_sink_get_frame (gavl_audio_sink_t *s) |
| Get a buffer for a frame. | |
| GAVL_PUBLIC gavl_sink_status_t | gavl_audio_sink_put_frame (gavl_audio_sink_t *s, gavl_audio_frame_t *f) |
| Output a frame. | |
| GAVL_PUBLIC void | gavl_audio_sink_destroy (gavl_audio_sink_t *s) |
| Destroy an audio sink. | |
| GAVL_PUBLIC gavl_video_sink_t * | gavl_video_sink_create (gavl_video_sink_get_func get_func, gavl_video_sink_put_func put_func, void *priv, const gavl_video_format_t *format) |
| Create a video sink. | |
| GAVL_PUBLIC void | gavl_video_sink_set_lock_funcs (gavl_video_sink_t *sink, gavl_connector_lock_func_t lock_func, gavl_connector_lock_func_t unlock_func, void *priv) |
| Set lock functions. | |
| GAVL_PUBLIC void | gavl_video_sink_set_free_func (gavl_video_sink_t *sink, gavl_connector_free_func_t free_func) |
| Set free function. | |
| GAVL_PUBLIC const gavl_video_format_t * | gavl_video_sink_get_format (gavl_video_sink_t *s) |
| Get the format. | |
| GAVL_PUBLIC gavl_video_frame_t * | gavl_video_sink_get_frame (gavl_video_sink_t *s) |
| Get a buffer for a frame. | |
| GAVL_PUBLIC gavl_sink_status_t | gavl_video_sink_put_frame (gavl_video_sink_t *s, gavl_video_frame_t *f) |
| Output a frame. | |
| GAVL_PUBLIC void | gavl_video_sink_destroy (gavl_video_sink_t *s) |
| Destroy a video sink. | |
| GAVL_PUBLIC gavl_packet_sink_t * | gavl_packet_sink_create (gavl_packet_sink_get_func get_func, gavl_packet_sink_put_func put_func, void *priv) |
| Create a packet sink. | |
| GAVL_PUBLIC void | gavl_packet_sink_set_lock_funcs (gavl_packet_sink_t *sink, gavl_connector_lock_func_t lock_func, gavl_connector_lock_func_t unlock_func, void *priv) |
| Set lock functions. | |
| GAVL_PUBLIC void | gavl_packet_sink_set_free_func (gavl_packet_sink_t *sink, gavl_connector_free_func_t free_func) |
| Set free function. | |
| GAVL_PUBLIC gavl_packet_t * | gavl_packet_sink_get_packet (gavl_packet_sink_t *s) |
| Get a buffer for a packet. | |
| GAVL_PUBLIC void | gavl_packet_sink_reset (gavl_packet_sink_t *s) |
| GAVL_PUBLIC gavl_sink_status_t | gavl_packet_sink_put_packet (gavl_packet_sink_t *s, gavl_packet_t *p) |
| Output a frame. | |
| GAVL_PUBLIC void | gavl_packet_sink_destroy (gavl_packet_sink_t *s) |
| Destroy a packet sink. | |
This is a thin layer for a unified handling of A/V sinks. A sink can either supply a frame where the data could be copied or you pass a frame allocated by yourself to the sink. Sinks don't do format conversion. Instead you need to obtain the format and pass this to the source where you read data from.
| typedef struct gavl_audio_sink_s gavl_audio_sink_t |
Audio sink.
You don't want to know what's inside
| typedef struct gavl_video_sink_s gavl_video_sink_t |
Video sink.
You don't want to know what's inside
| typedef struct gavl_packet_sink_s gavl_packet_sink_t |
Packet sink.
You don't want to know what's inside
| typedef gavl_audio_frame_t *(* gavl_audio_sink_get_func) (void *priv) |
Prototype for getting a frame buffer.
| priv | Private data |
Sinks can use this to pass specially allocated buffers (e.g. shared or mmapped memory) to the client
| typedef gavl_sink_status_t(* gavl_audio_sink_put_func) (void *priv, gavl_audio_frame_t *f) |
Prototype for putting a frame.
| priv | Private data |
| f | An audio frame |
| typedef gavl_video_frame_t *(* gavl_video_sink_get_func) (void *priv) |
Prototype for getting a frame buffer.
| priv | Private data |
Sinks can use this to pass specially allocated buffers (e.g. shared or mmapped memory) to the client
| typedef gavl_sink_status_t(* gavl_video_sink_put_func) (void *priv, gavl_video_frame_t *f) |
Prototype for putting a frame.
| priv | Private data |
| f | A video frame |
| typedef gavl_packet_t *(* gavl_packet_sink_get_func) (void *priv) |
Prototype for getting a packet buffer.
| priv | Private data |
Sinks can use this to pass specially allocated buffers (e.g. shared or mmapped memory) to the client
| typedef gavl_sink_status_t(* gavl_packet_sink_put_func) (void *priv, gavl_packet_t *p) |
Prototype for putting a frame.
| priv | Private data |
| p | A packet |
| enum gavl_sink_status_t |
| GAVL_PUBLIC gavl_audio_sink_t * gavl_audio_sink_create | ( | gavl_audio_sink_get_func | get_func, |
| gavl_audio_sink_put_func | put_func, | ||
| void * | priv, | ||
| const gavl_audio_format_t * | format ) |
Create an audio sink.
| get_func | Function for getting a frame buffer or NULL |
| put_func | Function for outputting a frame |
| priv | Client data to pass to get_func and put_func |
| format | Format in which we accept the data |
| GAVL_PUBLIC void gavl_audio_sink_set_lock_funcs | ( | gavl_audio_sink_t * | sink, |
| gavl_connector_lock_func_t | lock_func, | ||
| gavl_connector_lock_func_t | unlock_func, | ||
| void * | priv ) |
Set lock functions.
| sink | An audio sink |
| lock_func | Function called before a packet is read |
| unlock_func | Function called after a packet is read |
| priv | Client data (e.g. a mutex) to pass to the functions |
| GAVL_PUBLIC void gavl_audio_sink_set_free_func | ( | gavl_audio_sink_t * | sink, |
| gavl_connector_free_func_t | free_func ) |
Set free function.
| src | A audio sink |
| free_func | Function called with the private data when the sink is destroyed |
Use this if you don't want to keep a reference to the private data along with the sink
| GAVL_PUBLIC const gavl_audio_format_t * gavl_audio_sink_get_format | ( | gavl_audio_sink_t * | s | ) |
Get the format.
| s | An audio sink |
| GAVL_PUBLIC gavl_audio_frame_t * gavl_audio_sink_get_frame | ( | gavl_audio_sink_t * | s | ) |
Get a buffer for a frame.
| s | An audio sink |
This function must be called before gavl_audio_sink_put_frame. If it returns non-NULL, the same frame must be passed to the next call to gavl_audio_sink_put_frame.
| GAVL_PUBLIC gavl_sink_status_t gavl_audio_sink_put_frame | ( | gavl_audio_sink_t * | s, |
| gavl_audio_frame_t * | f ) |
Output a frame.
| s | An audio sink |
| f | Frame |
The frame must be the same as returned by the preceding call to gavl_audio_sink_get_frame if it was not NULL.
| GAVL_PUBLIC void gavl_audio_sink_destroy | ( | gavl_audio_sink_t * | s | ) |
Destroy an audio sink.
| s | An audio sink |
| GAVL_PUBLIC gavl_video_sink_t * gavl_video_sink_create | ( | gavl_video_sink_get_func | get_func, |
| gavl_video_sink_put_func | put_func, | ||
| void * | priv, | ||
| const gavl_video_format_t * | format ) |
Create a video sink.
| get_func | Function for getting a frame buffer or NULL |
| put_func | Function for outputting a frame |
| priv | Client data to pass to get_func and put_func |
| format | Format in which we accept the data |
| GAVL_PUBLIC void gavl_video_sink_set_lock_funcs | ( | gavl_video_sink_t * | sink, |
| gavl_connector_lock_func_t | lock_func, | ||
| gavl_connector_lock_func_t | unlock_func, | ||
| void * | priv ) |
Set lock functions.
| sink | A video sink |
| lock_func | Function called before a packet is read |
| unlock_func | Function called after a packet is read |
| priv | Client data (e.g. a mutex) to pass to the functions |
| GAVL_PUBLIC void gavl_video_sink_set_free_func | ( | gavl_video_sink_t * | sink, |
| gavl_connector_free_func_t | free_func ) |
Set free function.
| src | A video sink |
| free_func | Function called with the private data when the sink is destroyed |
Use this if you don't want to keep a reference to the private data along with the sink
| GAVL_PUBLIC const gavl_video_format_t * gavl_video_sink_get_format | ( | gavl_video_sink_t * | s | ) |
Get the format.
| s | A video sink |
| GAVL_PUBLIC gavl_video_frame_t * gavl_video_sink_get_frame | ( | gavl_video_sink_t * | s | ) |
Get a buffer for a frame.
| s | A video sink |
This function must be called before gavl_video_sink_put_frame. If it returns non-NULL, the same frame must be passed to the next call to gavl_video_sink_put_frame.
| GAVL_PUBLIC gavl_sink_status_t gavl_video_sink_put_frame | ( | gavl_video_sink_t * | s, |
| gavl_video_frame_t * | f ) |
Output a frame.
| s | A video sink |
| f | Frame |
The frame must be the same as returned by the preceding call to gavl_video_sink_get_frame if it was not NULL.
| GAVL_PUBLIC void gavl_video_sink_destroy | ( | gavl_video_sink_t * | s | ) |
Destroy a video sink.
| s | A video sink |
| GAVL_PUBLIC gavl_packet_sink_t * gavl_packet_sink_create | ( | gavl_packet_sink_get_func | get_func, |
| gavl_packet_sink_put_func | put_func, | ||
| void * | priv ) |
Create a packet sink.
| get_func | Function for getting a packet buffer or NULL |
| put_func | Function for outputting a packet |
| priv | Client data to pass to get_func and put_func |
| GAVL_PUBLIC void gavl_packet_sink_set_lock_funcs | ( | gavl_packet_sink_t * | sink, |
| gavl_connector_lock_func_t | lock_func, | ||
| gavl_connector_lock_func_t | unlock_func, | ||
| void * | priv ) |
Set lock functions.
| sink | A packet sink |
| lock_func | Function called before a packet is read |
| unlock_func | Function called after a packet is read |
| priv | Client data (e.g. a mutex) to pass to the functions |
| GAVL_PUBLIC void gavl_packet_sink_set_free_func | ( | gavl_packet_sink_t * | sink, |
| gavl_connector_free_func_t | free_func ) |
Set free function.
| src | A packet sink |
| free_func | Function called with the private data when the sink is destroyed |
Use this if you don't want to keep a reference to the private data along with the sink
| GAVL_PUBLIC gavl_packet_t * gavl_packet_sink_get_packet | ( | gavl_packet_sink_t * | s | ) |
Get a buffer for a packet.
| s | A packet sink |
This function must be called before gavl_packet_sink_put_packet. If it returns non-NULL, the same frame must be passed to the next call to gavl_packet_sink_put_packet.
| GAVL_PUBLIC gavl_sink_status_t gavl_packet_sink_put_packet | ( | gavl_packet_sink_t * | s, |
| gavl_packet_t * | p ) |
Output a frame.
| s | A packet sink |
| p | Packet |
The frame must be the same as returned by the preceding call to gavl_packet_sink_get_packet if it was not NULL.
| GAVL_PUBLIC void gavl_packet_sink_destroy | ( | gavl_packet_sink_t * | s | ) |
Destroy a packet sink.
| s | A packet sink |