22 #ifndef __BG_MSGQUEUE_H_
23 #define __BG_MSGQUEUE_H_
26 #include <gavl/gavldsp.h>
27 #include <gmerlin/streaminfo.h>
48 #define BG_MSG_NONE -1
49 #define BG_MSG_MAX_ARGS 4
311 const gavl_metadata_t * m);
322 gavl_metadata_t * m);
405 void * cb_data,
int big_endian);
560 void (*set_message)(
bg_msg_t * message,
bg_msg_t * bg_msg_create()
Create a message.
bg_msg_queue_list_t * bg_msg_queue_list_create()
Create a message queue list.
void bg_msg_get_arg_metadata(bg_msg_t *msg, int arg, gavl_metadata_t *m)
Get a matadata argument.
void bg_msg_get_arg_color_rgb(bg_msg_t *msg, int arg, float *value)
Get an RGB color argument.
void bg_msg_set_parameter(bg_msg_t *msg, const char *name, bg_parameter_type_t type, const bg_parameter_value_t *val)
Set a parameter.
void bg_msg_queue_unlock_read(bg_msg_queue_t *mq)
Unlock a message queue for reading.
void bg_msg_destroy(bg_msg_t *msg)
Destroy a message.
void bg_msg_queue_list_destroy(bg_msg_queue_list_t *list)
Destroy a message queue list.
struct gavl_dsp_context_s gavl_dsp_context_t
void bg_msg_get_arg_position(bg_msg_t *msg, int arg, double *value)
Get a position argument.
void bg_msg_queue_list_add(bg_msg_queue_list_t *list, bg_msg_queue_t *queue)
Add a queue to the list.
void bg_msg_set_id(bg_msg_t *msg, int id)
Set the ID of a message.
struct bg_msg_queue_list_s bg_msg_queue_list_t
Opaque message queue list type. You don't want to know what's inside.
Definition: msgqueue.h:538
void bg_msg_set_arg_int(bg_msg_t *msg, int arg, int value)
Set an integer argument.
double bg_msg_get_arg_float(bg_msg_t *msg, int arg)
Get a float argument.
void bg_msg_set_arg_string(bg_msg_t *msg, int arg, const char *value)
Set a string argument.
void bg_msg_set_arg_ptr_nocopy(bg_msg_t *msg, int arg, void *ptr)
Set a pointer argument without copying data.
bg_msg_t * bg_msg_queue_lock_write(bg_msg_queue_t *mq)
Lock a message queue for writing.
void bg_msg_set_arg_time(bg_msg_t *msg, int arg, gavl_time_t value)
Set a time argument.
bg_msg_t * bg_msg_queue_try_lock_read(bg_msg_queue_t *mq)
Try to lock a message queue for reading.
void bg_msg_set_arg_color_rgba(bg_msg_t *msg, int arg, const float *value)
Set an RGBA color argument.
void bg_msg_set_arg_position(bg_msg_t *msg, int arg, const double *value)
Set a position argument.
int(* bg_msg_write_callback_t)(void *priv, const uint8_t *data, int len)
Callback for bg_msg_write.
Definition: msgqueue.h:72
void bg_msg_set_arg_metadata(bg_msg_t *msg, int arg, const gavl_metadata_t *m)
Set a matadata argument.
int bg_msg_read_socket(bg_msg_t *ret, int fd, int milliseconds)
Read a message from a socket.
void bg_msg_queue_unlock_write(bg_msg_queue_t *mq)
Unlock a message queue for writing.
int bg_msg_queue_peek(bg_msg_queue_t *mq, uint32_t *id)
Check, if there is a message for readinbg available and get the ID.
void * bg_msg_get_arg_ptr_nocopy(bg_msg_t *msg, int arg)
Get a pointer argument without copying data.
void bg_msg_get_arg_audio_format(bg_msg_t *msg, int arg, gavl_audio_format_t *format, int *big_endian)
Get an audio format argument.
void bg_msg_free(bg_msg_t *msg)
Free internal memory of the message.
void bg_msg_set_arg_audio_format(bg_msg_t *msg, int arg, const gavl_audio_format_t *format)
Set an audio format argument.
void bg_msg_get_parameter(bg_msg_t *msg, char **name, bg_parameter_type_t *type, bg_parameter_value_t *val)
Get a parameter.
char * bg_msg_get_arg_string(bg_msg_t *msg, int arg)
Get a string argument.
int bg_msg_get_arg_int(bg_msg_t *msg, int arg)
Get an integer argument.
void bg_msg_set_arg_video_format(bg_msg_t *msg, int arg, const gavl_video_format_t *format)
Set a video format argument.
int bg_msg_read(bg_msg_t *ret, bg_msg_read_callback_t cb, void *cb_data)
Read a message using a callback.
void * bg_msg_set_arg_ptr(bg_msg_t *msg, int arg, int len)
Set a binary data argument.
bg_msg_queue_t * bg_msg_queue_create()
Create a message queue.
struct bg_msg_s bg_msg_t
Opaque message type, you don't want to know what's inside.
Definition: msgqueue.h:54
int bg_msg_get_id(bg_msg_t *msg)
Get the ID of a message.
gavl_time_t bg_msg_get_arg_time(bg_msg_t *msg, int arg)
Get a time argument.
bg_parameter_type_t
Parameter type.
Definition: parameter.h:53
void bg_msg_set_arg_color_rgb(bg_msg_t *msg, int arg, const float *value)
Set an RGB color argument.
void bg_msg_queue_list_remove(bg_msg_queue_list_t *list, bg_msg_queue_t *queue)
Remove a queue from the list.
void bg_msg_get_arg_color_rgba(bg_msg_t *msg, int arg, float *value)
Get an RGBA color argument.
Container for a parameter value.
Definition: parameter.h:82
void * bg_msg_get_arg_ptr(bg_msg_t *msg, int arg, int *len)
Set a binary data argument.
void bg_msg_get_arg_video_format(bg_msg_t *msg, int arg, gavl_video_format_t *format, int *big_endian)
Get a video format argument.
void bg_msg_set_arg_float(bg_msg_t *msg, int arg, double value)
Set a float argument.
int bg_msg_write_socket(bg_msg_t *msg, int fd)
Write a message to a socket.
int bg_msg_read_audio_frame(gavl_dsp_context_t *ctx, bg_msg_t *msg, const gavl_audio_format_t *format, gavl_audio_frame_t *frame, bg_msg_read_callback_t cb, void *cb_data, int big_endian)
Read an audio frame.
int bg_msg_write_audio_frame(bg_msg_t *msg, const gavl_audio_format_t *format, const gavl_audio_frame_t *frame, bg_msg_write_callback_t cb, void *cb_data)
Write an audio frame.
void bg_msg_queue_destroy(bg_msg_queue_t *mq)
Destroy a message queue.
void bg_msg_queue_list_send(bg_msg_queue_list_t *list, void(*set_message)(bg_msg_t *message, const void *data), const void *data)
Send a message to all queues in the list.
struct bg_msg_queue_s bg_msg_queue_t
Opaque message queue type. You don't want to know what's inside.
Definition: msgqueue.h:447
bg_msg_t * bg_msg_queue_lock_read(bg_msg_queue_t *mq)
Lock a message queue for reading.
int bg_msg_write(bg_msg_t *msg, bg_msg_write_callback_t cb, void *cb_data)
Write a message using a callback.
int(* bg_msg_read_callback_t)(void *priv, uint8_t *data, int len)
Callback for bg_msg_read.
Definition: msgqueue.h:63