|
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 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 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 gavl_packet_t * | gavl_packet_sink_get_packet (gavl_packet_sink_t *s) |
| Get a buffer for a packet.
|
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.
◆ gavl_audio_sink_t
Audio sink.
You don't want to know what's inside
◆ gavl_video_sink_t
Video sink.
You don't want to know what's inside
◆ gavl_packet_sink_t
Packet sink.
You don't want to know what's inside
◆ gavl_audio_sink_get_func
Prototype for getting a frame buffer.
- Parameters
-
- Returns
- An audio frame where to copy the data
Sinks can use this to pass specially allocated buffers (e.g. shared or mmaped memory) to the client
◆ gavl_audio_sink_put_func
Prototype for putting a frame.
- Parameters
-
priv | Private data |
f | An audio frame |
- Returns
- GAVL_SINK_ERROR if an error happened, GAVL_SINK_OK else.
◆ gavl_video_sink_get_func
Prototype for getting a frame buffer.
- Parameters
-
- Returns
- A video frame where to copy the data
Sinks can use this to pass specially allocated buffers (e.g. shared or mmaped memory) to the client
◆ gavl_video_sink_put_func
Prototype for putting a frame.
- Parameters
-
priv | Private data |
f | A video frame |
- Returns
- GAVL_SINK_ERROR if an error happened, GAVL_SINK_OK else.
◆ gavl_packet_sink_get_func
typedef gavl_packet_t *(* gavl_packet_sink_get_func) (void *priv) |
Prototype for getting a packet buffer.
- Parameters
-
- Returns
- A packet where to copy the data
Sinks can use this to pass specially allocated buffers (e.g. shared or mmaped memory) to the client
◆ gavl_packet_sink_put_func
◆ gavl_sink_status_t
Return status of the sink functions.
Enumerator |
---|
GAVL_SINK_ERROR | Something went wrong.
|
GAVL_SINK_OK | Frame was successfully processed.
|
◆ gavl_audio_sink_create()
Create an audio sink.
- Parameters
-
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 |
- Returns
- A newly created audio sink
◆ gavl_audio_sink_set_lock_funcs()
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.
- Parameters
-
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_audio_sink_get_format()
Get the format.
- Parameters
-
- Returns
- format in which the sink accepts data
◆ gavl_audio_sink_get_frame()
◆ gavl_audio_sink_put_frame()
◆ gavl_audio_sink_destroy()
Destroy an audio sink.
- Parameters
-
◆ gavl_video_sink_create()
Create a video sink.
- Parameters
-
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 |
- Returns
- A newly created video sink
◆ gavl_video_sink_set_lock_funcs()
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.
- Parameters
-
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_video_sink_get_format()
Get the format.
- Parameters
-
- Returns
- format in which the sink accepts data
◆ gavl_video_sink_get_frame()
◆ gavl_video_sink_put_frame()
◆ gavl_video_sink_destroy()
Destroy a video sink.
- Parameters
-
◆ gavl_packet_sink_create()
Create a packet sink.
- Parameters
-
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 |
- Returns
- A newly created packet sink
◆ gavl_packet_sink_set_lock_funcs()
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.
- Parameters
-
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_packet_sink_get_packet()
◆ gavl_packet_sink_put_packet()
◆ gavl_packet_sink_destroy()
Destroy a packet sink.
- Parameters
-