spa: don't use typedef for struct and enum

This commit is contained in:
Wim Taymans 2017-05-25 13:28:15 +02:00
parent 83964cec87
commit 11f23a3ffa
163 changed files with 6510 additions and 8264 deletions

View file

@ -38,11 +38,11 @@ struct context {
int fd;
struct pw_connection *connection;
SpaSource *source;
struct spa_source *source;
bool disconnecting;
struct pw_listener need_flush;
SpaSource *flush_event;
struct spa_source *flush_event;
};
/**
@ -140,7 +140,7 @@ core_event_done (void *object,
static void
core_event_error (void *object,
uint32_t id,
SpaResult res,
int res,
const char *error, ...)
{
struct pw_proxy *proxy = object;
@ -174,7 +174,7 @@ core_event_update_types (void *object,
int i;
for (i = 0; i < n_types; i++, first_id++) {
SpaType this_id = spa_type_map_get_id (this->type.map, types[i]);
uint32_t this_id = spa_type_map_get_id (this->type.map, types[i]);
if (!pw_map_insert_at (&this->types, first_id, PW_MAP_ID_TO_PTR (this_id)))
pw_log_error ("can't add type for client");
}
@ -383,8 +383,8 @@ static const struct pw_registry_events registry_events = {
typedef bool (*demarshal_func_t) (void *object, void *data, size_t size);
static void
do_flush_event (SpaLoopUtils *utils,
SpaSource *source,
do_flush_event (struct spa_loop_utils *utils,
struct spa_source *source,
void *data)
{
struct context *impl = data;
@ -403,10 +403,10 @@ on_need_flush (struct pw_listener *listener,
}
static void
on_context_data (SpaLoopUtils *utils,
SpaSource *source,
on_context_data (struct spa_loop_utils *utils,
struct spa_source *source,
int fd,
SpaIO mask,
enum spa_io mask,
void *data)
{
struct context *impl = data;
@ -742,7 +742,7 @@ pw_context_get_core_info (struct pw_context *context,
cb (context, SPA_RESULT_ENUM_END, NULL, user_data);
}
typedef void (*list_func_t) (struct pw_context *, SpaResult, void *, void *);
typedef void (*list_func_t) (struct pw_context *, int, void *, void *);
static void
do_list (struct pw_context *context,

View file

@ -75,9 +75,9 @@ struct pw_context {
uint32_t n_types;
struct pw_map types;
SpaList global_list;
SpaList stream_list;
SpaList proxy_list;
struct spa_list global_list;
struct spa_list stream_list;
struct spa_list proxy_list;
void *protocol_private;

View file

@ -42,7 +42,7 @@ extern "C" {
struct pw_core_methods {
void (*client_update) (void *object,
const SpaDict *props);
const struct spa_dict *props);
void (*sync) (void *object,
uint32_t seq);
void (*get_registry) (void *object,
@ -50,11 +50,11 @@ struct pw_core_methods {
void (*create_node) (void *object,
const char *factory_name,
const char *name,
const SpaDict *props,
const struct spa_dict *props,
uint32_t new_id);
void (*create_client_node) (void *object,
const char *name,
const SpaDict *props,
const struct spa_dict *props,
uint32_t new_id);
void (*update_types) (void *object,
uint32_t first_id,
@ -83,7 +83,7 @@ struct pw_core_events {
uint32_t seq);
void (*error) (void *object,
uint32_t id,
SpaResult res,
int res,
const char *error, ...);
void (*remove_id) (void *object,
uint32_t id);
@ -147,10 +147,10 @@ struct pw_node_events {
#define pw_node_notify_info(r,...) ((struct pw_node_events*)r->iface->events)->info(r,__VA_ARGS__)
struct pw_client_node_buffer {
uint32_t mem_id;
uint32_t offset;
uint32_t size;
SpaBuffer *buffer;
uint32_t mem_id;
uint32_t offset;
uint32_t size;
struct spa_buffer *buffer;
};
#define PW_CLIENT_NODE_METHOD_UPDATE 0
@ -167,10 +167,10 @@ struct pw_client_node_methods {
uint32_t change_mask,
uint32_t max_input_ports,
uint32_t max_output_ports,
const SpaProps *props);
const struct spa_props *props);
void (*port_update) (void *object,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
#define PW_MESSAGE_PORT_UPDATE_POSSIBLE_FORMATS (1 << 0)
#define PW_MESSAGE_PORT_UPDATE_FORMAT (1 << 1)
@ -178,13 +178,13 @@ struct pw_client_node_methods {
#define PW_MESSAGE_PORT_UPDATE_INFO (1 << 3)
uint32_t change_mask,
uint32_t n_possible_formats,
const SpaFormat **possible_formats,
const SpaFormat *format,
const struct spa_format **possible_formats,
const struct spa_format *format,
uint32_t n_params,
const SpaParam **params,
const SpaPortInfo *info);
const struct spa_param **params,
const struct spa_port_info *info);
void (*event) (void *object,
SpaEvent *event);
struct spa_event *event);
void (*destroy) (void *object);
};
@ -211,28 +211,28 @@ struct pw_client_node_events {
int readfd,
int writefd);
void (*event) (void *object,
const SpaEvent *event);
const struct spa_event *event);
void (*add_port) (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id);
void (*remove_port) (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id);
void (*set_format) (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t flags,
const SpaFormat *format);
const struct spa_format *format);
void (*set_property) (void *object,
uint32_t seq,
uint32_t id,
uint32_t size,
const void *value);
void (*add_mem) (void *object,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t mem_id,
uint32_t type,
@ -242,16 +242,16 @@ struct pw_client_node_events {
uint32_t size);
void (*use_buffers) (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t n_buffers,
struct pw_client_node_buffer *buffers);
void (*node_command) (void *object,
uint32_t seq,
const SpaCommand *command);
const struct spa_command *command);
void (*port_command) (void *object,
uint32_t port_id,
const SpaCommand *command);
const struct spa_command *command);
void (*transport) (void *object,
int memfd,
uint32_t offset,

View file

@ -103,9 +103,9 @@ pw_link_state_as_string (enum pw_link_state state)
}
static void
pw_spa_dict_destroy (SpaDict *dict)
pw_spa_dict_destroy (struct spa_dict *dict)
{
SpaDictItem *item;
struct spa_dict_item *item;
spa_dict_for_each (item, dict) {
free ((void *)item->key);
@ -115,19 +115,19 @@ pw_spa_dict_destroy (SpaDict *dict)
free (dict);
}
static SpaDict *
pw_spa_dict_copy (SpaDict *dict)
static struct spa_dict *
pw_spa_dict_copy (struct spa_dict *dict)
{
SpaDict *copy;
struct spa_dict *copy;
uint32_t i;
if (dict == NULL)
return NULL;
copy = calloc (1, sizeof (SpaDict));
copy = calloc (1, sizeof (struct spa_dict));
if (copy == NULL)
goto no_mem;
copy->items = calloc (dict->n_items, sizeof (SpaDictItem));
copy->items = calloc (dict->n_items, sizeof (struct spa_dict_item));
if (copy->items == NULL)
goto no_items;
copy->n_items = dict->n_items;
@ -246,7 +246,7 @@ pw_node_info_update (struct pw_node_info *info,
free (info->input_formats[i]);
info->n_input_formats = update->n_input_formats;
if (info->n_input_formats)
info->input_formats = realloc (info->input_formats, info->n_input_formats * sizeof (SpaFormat *));
info->input_formats = realloc (info->input_formats, info->n_input_formats * sizeof (struct spa_format *));
else {
free (info->input_formats);
info->input_formats = NULL;
@ -262,7 +262,7 @@ pw_node_info_update (struct pw_node_info *info,
free (info->output_formats[i]);
info->n_output_formats = update->n_output_formats;
if (info->n_output_formats)
info->output_formats = realloc (info->output_formats, info->n_output_formats * sizeof (SpaFormat *));
info->output_formats = realloc (info->output_formats, info->n_output_formats * sizeof (struct spa_format *));
else {
free (info->output_formats);
info->output_formats = NULL;

View file

@ -122,7 +122,7 @@ struct pw_core_info {
const char *version;
const char *name;
uint32_t cookie;
SpaDict *props;
struct spa_dict *props;
};
struct pw_core_info * pw_core_info_update (struct pw_core_info *info,
@ -138,7 +138,7 @@ void pw_core_info_free (struct pw_core_info *info);
* Callback with information about the PipeWire core in @info.
*/
typedef void (*pw_core_info_cb_t) (struct pw_context *c,
SpaResult res,
int res,
const struct pw_core_info *info,
void *user_data);
@ -161,7 +161,7 @@ struct pw_module_info {
const char *name;
const char *filename;
const char *args;
SpaDict *props;
struct spa_dict *props;
};
struct pw_module_info * pw_module_info_update (struct pw_module_info *info,
@ -178,7 +178,7 @@ void pw_module_info_free (struct pw_module_info *inf
* Callback with information about the PipeWire module in @info.
*/
typedef void (*pw_module_info_cb_t) (struct pw_context *c,
SpaResult res,
int res,
const struct pw_module_info *info,
void *user_data);
@ -202,7 +202,7 @@ void pw_context_get_module_info_by_id (struct pw_context *context,
struct pw_client_info {
uint32_t id;
uint64_t change_mask;
SpaDict *props;
struct spa_dict *props;
};
struct pw_client_info * pw_client_info_update (struct pw_client_info *info,
@ -219,7 +219,7 @@ void pw_client_info_free (struct pw_client_info *inf
* Callback with information about the PipeWire client in @info.
*/
typedef void (*pw_client_info_cb_t) (struct pw_context *c,
SpaResult res,
int res,
const struct pw_client_info *info,
void *user_data);
@ -250,14 +250,14 @@ struct pw_node_info {
uint32_t max_inputs;
uint32_t n_inputs;
uint32_t n_input_formats;
SpaFormat **input_formats;
struct spa_format **input_formats;
uint32_t max_outputs;
uint32_t n_outputs;
uint32_t n_output_formats;
SpaFormat **output_formats;
struct spa_format **output_formats;
enum pw_node_state state;
const char *error;
SpaDict *props;
struct spa_dict *props;
};
struct pw_node_info * pw_node_info_update (struct pw_node_info *info,
@ -273,7 +273,7 @@ void pw_node_info_free (struct pw_node_info *info);
* Callback with information about the PipeWire node in @info.
*/
typedef void (*pw_node_info_cb_t) (struct pw_context *c,
SpaResult res,
int res,
const struct pw_node_info *info,
void *user_data);
@ -321,7 +321,7 @@ void pw_link_info_free (struct pw_link_info *info);
* Callback with information about the PipeWire link in @info.
*/
typedef void (*pw_link_info_cb_t) (struct pw_context *c,
SpaResult res,
int res,
const struct pw_link_info *info,
void *user_data);

View file

@ -27,27 +27,27 @@
#define DEFAULT_LOG_LEVEL SPA_LOG_LEVEL_ERROR
SpaLogLevel pw_log_level = DEFAULT_LOG_LEVEL;
enum spa_log_level pw_log_level = DEFAULT_LOG_LEVEL;
#define TRACE_BUFFER (16*1024)
typedef struct {
SpaLog log;
SpaRingbuffer trace_rb;
struct debug_log {
struct spa_log log;
struct spa_ringbuffer trace_rb;
uint8_t trace_data[TRACE_BUFFER];
SpaSource *source;
} DebugLog;
struct spa_source *source;
};
static void
do_logv (SpaLog *log,
SpaLogLevel level,
const char *file,
int line,
const char *func,
const char *fmt,
va_list args)
do_logv (struct spa_log *log,
enum spa_log_level level,
const char *file,
int line,
const char *func,
const char *fmt,
va_list args)
{
DebugLog *l = SPA_CONTAINER_OF (log, DebugLog, log);
struct debug_log *l = SPA_CONTAINER_OF (log, struct debug_log, log);
char text[1024], location[1024];
static const char *levels[] = { "-", "E", "W", "I", "D", "T", "*T*"};
int size;
@ -77,12 +77,12 @@ do_logv (SpaLog *log,
}
static void
do_log (SpaLog *log,
SpaLogLevel level,
const char *file,
int line,
const char *func,
const char *fmt, ...)
do_log (struct spa_log *log,
enum spa_log_level level,
const char *file,
int line,
const char *func,
const char *fmt, ...)
{
va_list args;
va_start (args, fmt);
@ -90,8 +90,8 @@ do_log (SpaLog *log,
va_end (args);
}
static DebugLog log = {
{ sizeof (SpaLog),
static struct debug_log log = {
{ sizeof (struct spa_log),
NULL,
DEFAULT_LOG_LEVEL,
do_log,
@ -100,21 +100,21 @@ static DebugLog log = {
{ 0, 0, TRACE_BUFFER, TRACE_BUFFER - 1 },
};
SpaLog *
struct spa_log *
pw_log_get (void)
{
return &log.log;
}
void
pw_log_set_level (SpaLogLevel level)
pw_log_set_level (enum spa_log_level level)
{
pw_log_level = level;
log.log.level = level;
}
static void
on_trace_event (SpaSource *source)
on_trace_event (struct spa_source *source)
{
int32_t avail;
uint32_t index;
@ -143,7 +143,7 @@ on_trace_event (SpaSource *source)
}
void
pw_log_set_trace_event (SpaSource *source)
pw_log_set_trace_event (struct spa_source *source)
{
log.source = source;
log.source->func = on_trace_event;
@ -151,11 +151,11 @@ pw_log_set_trace_event (SpaSource *source)
}
void
pw_log_log (SpaLogLevel level,
const char *file,
int line,
const char *func,
const char *fmt, ...)
pw_log_log (enum spa_log_level level,
const char *file,
int line,
const char *func,
const char *fmt, ...)
{
if (SPA_UNLIKELY (pw_log_level_enabled (level))) {
va_list args;
@ -166,12 +166,12 @@ pw_log_log (SpaLogLevel level,
}
void
pw_log_logv (SpaLogLevel level,
const char *file,
int line,
const char *func,
const char *fmt,
va_list args)
pw_log_logv (enum spa_log_level level,
const char *file,
int line,
const char *func,
const char *fmt,
va_list args)
{
if (SPA_UNLIKELY (pw_log_level_enabled (level))) {
do_logv (&log.log, level, file, line, func, fmt, args);

View file

@ -27,25 +27,25 @@
extern "C" {
#endif
extern SpaLogLevel pw_log_level;
extern enum spa_log_level pw_log_level;
SpaLog * pw_log_get (void);
struct spa_log* pw_log_get (void);
void pw_log_set_level (SpaLogLevel level);
void pw_log_set_trace_event (SpaSource *source);
void pw_log_set_level (enum spa_log_level level);
void pw_log_set_trace_event (struct spa_source *source);
void pw_log_log (SpaLogLevel level,
const char *file,
int line,
const char *func,
const char *fmt, ...) SPA_PRINTF_FUNC(5, 6);
void pw_log_logv (SpaLogLevel level,
const char *file,
int line,
const char *func,
const char *fmt,
va_list args) SPA_PRINTF_FUNC(5, 0);
void pw_log_log (enum spa_log_level level,
const char *file,
int line,
const char *func,
const char *fmt, ...) SPA_PRINTF_FUNC(5, 6);
void pw_log_logv (enum spa_log_level level,
const char *file,
int line,
const char *func,
const char *fmt,
va_list args) SPA_PRINTF_FUNC(5, 0);
#define pw_log_level_enabled(lev) (pw_log_level >= (lev))

View file

@ -38,56 +38,56 @@
#define DATAS_SIZE (4096 * 8)
struct invoke_item {
size_t item_size;
SpaInvokeFunc func;
uint32_t seq;
size_t size;
void *data;
void *user_data;
size_t item_size;
spa_invoke_func_t func;
uint32_t seq;
size_t size;
void *data;
void *user_data;
};
struct loop {
struct impl {
struct pw_loop this;
SpaList source_list;
struct spa_list source_list;
SpaLoopHook pre_func;
SpaLoopHook post_func;
spa_loop_hook_t pre_func;
spa_loop_hook_t post_func;
void *hook_data;
int epoll_fd;
pthread_t thread;
SpaLoop loop;
SpaLoopControl control;
SpaLoopUtils utils;
struct spa_loop loop;
struct spa_loop_control control;
struct spa_loop_utils utils;
SpaSource *event;
struct spa_source *event;
SpaRingbuffer buffer;
struct spa_ringbuffer buffer;
uint8_t buffer_data[DATAS_SIZE];
};
typedef struct {
SpaSource source;
struct source_impl {
struct spa_source source;
struct loop *impl;
SpaList link;
struct impl *impl;
struct spa_list link;
bool close;
union {
SpaSourceIOFunc io;
SpaSourceIdleFunc idle;
SpaSourceEventFunc event;
SpaSourceTimerFunc timer;
SpaSourceSignalFunc signal;
spa_source_io_func_t io;
spa_source_idle_func_t idle;
spa_source_event_func_t event;
spa_source_timer_func_t timer;
spa_source_signal_func_t signal;
} func;
int signal_number;
bool enabled;
} SpaSourceImpl;
};
static inline uint32_t
spa_io_to_epoll (SpaIO mask)
spa_io_to_epoll (enum spa_io mask)
{
uint32_t events = 0;
@ -103,10 +103,10 @@ spa_io_to_epoll (SpaIO mask)
return events;
}
static inline SpaIO
static inline enum spa_io
spa_epoll_to_io (uint32_t events)
{
SpaIO mask = 0;
enum spa_io mask = 0;
if (events & EPOLLIN)
mask |= SPA_IO_IN;
@ -120,11 +120,11 @@ spa_epoll_to_io (uint32_t events)
return mask;
}
static SpaResult
loop_add_source (SpaLoop *loop,
SpaSource *source)
static int
loop_add_source (struct spa_loop *loop,
struct spa_source *source)
{
struct loop *impl = SPA_CONTAINER_OF (loop, struct loop, loop);
struct impl *impl = SPA_CONTAINER_OF (loop, struct impl, loop);
source->loop = loop;
@ -141,11 +141,11 @@ loop_add_source (SpaLoop *loop,
return SPA_RESULT_OK;
}
static SpaResult
loop_update_source (SpaSource *source)
static int
loop_update_source (struct spa_source *source)
{
SpaLoop *loop = source->loop;
struct loop *impl = SPA_CONTAINER_OF (loop, struct loop, loop);
struct spa_loop *loop = source->loop;
struct impl *impl = SPA_CONTAINER_OF (loop, struct impl, loop);
if (source->fd != -1) {
struct epoll_event ep;
@ -161,10 +161,10 @@ loop_update_source (SpaSource *source)
}
static void
loop_remove_source (SpaSource *source)
loop_remove_source (struct spa_source *source)
{
SpaLoop *loop = source->loop;
struct loop *impl = SPA_CONTAINER_OF (loop, struct loop, loop);
struct spa_loop *loop = source->loop;
struct impl *impl = SPA_CONTAINER_OF (loop, struct impl, loop);
if (source->fd != -1)
epoll_ctl (impl->epoll_fd, EPOLL_CTL_DEL, source->fd, NULL);
@ -172,18 +172,18 @@ loop_remove_source (SpaSource *source)
source->loop = NULL;
}
static SpaResult
loop_invoke (SpaLoop *loop,
SpaInvokeFunc func,
uint32_t seq,
size_t size,
void *data,
void *user_data)
static int
loop_invoke (struct spa_loop *loop,
spa_invoke_func_t func,
uint32_t seq,
size_t size,
void *data,
void *user_data)
{
struct loop *impl = SPA_CONTAINER_OF (loop, struct loop, loop);
struct impl *impl = SPA_CONTAINER_OF (loop, struct impl, loop);
bool in_thread = pthread_equal (impl->thread, pthread_self());
struct invoke_item *item;
SpaResult res;
int res;
if (in_thread) {
res = func (loop, false, seq, size, data, user_data);
@ -237,11 +237,11 @@ loop_invoke (SpaLoop *loop,
}
static void
event_func (SpaLoopUtils *utils,
SpaSource *source,
event_func (struct spa_loop_utils *utils,
struct spa_source *source,
void *data)
{
struct loop *impl = data;
struct impl *impl = data;
uint32_t index;
while (spa_ringbuffer_get_read_index (&impl->buffer, &index) > 0) {
@ -252,20 +252,20 @@ event_func (SpaLoopUtils *utils,
}
static int
loop_get_fd (SpaLoopControl *ctrl)
loop_get_fd (struct spa_loop_control *ctrl)
{
struct loop *impl = SPA_CONTAINER_OF (ctrl, struct loop, control);
struct impl *impl = SPA_CONTAINER_OF (ctrl, struct impl, control);
return impl->epoll_fd;
}
static void
loop_set_hooks (SpaLoopControl *ctrl,
SpaLoopHook pre_func,
SpaLoopHook post_func,
loop_set_hooks (struct spa_loop_control *ctrl,
spa_loop_hook_t pre_func,
spa_loop_hook_t post_func,
void *data)
{
struct loop *impl = SPA_CONTAINER_OF (ctrl, struct loop, control);
struct impl *impl = SPA_CONTAINER_OF (ctrl, struct impl, control);
impl->pre_func = pre_func;
impl->post_func = post_func;
@ -273,24 +273,24 @@ loop_set_hooks (SpaLoopControl *ctrl,
}
static void
loop_enter (SpaLoopControl *ctrl)
loop_enter (struct spa_loop_control *ctrl)
{
struct loop *impl = SPA_CONTAINER_OF (ctrl, struct loop, control);
struct impl *impl = SPA_CONTAINER_OF (ctrl, struct impl, control);
impl->thread = pthread_self();
}
static void
loop_leave (SpaLoopControl *ctrl)
loop_leave (struct spa_loop_control *ctrl)
{
struct loop *impl = SPA_CONTAINER_OF (ctrl, struct loop, control);
struct impl *impl = SPA_CONTAINER_OF (ctrl, struct impl, control);
impl->thread = 0;
}
static SpaResult
loop_iterate (SpaLoopControl *ctrl,
static int
loop_iterate (struct spa_loop_control *ctrl,
int timeout)
{
struct loop *impl = SPA_CONTAINER_OF (ctrl, struct loop, control);
struct impl *impl = SPA_CONTAINER_OF (ctrl, struct impl, control);
struct pw_loop *loop = &impl->this;
struct epoll_event ep[32];
int i, nfds, save_errno;
@ -315,11 +315,11 @@ loop_iterate (SpaLoopControl *ctrl,
* some callback might also want to look at other sources it manages and
* can then reset the rmask to suppress the callback */
for (i = 0; i < nfds; i++) {
SpaSource *source = ep[i].data.ptr;
struct spa_source *source = ep[i].data.ptr;
source->rmask = spa_epoll_to_io (ep[i].events);
}
for (i = 0; i < nfds; i++) {
SpaSource *source = ep[i].data.ptr;
struct spa_source *source = ep[i].data.ptr;
if (source->rmask) {
source->func (source);
}
@ -328,24 +328,24 @@ loop_iterate (SpaLoopControl *ctrl,
}
static void
source_io_func (SpaSource *source)
source_io_func (struct spa_source *source)
{
SpaSourceImpl *impl = SPA_CONTAINER_OF (source, SpaSourceImpl, source);
struct source_impl *impl = SPA_CONTAINER_OF (source, struct source_impl, source);
impl->func.io (&impl->impl->utils, source, source->fd, source->rmask, source->data);
}
static SpaSource *
loop_add_io (SpaLoopUtils *utils,
static struct spa_source *
loop_add_io (struct spa_loop_utils *utils,
int fd,
SpaIO mask,
enum spa_io mask,
bool close,
SpaSourceIOFunc func,
spa_source_io_func_t func,
void *data)
{
struct loop *impl = SPA_CONTAINER_OF (utils, struct loop, utils);
SpaSourceImpl *source;
struct impl *impl = SPA_CONTAINER_OF (utils, struct impl, utils);
struct source_impl *source;
source = calloc (1, sizeof (SpaSourceImpl));
source = calloc (1, sizeof (struct source_impl));
if (source == NULL)
return NULL;
@ -365,9 +365,9 @@ loop_add_io (SpaLoopUtils *utils,
return &source->source;
}
static SpaResult
loop_update_io (SpaSource *source,
SpaIO mask)
static int
loop_update_io (struct spa_source *source,
enum spa_io mask)
{
source->mask = mask;
return spa_loop_update_source (source->loop, source);
@ -375,22 +375,22 @@ loop_update_io (SpaSource *source,
static void
source_idle_func (SpaSource *source)
source_idle_func (struct spa_source *source)
{
SpaSourceImpl *impl = SPA_CONTAINER_OF (source, SpaSourceImpl, source);
struct source_impl *impl = SPA_CONTAINER_OF (source, struct source_impl, source);
impl->func.idle (&impl->impl->utils, source, source->data);
}
static SpaSource *
loop_add_idle (SpaLoopUtils *utils,
static struct spa_source *
loop_add_idle (struct spa_loop_utils *utils,
bool enabled,
SpaSourceIdleFunc func,
spa_source_idle_func_t func,
void *data)
{
struct loop *impl = SPA_CONTAINER_OF (utils, struct loop, utils);
SpaSourceImpl *source;
struct impl *impl = SPA_CONTAINER_OF (utils, struct impl, utils);
struct source_impl *source;
source = calloc (1, sizeof (SpaSourceImpl));
source = calloc (1, sizeof (struct source_impl));
if (source == NULL)
return NULL;
@ -414,10 +414,10 @@ loop_add_idle (SpaLoopUtils *utils,
}
static void
loop_enable_idle (SpaSource *source,
loop_enable_idle (struct spa_source *source,
bool enabled)
{
SpaSourceImpl *impl = SPA_CONTAINER_OF (source, SpaSourceImpl, source);
struct source_impl *impl = SPA_CONTAINER_OF (source, struct source_impl, source);
uint64_t count;
if (enabled && !impl->enabled) {
@ -432,9 +432,9 @@ loop_enable_idle (SpaSource *source,
}
static void
source_event_func (SpaSource *source)
source_event_func (struct spa_source *source)
{
SpaSourceImpl *impl = SPA_CONTAINER_OF (source, SpaSourceImpl, source);
struct source_impl *impl = SPA_CONTAINER_OF (source, struct source_impl, source);
uint64_t count;
if (read (source->fd, &count, sizeof (uint64_t)) != sizeof (uint64_t))
@ -443,15 +443,15 @@ source_event_func (SpaSource *source)
impl->func.event (&impl->impl->utils, source, source->data);
}
static SpaSource *
loop_add_event (SpaLoopUtils *utils,
SpaSourceEventFunc func,
static struct spa_source *
loop_add_event (struct spa_loop_utils *utils,
spa_source_event_func_t func,
void *data)
{
struct loop *impl = SPA_CONTAINER_OF (utils, struct loop, utils);
SpaSourceImpl *source;
struct impl *impl = SPA_CONTAINER_OF (utils, struct impl, utils);
struct source_impl *source;
source = calloc (1, sizeof (SpaSourceImpl));
source = calloc (1, sizeof (struct source_impl));
if (source == NULL)
return NULL;
@ -472,7 +472,7 @@ loop_add_event (SpaLoopUtils *utils,
}
static void
loop_signal_event (SpaSource *source)
loop_signal_event (struct spa_source *source)
{
uint64_t count = 1;
@ -481,9 +481,9 @@ loop_signal_event (SpaSource *source)
}
static void
source_timer_func (SpaSource *source)
source_timer_func (struct spa_source *source)
{
SpaSourceImpl *impl = SPA_CONTAINER_OF (source, SpaSourceImpl, source);
struct source_impl *impl = SPA_CONTAINER_OF (source, struct source_impl, source);
uint64_t expires;
if (read (source->fd, &expires, sizeof (uint64_t)) != sizeof (uint64_t))
@ -492,15 +492,15 @@ source_timer_func (SpaSource *source)
impl->func.timer (&impl->impl->utils, source, source->data);
}
static SpaSource *
loop_add_timer (SpaLoopUtils *utils,
SpaSourceTimerFunc func,
static struct spa_source *
loop_add_timer (struct spa_loop_utils *utils,
spa_source_timer_func_t func,
void *data)
{
struct loop *impl = SPA_CONTAINER_OF (utils, struct loop, utils);
SpaSourceImpl *source;
struct impl *impl = SPA_CONTAINER_OF (utils, struct impl, utils);
struct source_impl *source;
source = calloc (1, sizeof (SpaSourceImpl));
source = calloc (1, sizeof (struct source_impl));
if (source == NULL)
return NULL;
@ -520,8 +520,8 @@ loop_add_timer (SpaLoopUtils *utils,
return &source->source;
}
static SpaResult
loop_update_timer (SpaSource *source,
static int
loop_update_timer (struct spa_source *source,
struct timespec *value,
struct timespec *interval,
bool absolute)
@ -549,9 +549,9 @@ loop_update_timer (SpaSource *source,
}
static void
source_signal_func (SpaSource *source)
source_signal_func (struct spa_source *source)
{
SpaSourceImpl *impl = SPA_CONTAINER_OF (source, SpaSourceImpl, source);
struct source_impl *impl = SPA_CONTAINER_OF (source, struct source_impl, source);
struct signalfd_siginfo signal_info;
if (read (source->fd, &signal_info, sizeof (signal_info)) != sizeof (signal_info))
@ -560,17 +560,17 @@ source_signal_func (SpaSource *source)
impl->func.signal (&impl->impl->utils, source, impl->signal_number, source->data);
}
static SpaSource *
loop_add_signal (SpaLoopUtils *utils,
static struct spa_source *
loop_add_signal (struct spa_loop_utils *utils,
int signal_number,
SpaSourceSignalFunc func,
spa_source_signal_func_t func,
void *data)
{
struct loop *impl = SPA_CONTAINER_OF (utils, struct loop, utils);
SpaSourceImpl *source;
struct impl *impl = SPA_CONTAINER_OF (utils, struct impl, utils);
struct source_impl *source;
sigset_t mask;
source = calloc (1, sizeof (SpaSourceImpl));
source = calloc (1, sizeof (struct source_impl));
if (source == NULL)
return NULL;
@ -595,9 +595,9 @@ loop_add_signal (SpaLoopUtils *utils,
}
static void
loop_destroy_source (SpaSource *source)
loop_destroy_source (struct spa_source *source)
{
SpaSourceImpl *impl = SPA_CONTAINER_OF (source, SpaSourceImpl, source);
struct source_impl *impl = SPA_CONTAINER_OF (source, struct source_impl, source);
spa_list_remove (&impl->link);
@ -611,10 +611,10 @@ loop_destroy_source (SpaSource *source)
struct pw_loop *
pw_loop_new (void)
{
struct loop *impl;
struct impl *impl;
struct pw_loop *this;
impl = calloc (1, sizeof (struct loop));
impl = calloc (1, sizeof (struct impl));
if (impl == NULL)
return NULL;
@ -629,14 +629,14 @@ pw_loop_new (void)
pw_signal_init (&this->before_iterate);
pw_signal_init (&this->destroy_signal);
impl->loop.size = sizeof (SpaLoop);
impl->loop.size = sizeof (struct spa_loop);
impl->loop.add_source = loop_add_source;
impl->loop.update_source = loop_update_source;
impl->loop.remove_source = loop_remove_source;
impl->loop.invoke = loop_invoke;
this->loop = &impl->loop;
impl->control.size = sizeof (SpaLoopControl);
impl->control.size = sizeof (struct spa_loop_control);
impl->control.get_fd = loop_get_fd;
impl->control.set_hooks = loop_set_hooks;
impl->control.enter = loop_enter;
@ -644,7 +644,7 @@ pw_loop_new (void)
impl->control.iterate = loop_iterate;
this->control = &impl->control;
impl->utils.size = sizeof (SpaLoopUtils);
impl->utils.size = sizeof (struct spa_loop_utils);
impl->utils.add_io = loop_add_io;
impl->utils.update_io = loop_update_io;
impl->utils.add_idle = loop_add_idle;
@ -673,8 +673,8 @@ no_epoll:
void
pw_loop_destroy (struct pw_loop *loop)
{
struct loop *impl = SPA_CONTAINER_OF (loop, struct loop, this);
SpaSourceImpl *source, *tmp;
struct impl *impl = SPA_CONTAINER_OF (loop, struct impl, this);
struct source_impl *source, *tmp;
pw_signal_emit (&loop->destroy_signal, loop);

View file

@ -34,9 +34,9 @@ extern "C" {
* PipeWire loop interface.
*/
struct pw_loop {
SpaLoop *loop;
SpaLoopControl *control;
SpaLoopUtils *utils;
struct spa_loop *loop;
struct spa_loop_control *control;
struct spa_loop_utils *utils;
PW_SIGNAL (before_iterate, (struct pw_listener *listener,
struct pw_loop *loop));

View file

@ -27,16 +27,16 @@
#include <pipewire/client/map.h>
typedef struct {
SpaTypeMap map;
struct impl {
struct spa_type_map map;
struct pw_map types;
struct pw_array strings;
} TypeMap;
};
static uint32_t
type_map_get_id (SpaTypeMap *map, const char *type)
type_map_get_id (struct spa_type_map *map, const char *type)
{
TypeMap *this = SPA_CONTAINER_OF (map, TypeMap, map);
struct impl *this = SPA_CONTAINER_OF (map, struct impl, map);
uint32_t i = 0, len;
void *p;
off_t o;
@ -57,9 +57,9 @@ type_map_get_id (SpaTypeMap *map, const char *type)
}
static const char *
type_map_get_type (const SpaTypeMap *map, uint32_t id)
type_map_get_type (const struct spa_type_map *map, uint32_t id)
{
TypeMap *this = SPA_CONTAINER_OF (map, TypeMap, map);
struct impl *this = SPA_CONTAINER_OF (map, struct impl, map);
if (id == SPA_ID_INVALID)
return NULL;
@ -72,14 +72,14 @@ type_map_get_type (const SpaTypeMap *map, uint32_t id)
}
static size_t
type_map_get_size (const SpaTypeMap *map)
type_map_get_size (const struct spa_type_map *map)
{
TypeMap *this = SPA_CONTAINER_OF (map, TypeMap, map);
struct impl *this = SPA_CONTAINER_OF (map, struct impl, map);
return pw_map_get_size (&this->types);
}
static TypeMap default_type_map = {
{ sizeof (SpaTypeMap),
static struct impl default_type_map = {
{ sizeof (struct spa_type_map),
NULL,
type_map_get_id,
type_map_get_type,
@ -89,7 +89,7 @@ static TypeMap default_type_map = {
PW_ARRAY_INIT (4096)
};
SpaTypeMap *
struct spa_type_map *
pw_type_map_get_default (void)
{
spa_type_map_set_default (&default_type_map.map);

View file

@ -75,7 +75,7 @@ static inline int memfd_create(const char *name, unsigned int flags) {
#undef USE_MEMFD
SpaResult
int
pw_memblock_map (struct pw_memblock *mem)
{
if (mem->ptr != NULL)
@ -118,7 +118,7 @@ pw_memblock_map (struct pw_memblock *mem)
return SPA_RESULT_OK;
}
SpaResult
int
pw_memblock_alloc (enum pw_memblock_flags flags,
size_t size,
struct pw_memblock *mem)

View file

@ -45,10 +45,10 @@ struct pw_memblock {
size_t size;
};
SpaResult pw_memblock_alloc (enum pw_memblock_flags flags,
int pw_memblock_alloc (enum pw_memblock_flags flags,
size_t size,
struct pw_memblock *mem);
SpaResult pw_memblock_map (struct pw_memblock *mem);
int pw_memblock_map (struct pw_memblock *mem);
void pw_memblock_free (struct pw_memblock *mem);
#ifdef __cplusplus

View file

@ -51,7 +51,7 @@ void pw_fill_stream_properties (struct pw_properties *properties);
enum pw_direction pw_direction_reverse (enum pw_direction direction);
SpaTypeMap * pw_type_map_get_default (void);
struct spa_type_map * pw_type_map_get_default (void);
#ifdef __cplusplus
}

View file

@ -29,19 +29,19 @@ struct properties {
static void
add_func (struct pw_properties *this, char *key, char *value)
{
SpaDictItem *item;
struct spa_dict_item *item;
struct properties *impl = SPA_CONTAINER_OF (this, struct properties, this);
item = pw_array_add (&impl->items, sizeof (SpaDictItem));
item = pw_array_add (&impl->items, sizeof (struct spa_dict_item));
item->key = key;
item->value = value;
this->dict.items = impl->items.data;
this->dict.n_items = pw_array_get_len (&impl->items, SpaDictItem);
this->dict.n_items = pw_array_get_len (&impl->items, struct spa_dict_item);
}
static void
clear_item (SpaDictItem *item)
clear_item (struct spa_dict_item *item)
{
free ((char*)item->key);
free ((char*)item->value);
@ -51,10 +51,10 @@ static int
find_index (struct pw_properties *this, const char *key)
{
struct properties *impl = SPA_CONTAINER_OF (this, struct properties, this);
int i, len = pw_array_get_len (&impl->items, SpaDictItem);
int i, len = pw_array_get_len (&impl->items, struct spa_dict_item);
for (i = 0; i < len; i++) {
SpaDictItem *item = pw_array_get_unchecked (&impl->items, i, SpaDictItem);
struct spa_dict_item *item = pw_array_get_unchecked (&impl->items, i, struct spa_dict_item);
if (strcmp (item->key, key) == 0)
return i;
}
@ -103,7 +103,7 @@ pw_properties_new (const char *key, ...)
* Returns: a new #struct pw_properties
*/
struct pw_properties *
pw_properties_new_dict (const SpaDict *dict)
pw_properties_new_dict (const struct spa_dict *dict)
{
uint32_t i;
struct properties *impl;
@ -133,7 +133,7 @@ pw_properties_copy (struct pw_properties *properties)
{
struct properties *impl = SPA_CONTAINER_OF (properties, struct properties, this);
struct pw_properties *copy;
SpaDictItem *item;
struct spa_dict_item *item;
copy = pw_properties_new (NULL, NULL);
if (copy == NULL)
@ -185,7 +185,7 @@ void
pw_properties_free (struct pw_properties *properties)
{
struct properties *impl = SPA_CONTAINER_OF (properties, struct properties, this);
SpaDictItem *item;
struct spa_dict_item *item;
pw_array_for_each (item, &impl->items)
clear_item (item);
@ -205,16 +205,16 @@ do_replace (struct pw_properties *properties,
if (index == -1) {
add_func (properties, key, value);
} else {
SpaDictItem *item = pw_array_get_unchecked (&impl->items, index, SpaDictItem);
struct spa_dict_item *item = pw_array_get_unchecked (&impl->items, index, struct spa_dict_item);
clear_item (item);
if (value == NULL) {
SpaDictItem *other = pw_array_get_unchecked (&impl->items,
pw_array_get_len (&impl->items, SpaDictItem) - 1,
SpaDictItem);
struct spa_dict_item *other = pw_array_get_unchecked (&impl->items,
pw_array_get_len (&impl->items, struct spa_dict_item) - 1,
struct spa_dict_item);
item->key = other->key;
item->value = other->value;
impl->items.size -= sizeof (SpaDictItem);
impl->items.size -= sizeof (struct spa_dict_item);
} else {
item->key = key;
item->value = value;
@ -285,7 +285,7 @@ pw_properties_get (struct pw_properties *properties,
if (index == -1)
return NULL;
return pw_array_get_unchecked (&impl->items, index, SpaDictItem)->value;
return pw_array_get_unchecked (&impl->items, index, struct spa_dict_item)->value;
}
/**
@ -314,10 +314,10 @@ pw_properties_iterate (struct pw_properties *properties,
else
index = SPA_PTR_TO_INT (*state);
if (!pw_array_check_index (&impl->items, index, SpaDictItem))
if (!pw_array_check_index (&impl->items, index, struct spa_dict_item))
return NULL;
*state = SPA_INT_TO_PTR (index + 1);
return pw_array_get_unchecked (&impl->items, index, SpaDictItem)->key;
return pw_array_get_unchecked (&impl->items, index, struct spa_dict_item)->key;
}

View file

@ -27,11 +27,11 @@ extern "C" {
#include <spa/dict.h>
struct pw_properties {
SpaDict dict;
struct spa_dict dict;
};
struct pw_properties * pw_properties_new (const char *key, ...);
struct pw_properties * pw_properties_new_dict (const SpaDict *dict);
struct pw_properties * pw_properties_new_dict (const struct spa_dict *dict);
struct pw_properties * pw_properties_copy (struct pw_properties *properties);
struct pw_properties * pw_properties_merge (struct pw_properties *oldprops,
struct pw_properties *newprops);

View file

@ -27,14 +27,14 @@
#include "pipewire/client/connection.h"
struct builder {
SpaPODBuilder b;
struct spa_pod_builder b;
struct pw_connection *connection;
};
typedef bool (*demarshal_func_t) (void *object, void *data, size_t size);
static uint32_t
write_pod (SpaPODBuilder *b, uint32_t ref, const void *data, uint32_t size)
write_pod (struct spa_pod_builder *b, uint32_t ref, const void *data, uint32_t size)
{
if (ref == -1)
ref = b->offset;
@ -71,12 +71,12 @@ core_update_map (struct pw_context *context)
static void
core_marshal_client_update (void *object,
const SpaDict *props)
const struct spa_dict *props)
{
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
int i, n_items;
if (connection == NULL)
@ -108,7 +108,7 @@ core_marshal_sync (void *object,
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
if (connection == NULL)
return;
@ -128,7 +128,7 @@ core_marshal_get_registry (void *object,
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
if (connection == NULL)
return;
@ -145,13 +145,13 @@ static void
core_marshal_create_node (void *object,
const char *factory_name,
const char *name,
const SpaDict *props,
const struct spa_dict *props,
uint32_t new_id)
{
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t i, n_items;
if (connection == NULL)
@ -183,13 +183,13 @@ core_marshal_create_node (void *object,
static void
core_marshal_create_client_node (void *object,
const char *name,
const SpaDict *props,
const struct spa_dict *props,
uint32_t new_id)
{
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t i, n_items;
if (connection == NULL)
@ -226,7 +226,7 @@ core_marshal_update_types (void *object,
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t i;
if (connection == NULL)
@ -253,9 +253,9 @@ core_demarshal_info (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaDict props;
struct spa_dict props;
struct pw_core_info info;
SpaPODIter it;
struct spa_pod_iter it;
int i;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -272,7 +272,7 @@ core_demarshal_info (void *object,
return false;
info.props = &props;
props.items = alloca (props.n_items * sizeof (SpaDictItem));
props.items = alloca (props.n_items * sizeof (struct spa_dict_item));
for (i = 0; i < props.n_items; i++) {
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_STRING, &props.items[i].key,
@ -290,7 +290,7 @@ core_demarshal_done (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t seq;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -309,7 +309,7 @@ core_demarshal_error (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t id, res;
const char *error;
@ -331,7 +331,7 @@ core_demarshal_remove_id (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t id;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -350,7 +350,7 @@ core_demarshal_update_types (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t first_id, n_types;
const char **types;
int i;
@ -377,8 +377,8 @@ module_demarshal_info (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
SpaDict props;
struct spa_pod_iter it;
struct spa_dict props;
struct pw_module_info info;
int i;
@ -394,7 +394,7 @@ module_demarshal_info (void *object,
return false;
info.props = &props;
props.items = alloca (props.n_items * sizeof (SpaDictItem));
props.items = alloca (props.n_items * sizeof (struct spa_dict_item));
for (i = 0; i < props.n_items; i++) {
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_STRING, &props.items[i].key,
@ -412,8 +412,8 @@ node_demarshal_info (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
SpaDict props;
struct spa_pod_iter it;
struct spa_dict props;
struct pw_node_info info;
int i;
@ -429,7 +429,7 @@ node_demarshal_info (void *object,
0))
return false;
info.input_formats = alloca (info.n_input_formats * sizeof (SpaFormat*));
info.input_formats = alloca (info.n_input_formats * sizeof (struct spa_format*));
for (i = 0; i < info.n_input_formats; i++)
if (!spa_pod_iter_get (&it, SPA_POD_TYPE_OBJECT, &info.input_formats[i], 0))
return false;
@ -441,7 +441,7 @@ node_demarshal_info (void *object,
0))
return false;
info.output_formats = alloca (info.n_output_formats * sizeof (SpaFormat*));
info.output_formats = alloca (info.n_output_formats * sizeof (struct spa_format*));
for (i = 0; i < info.n_output_formats; i++)
if (!spa_pod_iter_get (&it, SPA_POD_TYPE_OBJECT, &info.output_formats[i], 0))
return false;
@ -454,7 +454,7 @@ node_demarshal_info (void *object,
return false;
info.props = &props;
props.items = alloca (props.n_items * sizeof (SpaDictItem));
props.items = alloca (props.n_items * sizeof (struct spa_dict_item));
for (i = 0; i < props.n_items; i++) {
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_STRING, &props.items[i].key,
@ -471,12 +471,12 @@ client_node_marshal_update (void *object,
uint32_t change_mask,
uint32_t max_input_ports,
uint32_t max_output_ports,
const SpaProps *props)
const struct spa_props *props)
{
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
if (connection == NULL)
return;
@ -494,20 +494,20 @@ client_node_marshal_update (void *object,
static void
client_node_marshal_port_update (void *object,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t change_mask,
uint32_t n_possible_formats,
const SpaFormat **possible_formats,
const SpaFormat *format,
const struct spa_format **possible_formats,
const struct spa_format *format,
uint32_t n_params,
const SpaParam **params,
const SpaPortInfo *info)
const struct spa_param **params,
const struct spa_port_info *info)
{
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f[2];
struct spa_pod_frame f[2];
int i;
if (connection == NULL)
@ -532,7 +532,7 @@ client_node_marshal_port_update (void *object,
0);
for (i = 0; i < n_params; i++) {
const SpaParam *p = params[i];
const struct spa_param *p = params[i];
spa_pod_builder_add (&b.b, SPA_POD_TYPE_POD, p, 0);
}
@ -553,12 +553,12 @@ client_node_marshal_port_update (void *object,
static void
client_node_marshal_event (void *object,
SpaEvent *event)
struct spa_event *event)
{
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
if (connection == NULL)
return;
@ -577,7 +577,7 @@ client_node_marshal_destroy (void *object)
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
if (connection == NULL)
return;
@ -595,7 +595,7 @@ client_node_demarshal_done (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
struct pw_connection *connection = proxy->context->protocol_private;
int32_t ridx, widx;
int readfd, writefd;
@ -622,8 +622,8 @@ client_node_demarshal_event (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
const SpaEvent *event;
struct spa_pod_iter it;
const struct spa_event *event;
if (!spa_pod_iter_struct (&it, data, size) ||
!pw_pod_remap_data (SPA_POD_TYPE_STRUCT, data, size, &proxy->context->types) ||
@ -642,7 +642,7 @@ client_node_demarshal_add_port (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
int32_t seq, direction, port_id;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -663,7 +663,7 @@ client_node_demarshal_remove_port (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
int32_t seq, direction, port_id;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -684,9 +684,9 @@ client_node_demarshal_set_format (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t seq, direction, port_id, flags;
const SpaFormat *format = NULL;
const struct spa_format *format = NULL;
if (!spa_pod_iter_struct (&it, data, size) ||
!pw_pod_remap_data (SPA_POD_TYPE_STRUCT, data, size, &proxy->context->types) ||
@ -710,7 +710,7 @@ client_node_demarshal_set_property (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t seq, id;
const void *value;
uint32_t s;
@ -733,7 +733,7 @@ client_node_demarshal_add_mem (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
struct pw_connection *connection = proxy->context->protocol_private;
uint32_t direction, port_id, mem_id, type, memfd_idx, flags, offset, sz;
int memfd;
@ -772,7 +772,7 @@ client_node_demarshal_use_buffers (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t seq, direction, port_id, n_buffers, data_id;
struct pw_client_node_buffer *buffers;
int i, j;
@ -789,7 +789,7 @@ client_node_demarshal_use_buffers (void *object,
buffers = alloca (sizeof (struct pw_client_node_buffer) * n_buffers);
for (i = 0; i < n_buffers; i++) {
SpaBuffer *buf = buffers[i].buffer = alloca (sizeof (SpaBuffer));
struct spa_buffer *buf = buffers[i].buffer = alloca (sizeof (struct spa_buffer));
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_INT, &buffers[i].mem_id,
@ -799,9 +799,9 @@ client_node_demarshal_use_buffers (void *object,
SPA_POD_TYPE_INT, &buf->n_metas, 0))
return false;
buf->metas = alloca (sizeof (SpaMeta) * buf->n_metas);
buf->metas = alloca (sizeof (struct spa_meta) * buf->n_metas);
for (j = 0; j < buf->n_metas; j++) {
SpaMeta *m = &buf->metas[j];
struct spa_meta *m = &buf->metas[j];
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_ID, &m->type,
@ -811,9 +811,9 @@ client_node_demarshal_use_buffers (void *object,
if (!spa_pod_iter_get (&it, SPA_POD_TYPE_INT, &buf->n_datas, 0))
return false;
buf->datas = alloca (sizeof (SpaData) * buf->n_datas);
buf->datas = alloca (sizeof (struct spa_data) * buf->n_datas);
for (j = 0; j < buf->n_datas; j++) {
SpaData *d = &buf->datas[j];
struct spa_data *d = &buf->datas[j];
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_ID, &d->type,
@ -842,8 +842,8 @@ client_node_demarshal_node_command (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
const SpaCommand *command;
struct spa_pod_iter it;
const struct spa_command *command;
uint32_t seq;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -864,8 +864,8 @@ client_node_demarshal_port_command (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
const SpaCommand *command;
struct spa_pod_iter it;
const struct spa_command *command;
uint32_t port_id;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -886,7 +886,7 @@ client_node_demarshal_transport (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
struct pw_connection *connection = proxy->context->protocol_private;
uint32_t memfd_idx, offset, sz;
int memfd;
@ -910,8 +910,8 @@ client_demarshal_info (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
SpaDict props;
struct spa_pod_iter it;
struct spa_dict props;
struct pw_client_info info;
uint32_t i;
@ -924,7 +924,7 @@ client_demarshal_info (void *object,
return false;
info.props = &props;
props.items = alloca (props.n_items * sizeof (SpaDictItem));
props.items = alloca (props.n_items * sizeof (struct spa_dict_item));
for (i = 0; i < props.n_items; i++) {
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_STRING, &props.items[i].key,
@ -942,7 +942,7 @@ link_demarshal_info (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
struct pw_link_info info;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -966,7 +966,7 @@ registry_demarshal_global (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t id;
const char *type;
@ -987,7 +987,7 @@ registry_demarshal_global_remove (void *object,
size_t size)
{
struct pw_proxy *proxy = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t id;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -1008,7 +1008,7 @@ registry_marshal_bind (void *object,
struct pw_proxy *proxy = object;
struct pw_connection *connection = proxy->context->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
if (connection == NULL)
return;

View file

@ -30,7 +30,7 @@ extern "C" {
struct pw_proxy {
struct pw_context *context;
SpaList link;
struct spa_list link;
uint32_t id;
uint32_t type;

View file

@ -27,13 +27,13 @@ extern "C" {
#endif
struct pw_listener {
SpaList link;
struct spa_list link;
void (*notify) (void *);
};
#define PW_SIGNAL(name,func) \
union { \
SpaList listeners; \
struct spa_list listeners; \
void (*notify) func; \
} name;

View file

@ -51,25 +51,25 @@ struct mem_id {
};
struct buffer_id {
SpaList link;
struct spa_list link;
uint32_t id;
bool used;
void *buf_ptr;
SpaBuffer *buf;
struct spa_buffer *buf;
};
struct stream {
struct pw_stream this;
uint32_t n_possible_formats;
SpaFormat **possible_formats;
struct spa_format **possible_formats;
uint32_t n_params;
SpaParam **params;
struct spa_param **params;
SpaFormat *format;
SpaPortInfo port_info;
SpaDirection direction;
struct spa_format *format;
struct spa_port_info port_info;
enum spa_direction direction;
uint32_t port_id;
uint32_t pending_seq;
@ -77,7 +77,7 @@ struct stream {
int rtreadfd;
int rtwritefd;
SpaSource *rtsocket_source;
struct spa_source *rtsocket_source;
struct pw_proxy *node_proxy;
bool disconnecting;
@ -85,13 +85,13 @@ struct stream {
struct pw_transport *trans;
SpaSource *timeout_source;
struct spa_source *timeout_source;
struct pw_array mem_ids;
struct pw_array buffer_ids;
bool in_order;
SpaList free;
struct spa_list free;
bool in_need_buffer;
int64_t last_ticks;
@ -272,7 +272,7 @@ unhandle_socket (struct pw_stream *stream)
static void
set_possible_formats (struct pw_stream *stream,
int n_possible_formats,
SpaFormat **possible_formats)
struct spa_format **possible_formats)
{
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
int i;
@ -285,7 +285,7 @@ set_possible_formats (struct pw_stream *stream,
}
impl->n_possible_formats = n_possible_formats;
if (n_possible_formats > 0) {
impl->possible_formats = malloc (n_possible_formats * sizeof (SpaFormat *));
impl->possible_formats = malloc (n_possible_formats * sizeof (struct spa_format *));
for (i = 0; i < n_possible_formats; i++)
impl->possible_formats[i] = spa_format_copy (possible_formats[i]);
}
@ -294,7 +294,7 @@ set_possible_formats (struct pw_stream *stream,
static void
set_params (struct pw_stream *stream,
int n_params,
SpaParam **params)
struct spa_param **params)
{
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
int i;
@ -307,7 +307,7 @@ set_params (struct pw_stream *stream,
}
impl->n_params = n_params;
if (n_params > 0) {
impl->params = malloc (n_params * sizeof (SpaParam *));
impl->params = malloc (n_params * sizeof (struct spa_param *));
for (i = 0; i < n_params; i++)
impl->params[i] = spa_param_copy (params[i]);
}
@ -384,10 +384,10 @@ add_port_update (struct pw_stream *stream, uint32_t change_mask)
impl->port_id,
change_mask,
impl->n_possible_formats,
(const SpaFormat **) impl->possible_formats,
(const struct spa_format **) impl->possible_formats,
impl->format,
impl->n_params,
(const SpaParam **)impl->params,
(const struct spa_param **)impl->params,
&impl->port_info);
}
@ -396,14 +396,10 @@ send_need_input (struct pw_stream *stream)
{
#if 0
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
SpaEventNodeNeedInput ni;
uint64_t cmd = 1;
pw_log_debug ("stream %p: need input", stream);
ni.event.type = SPA_EVENT_NODE_NEED_INPUT;
ni.event.size = sizeof (ni);
pw_transport_add_event (impl->trans, &ni.event);
pw_transport_add_event (impl->trans,
&SPA_EVENT_INIT (stream->context->type.event_transport.NeedInput));
write (impl->rtwritefd, &cmd, 8);
#endif
}
@ -424,7 +420,7 @@ add_request_clock_update (struct pw_stream *stream)
{
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
pw_client_node_do_event (impl->node_proxy, (SpaEvent*)
pw_client_node_do_event (impl->node_proxy, (struct spa_event*)
&SPA_EVENT_NODE_REQUEST_CLOCK_UPDATE_INIT (stream->context->type.event_node.RequestClockUpdate,
SPA_EVENT_NODE_REQUEST_CLOCK_UPDATE_TIME, 0, 0));
}
@ -432,11 +428,11 @@ add_request_clock_update (struct pw_stream *stream)
static void
add_async_complete (struct pw_stream *stream,
uint32_t seq,
SpaResult res)
int res)
{
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
pw_client_node_do_event (impl->node_proxy, (SpaEvent*)
pw_client_node_do_event (impl->node_proxy, (struct spa_event*)
&SPA_EVENT_NODE_ASYNC_COMPLETE_INIT (stream->context->type.event_node.AsyncComplete,
seq, res));
@ -457,8 +453,8 @@ do_node_init (struct pw_stream *stream)
}
static void
on_timeout (SpaLoopUtils *utils,
SpaSource *source,
on_timeout (struct spa_loop_utils *utils,
struct spa_source *source,
void *data)
{
struct pw_stream *stream = data;
@ -512,7 +508,7 @@ reuse_buffer (struct pw_stream *stream, uint32_t id)
static void
handle_rtnode_event (struct pw_stream *stream,
SpaEvent *event)
struct spa_event *event)
{
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
struct pw_context *context = impl->this.context;
@ -521,7 +517,7 @@ handle_rtnode_event (struct pw_stream *stream,
int i;
for (i = 0; i < impl->trans->area->n_inputs; i++) {
SpaPortIO *input = &impl->trans->inputs[i];
struct spa_port_io *input = &impl->trans->inputs[i];
pw_log_trace ("stream %p: have output %d %d", stream, input->status, input->buffer_id);
if (input->buffer_id == SPA_ID_INVALID)
@ -536,7 +532,7 @@ handle_rtnode_event (struct pw_stream *stream,
int i;
for (i = 0; i < impl->trans->area->n_outputs; i++) {
SpaPortIO *output = &impl->trans->outputs[i];
struct spa_port_io *output = &impl->trans->outputs[i];
if (output->buffer_id == SPA_ID_INVALID)
continue;
@ -565,10 +561,10 @@ handle_rtnode_event (struct pw_stream *stream,
}
static void
on_rtsocket_condition (SpaLoopUtils *utils,
SpaSource *source,
on_rtsocket_condition (struct spa_loop_utils *utils,
struct spa_source *source,
int fd,
SpaIO mask,
enum spa_io mask,
void *data)
{
struct pw_stream *stream = data;
@ -581,13 +577,13 @@ on_rtsocket_condition (SpaLoopUtils *utils,
}
if (mask & SPA_IO_IN) {
SpaEvent event;
struct spa_event event;
uint64_t cmd;
read (impl->rtreadfd, &cmd, 8);
while (pw_transport_next_event (impl->trans, &event) == SPA_RESULT_OK) {
SpaEvent *ev = alloca (SPA_POD_SIZE (&event));
struct spa_event *ev = alloca (SPA_POD_SIZE (&event));
pw_transport_parse_event (impl->trans, ev);
handle_rtnode_event (stream, ev);
}
@ -624,7 +620,7 @@ handle_socket (struct pw_stream *stream, int rtreadfd, int rtwritefd)
static void
handle_node_event (struct pw_stream *stream,
const SpaEvent *event)
const struct spa_event *event)
{
pw_log_warn ("unhandled node event %d", SPA_EVENT_TYPE (event));
}
@ -632,7 +628,7 @@ handle_node_event (struct pw_stream *stream,
static bool
handle_node_command (struct pw_stream *stream,
uint32_t seq,
const SpaCommand *command)
const struct spa_command *command)
{
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
struct pw_context *context = stream->context;
@ -671,7 +667,7 @@ handle_node_command (struct pw_stream *stream,
}
}
else if (SPA_COMMAND_TYPE (command) == context->type.command_node.ClockUpdate) {
SpaCommandNodeClockUpdate *cu = (SpaCommandNodeClockUpdate *) command;
struct spa_command_node_clock_update *cu = (struct spa_command_node_clock_update *) command;
if (cu->body.flags.value & SPA_COMMAND_NODE_CLOCK_UPDATE_FLAG_LIVE) {
pw_properties_set (stream->properties,
"pipewire.latency.is-live", "1");
@ -706,7 +702,7 @@ client_node_done (void *object,
static void
client_node_event (void *object,
const SpaEvent *event)
const struct spa_event *event)
{
struct pw_proxy *proxy = object;
struct pw_stream *stream = proxy->user_data;
@ -716,7 +712,7 @@ client_node_event (void *object,
static void
client_node_add_port (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id)
{
pw_log_warn ("add port not supported");
@ -725,7 +721,7 @@ client_node_add_port (void *object,
static void
client_node_remove_port (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id)
{
pw_log_warn ("remove port not supported");
@ -734,10 +730,10 @@ client_node_remove_port (void *object,
static void
client_node_set_format (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t flags,
const SpaFormat *format)
const struct spa_format *format)
{
struct pw_proxy *proxy = object;
struct pw_stream *stream = proxy->user_data;
@ -768,7 +764,7 @@ client_node_set_property (void *object,
static void
client_node_add_mem (void *object,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t mem_id,
uint32_t type,
@ -803,7 +799,7 @@ client_node_add_mem (void *object,
static void
client_node_use_buffers (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t n_buffers,
struct pw_client_node_buffer *buffers)
@ -813,7 +809,7 @@ client_node_use_buffers (void *object,
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
struct buffer_id *bid;
uint32_t i, j, len;
SpaBuffer *b;
struct spa_buffer *b;
/* clear previous buffers */
clear_buffers (stream);
@ -852,17 +848,17 @@ client_node_use_buffers (void *object,
{
size_t size;
size = sizeof (SpaBuffer);
size = sizeof (struct spa_buffer);
for (j = 0; j < buffers[i].buffer->n_metas; j++)
size += sizeof (SpaMeta);
size += sizeof (struct spa_meta);
for (j = 0; j < buffers[i].buffer->n_datas; j++)
size += sizeof (SpaData);
size += sizeof (struct spa_data);
b = bid->buf = malloc (size);
memcpy (b, buffers[i].buffer, sizeof (SpaBuffer));
memcpy (b, buffers[i].buffer, sizeof (struct spa_buffer));
b->metas = SPA_MEMBER (b, sizeof (SpaBuffer), SpaMeta);
b->datas = SPA_MEMBER (b->metas, sizeof(SpaMeta) * b->n_metas, SpaData);
b->metas = SPA_MEMBER (b, sizeof (struct spa_buffer), struct spa_meta);
b->datas = SPA_MEMBER (b->metas, sizeof(struct spa_meta) * b->n_metas, struct spa_data);
}
bid->id = b->id;
@ -874,17 +870,17 @@ client_node_use_buffers (void *object,
offset = 0;
for (j = 0; j < b->n_metas; j++) {
SpaMeta *m = &b->metas[j];
memcpy (m, &buffers[i].buffer->metas[j], sizeof (SpaMeta));
struct spa_meta *m = &b->metas[j];
memcpy (m, &buffers[i].buffer->metas[j], sizeof (struct spa_meta));
m->data = SPA_MEMBER (bid->buf_ptr, offset, void);
offset += m->size;
}
for (j = 0; j < b->n_datas; j++) {
SpaData *d = &b->datas[j];
struct spa_data *d = &b->datas[j];
memcpy (d, &buffers[i].buffer->datas[j], sizeof (SpaData));
d->chunk = SPA_MEMBER (bid->buf_ptr, offset + sizeof (SpaChunk) * j, SpaChunk);
memcpy (d, &buffers[i].buffer->datas[j], sizeof (struct spa_data));
d->chunk = SPA_MEMBER (bid->buf_ptr, offset + sizeof (struct spa_chunk) * j, struct spa_chunk);
if (d->type == stream->context->type.data.Id) {
struct mem_id *bmid = find_mem (stream, SPA_PTR_TO_UINT32 (d->data));
@ -918,7 +914,7 @@ client_node_use_buffers (void *object,
static void
client_node_node_command (void *object,
uint32_t seq,
const SpaCommand *command)
const struct spa_command *command)
{
struct pw_proxy *proxy = object;
struct pw_stream *stream = proxy->user_data;
@ -928,7 +924,7 @@ client_node_node_command (void *object,
static void
client_node_port_command (void *object,
uint32_t port_id,
const SpaCommand *command)
const struct spa_command *command)
{
pw_log_warn ("port command not supported");
}
@ -1009,7 +1005,7 @@ pw_stream_connect (struct pw_stream *stream,
const char *port_path,
enum pw_stream_flags flags,
uint32_t n_possible_formats,
SpaFormat **possible_formats)
struct spa_format **possible_formats)
{
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
@ -1053,8 +1049,8 @@ pw_stream_connect (struct pw_stream *stream,
/**
* pw_stream_finish_format:
* @stream: a #struct pw_stream
* @res: a #SpaResult
* @params: an array of pointers to #SpaParam
* @res: a #int
* @params: an array of pointers to #struct spa_param
* @n_params: number of elements in @params
*
* Complete the negotiation process with result code @res.
@ -1068,8 +1064,8 @@ pw_stream_connect (struct pw_stream *stream,
*/
bool
pw_stream_finish_format (struct pw_stream *stream,
SpaResult res,
SpaParam **params,
int res,
struct spa_param **params,
uint32_t n_params)
{
struct stream *impl = SPA_CONTAINER_OF (stream, struct stream, this);
@ -1180,7 +1176,7 @@ pw_stream_recycle_buffer (struct pw_stream *stream,
bid->used = false;
spa_list_insert (impl->free.prev, &bid->link);
pw_transport_add_event (impl->trans, (SpaEvent *)&rb);
pw_transport_add_event (impl->trans, (struct spa_event *)&rb);
write (impl->rtwritefd, &cmd, 8);
return true;
@ -1194,9 +1190,9 @@ pw_stream_recycle_buffer (struct pw_stream *stream,
* Get the buffer with @id from @stream. This function should be called from
* the new-buffer signal callback.
*
* Returns: a #SpaBuffer or %NULL when there is no buffer.
* Returns: a #struct spa_buffer or %NULL when there is no buffer.
*/
SpaBuffer *
struct spa_buffer *
pw_stream_peek_buffer (struct pw_stream *stream,
uint32_t id)
{

View file

@ -65,7 +65,7 @@ struct pw_time{
*/
struct pw_stream {
struct pw_context *context;
SpaList link;
struct spa_list link;
char *name;
struct pw_properties *properties;
@ -80,7 +80,7 @@ struct pw_stream {
PW_SIGNAL (format_changed, (struct pw_listener *listener,
struct pw_stream *stream,
SpaFormat *format));
struct spa_format *format));
PW_SIGNAL (add_buffer, (struct pw_listener *listener,
struct pw_stream *stream,
@ -106,12 +106,12 @@ bool pw_stream_connect (struct pw_stream *stream,
const char *port_path,
enum pw_stream_flags flags,
uint32_t n_possible_formats,
SpaFormat **possible_formats);
struct spa_format **possible_formats);
bool pw_stream_disconnect (struct pw_stream *stream);
bool pw_stream_finish_format (struct pw_stream *stream,
SpaResult res,
SpaParam **params,
int res,
struct spa_param **params,
uint32_t n_params);
bool pw_stream_get_time (struct pw_stream *stream,
@ -120,7 +120,7 @@ bool pw_stream_get_time (struct pw_stream *stream,
uint32_t pw_stream_get_empty_buffer (struct pw_stream *stream);
bool pw_stream_recycle_buffer (struct pw_stream *stream,
uint32_t id);
SpaBuffer * pw_stream_peek_buffer (struct pw_stream *stream,
struct spa_buffer *pw_stream_peek_buffer (struct pw_stream *stream,
uint32_t id);
bool pw_stream_send_buffer (struct pw_stream *stream,
uint32_t id);

View file

@ -34,14 +34,14 @@ struct thread_main_loop {
bool running;
pthread_t thread;
SpaSource *event;
struct spa_source *event;
int n_waiting;
int n_waiting_for_accept;
};
static void
pre_hook (SpaLoopControl *ctrl,
pre_hook (struct spa_loop_control *ctrl,
void *data)
{
struct thread_main_loop *impl = data;
@ -49,7 +49,7 @@ pre_hook (SpaLoopControl *ctrl,
}
static void
post_hook (SpaLoopControl *ctrl,
post_hook (struct spa_loop_control *ctrl,
void *data)
{
struct thread_main_loop *impl = data;
@ -57,8 +57,8 @@ post_hook (SpaLoopControl *ctrl,
}
static void
do_stop (SpaLoopUtils *utils,
SpaSource *source,
do_stop (struct spa_loop_utils *utils,
struct spa_source *source,
void *data)
{
struct thread_main_loop *impl = data;
@ -136,7 +136,7 @@ do_loop (void *user_data)
{
struct thread_main_loop *impl = user_data;
struct pw_thread_main_loop *this = &impl->this;
SpaResult res;
int res;
pthread_mutex_lock (&impl->lock);
pw_log_debug ("thread-mainloop %p: enter thread", this);
@ -161,7 +161,7 @@ do_loop (void *user_data)
*
* Returns: %SPA_RESULT_OK on success.
*/
SpaResult
int
pw_thread_main_loop_start (struct pw_thread_main_loop *loop)
{
struct thread_main_loop *impl = SPA_CONTAINER_OF (loop, struct thread_main_loop, this);

View file

@ -43,7 +43,7 @@ struct pw_thread_main_loop * pw_thread_main_loop_new (struct pw_loo
const char *name);
void pw_thread_main_loop_destroy (struct pw_thread_main_loop *loop);
SpaResult pw_thread_main_loop_start (struct pw_thread_main_loop *loop);
int pw_thread_main_loop_start (struct pw_thread_main_loop *loop);
void pw_thread_main_loop_stop (struct pw_thread_main_loop *loop);
void pw_thread_main_loop_lock (struct pw_thread_main_loop *loop);

View file

@ -38,7 +38,7 @@ struct transport {
struct pw_memblock mem;
size_t offset;
SpaEvent current;
struct spa_event current;
uint32_t current_index;
};
@ -47,11 +47,11 @@ transport_area_get_size (struct pw_transport_area *area)
{
size_t size;
size = sizeof (struct pw_transport_area);
size += area->max_inputs * sizeof (SpaPortIO);
size += area->max_outputs * sizeof (SpaPortIO);
size += sizeof (SpaRingbuffer);
size += area->max_inputs * sizeof (struct spa_port_io);
size += area->max_outputs * sizeof (struct spa_port_io);
size += sizeof (struct spa_ringbuffer);
size += INPUT_BUFFER_SIZE;
size += sizeof (SpaRingbuffer);
size += sizeof (struct spa_ringbuffer);
size += OUTPUT_BUFFER_SIZE;
return size;
}
@ -62,22 +62,22 @@ transport_setup_area (void *p, struct pw_transport *trans)
struct pw_transport_area *a;
trans->area = a = p;
p = SPA_MEMBER (p, sizeof (struct pw_transport_area), SpaPortIO);
p = SPA_MEMBER (p, sizeof (struct pw_transport_area), struct spa_port_io);
trans->inputs = p;
p = SPA_MEMBER (p, a->max_inputs * sizeof (SpaPortIO), void);
p = SPA_MEMBER (p, a->max_inputs * sizeof (struct spa_port_io), void);
trans->outputs = p;
p = SPA_MEMBER (p, a->max_outputs * sizeof (SpaPortIO), void);
p = SPA_MEMBER (p, a->max_outputs * sizeof (struct spa_port_io), void);
trans->input_buffer = p;
p = SPA_MEMBER (p, sizeof (SpaRingbuffer), void);
p = SPA_MEMBER (p, sizeof (struct spa_ringbuffer), void);
trans->input_data = p;
p = SPA_MEMBER (p, INPUT_BUFFER_SIZE, void);
trans->output_buffer = p;
p = SPA_MEMBER (p, sizeof (SpaRingbuffer), void);
p = SPA_MEMBER (p, sizeof (struct spa_ringbuffer), void);
trans->output_data = p;
p = SPA_MEMBER (p, OUTPUT_BUFFER_SIZE, void);
@ -193,7 +193,7 @@ pw_transport_destroy (struct pw_transport *trans)
free (impl);
}
SpaResult
int
pw_transport_get_info (struct pw_transport *trans,
struct pw_transport_info *info)
{
@ -206,9 +206,9 @@ pw_transport_get_info (struct pw_transport *trans,
return SPA_RESULT_OK;
}
SpaResult
int
pw_transport_add_event (struct pw_transport *trans,
SpaEvent *event)
struct spa_event *event)
{
struct transport *impl = (struct transport *) trans;
int32_t filled, avail;
@ -233,9 +233,9 @@ pw_transport_add_event (struct pw_transport *trans,
return SPA_RESULT_OK;
}
SpaResult
int
pw_transport_next_event (struct pw_transport *trans,
SpaEvent *event)
struct spa_event *event)
{
struct transport *impl = (struct transport *) trans;
int32_t avail;
@ -244,21 +244,21 @@ pw_transport_next_event (struct pw_transport *trans,
return SPA_RESULT_INVALID_ARGUMENTS;
avail = spa_ringbuffer_get_read_index (trans->input_buffer, &impl->current_index);
if (avail < sizeof (SpaEvent))
if (avail < sizeof (struct spa_event))
return SPA_RESULT_ENUM_END;
spa_ringbuffer_read_data (trans->input_buffer,
trans->input_data,
impl->current_index & trans->input_buffer->mask,
&impl->current,
sizeof (SpaEvent));
sizeof (struct spa_event));
*event = impl->current;
return SPA_RESULT_OK;
}
SpaResult
int
pw_transport_parse_event (struct pw_transport *trans,
void *event)
{

View file

@ -55,12 +55,12 @@ struct pw_transport {
struct pw_transport *trans));
struct pw_transport_area *area;
SpaPortIO *inputs;
SpaPortIO *outputs;
struct spa_port_io *inputs;
struct spa_port_io *outputs;
void *input_data;
SpaRingbuffer *input_buffer;
struct spa_ringbuffer *input_buffer;
void *output_data;
SpaRingbuffer *output_buffer;
struct spa_ringbuffer *output_buffer;
};
struct pw_transport * pw_transport_new (uint32_t max_inputs,
@ -69,15 +69,15 @@ struct pw_transport * pw_transport_new_from_info (struct pw_transport_info *inf
void pw_transport_destroy (struct pw_transport *trans);
SpaResult pw_transport_get_info (struct pw_transport *trans,
int pw_transport_get_info (struct pw_transport *trans,
struct pw_transport_info *info);
SpaResult pw_transport_add_event (struct pw_transport *trans,
SpaEvent *event);
int pw_transport_add_event (struct pw_transport *trans,
struct spa_event *event);
SpaResult pw_transport_next_event (struct pw_transport *trans,
SpaEvent *event);
SpaResult pw_transport_parse_event (struct pw_transport *trans,
int pw_transport_next_event (struct pw_transport *trans,
struct spa_event *event);
int pw_transport_parse_event (struct pw_transport *trans,
void *event);
#define PIPEWIRE_TYPE_EVENT__Transport SPA_TYPE_EVENT_BASE "Transport"
@ -94,7 +94,7 @@ struct pw_type_event_transport {
};
static inline void
pw_type_event_transport_map (SpaTypeMap *map, struct pw_type_event_transport *type)
pw_type_event_transport_map (struct spa_type_map *map, struct pw_type_event_transport *type)
{
if (type->HaveOutput == 0) {
type->HaveOutput = spa_type_map_get_id (map, PIPEWIRE_TYPE_EVENT_TRANSPORT__HaveOutput);
@ -104,13 +104,13 @@ pw_type_event_transport_map (SpaTypeMap *map, struct pw_type_event_transport *ty
}
struct pw_event_transport_reuse_buffer_body {
SpaPODObjectBody body;
SpaPODInt port_id;
SpaPODInt buffer_id;
struct spa_pod_object_body body;
struct spa_pod_int port_id;
struct spa_pod_int buffer_id;
};
struct pw_event_transport_reuse_buffer {
SpaPOD pod;
struct spa_pod pod;
struct pw_event_transport_reuse_buffer_body body;
};

View file

@ -76,7 +76,7 @@ pw_pod_remap_data (uint32_t type, void * body, uint32_t size, struct pw_map *typ
case SPA_POD_TYPE_PROP:
{
SpaPODPropBody *b = body;
struct spa_pod_prop_body *b = body;
if ((t = pw_map_lookup (types, b->key)) == NULL)
return false;
@ -95,8 +95,8 @@ pw_pod_remap_data (uint32_t type, void * body, uint32_t size, struct pw_map *typ
}
case SPA_POD_TYPE_OBJECT:
{
SpaPODObjectBody *b = body;
SpaPOD *p;
struct spa_pod_object_body *b = body;
struct spa_pod *p;
if ((t = pw_map_lookup (types, b->type)) == NULL)
return false;
@ -109,7 +109,7 @@ pw_pod_remap_data (uint32_t type, void * body, uint32_t size, struct pw_map *typ
}
case SPA_POD_TYPE_STRUCT:
{
SpaPOD *b = body, *p;
struct spa_pod *b = body, *p;
SPA_POD_FOREACH (b, size, p)
if (!pw_pod_remap_data (p->type, SPA_POD_BODY (p), p->size, types))

View file

@ -46,31 +46,31 @@ struct pw_interface {
* PipeWire Type support struct.
*/
struct pw_type {
SpaTypeMap *map;
struct spa_type_map *map;
SpaType core;
SpaType registry;
SpaType node;
SpaType node_factory;
SpaType link;
SpaType client;
SpaType client_node;
SpaType module;
uint32_t core;
uint32_t registry;
uint32_t node;
uint32_t node_factory;
uint32_t link;
uint32_t client;
uint32_t client_node;
uint32_t module;
SpaType spa_node;
SpaType spa_clock;
SpaType spa_monitor;
SpaType spa_format;
SpaType spa_props;
uint32_t spa_node;
uint32_t spa_clock;
uint32_t spa_monitor;
uint32_t spa_format;
uint32_t spa_props;
SpaTypeMeta meta;
SpaTypeData data;
SpaTypeEventNode event_node;
SpaTypeCommandNode command_node;
SpaTypeMonitor monitor;
SpaTypeParamAllocBuffers param_alloc_buffers;
SpaTypeParamAllocMetaEnable param_alloc_meta_enable;
SpaTypeParamAllocVideoPadding param_alloc_video_padding;
struct spa_type_meta meta;
struct spa_type_data data;
struct spa_type_event_node event_node;
struct spa_type_command_node command_node;
struct spa_type_monitor monitor;
struct spa_type_param_alloc_buffers param_alloc_buffers;
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
struct spa_type_param_alloc_video_padding param_alloc_video_padding;
struct pw_type_event_transport event_transport;
};
@ -79,7 +79,7 @@ void pw_type_init (struct pw_type *type);
bool pw_pod_remap_data (uint32_t type, void *body, uint32_t size, struct pw_map *types);
static inline bool
pw_pod_remap (SpaPOD *pod, struct pw_map *types)
pw_pod_remap (struct spa_pod *pod, struct pw_map *types)
{
return pw_pod_remap_data (pod->type, SPA_POD_BODY (pod), pod->size, types);
}

View file

@ -40,15 +40,15 @@ void pw_free_strv (char **str);
char * pw_strip (char *str,
const char *whitespace);
static inline SpaPOD *
pw_spa_pod_copy (const SpaPOD *pod)
static inline struct spa_pod *
pw_spa_pod_copy (const struct spa_pod *pod)
{
return pod ? memcpy (malloc (SPA_POD_SIZE (pod)), pod, SPA_POD_SIZE (pod)) : NULL;
}
#define spa_format_copy(f) ((SpaFormat*)pw_spa_pod_copy(&(f)->pod))
#define spa_props_copy(p) ((SpaProps*)pw_spa_pod_copy(&(p)->pod))
#define spa_param_copy(p) ((SpaParam*)pw_spa_pod_copy(&(p)->pod))
#define spa_format_copy(f) ((struct spa_format*)pw_spa_pod_copy(&(f)->pod))
#define spa_props_copy(p) ((struct spa_prop*)pw_spa_pod_copy(&(p)->object.pod))
#define spa_param_copy(p) ((struct spa_param*)pw_spa_pod_copy(&(p)->object.pod))
#ifdef __cplusplus
} /* extern "C" */

View file

@ -28,7 +28,7 @@ extern "C" {
#include <pipewire/server/core.h>
struct pw_daemon_config {
SpaList commands;
struct spa_list commands;
};
struct pw_daemon_config * pw_daemon_config_new (void);

View file

@ -44,7 +44,7 @@ main (int argc, char *argv[])
loop = pw_main_loop_new ();
#if 1
{
SpaSource *source;
struct spa_source *source;
source = pw_loop_add_event (loop->loop, NULL, NULL);
pw_log_set_trace_event (source);
}

View file

@ -32,19 +32,19 @@
#include <pipewire/client/sig.h>
#include <spa/lib/debug.h>
typedef struct {
struct type {
uint32_t format;
uint32_t props;
SpaTypeMeta meta;
SpaTypeData data;
SpaTypeMediaType media_type;
SpaTypeMediaSubtype media_subtype;
SpaTypeFormatVideo format_video;
SpaTypeVideoFormat video_format;
} Type;
struct spa_type_meta meta;
struct spa_type_data data;
struct spa_type_media_type media_type;
struct spa_type_media_subtype media_subtype;
struct spa_type_format_video format_video;
struct spa_type_video_format video_format;
};
static inline void
init_type (Type *type, SpaTypeMap *map)
init_type (struct type *type, struct spa_type_map *map)
{
type->format = spa_type_map_get_id (map, SPA_TYPE__Format);
type->props = spa_type_map_get_id (map, SPA_TYPE__Props);
@ -61,7 +61,7 @@ init_type (Type *type, SpaTypeMap *map)
#define BPP 3
struct data {
Type type;
struct type type;
const char *path;
@ -71,7 +71,7 @@ struct data {
bool running;
struct pw_loop *loop;
SpaSource *timer;
struct spa_source *timer;
struct pw_context *context;
struct pw_listener on_state_changed;
@ -81,7 +81,7 @@ struct data {
struct pw_listener on_stream_format_changed;
struct pw_listener on_stream_new_buffer;
SpaVideoInfoRaw format;
struct spa_video_info_raw format;
int32_t stride;
uint8_t params_buffer[1024];
@ -107,7 +107,7 @@ on_stream_new_buffer (struct pw_listener *listener,
uint32_t id)
{
struct data *data = SPA_CONTAINER_OF (listener, struct data, on_stream_new_buffer);
SpaBuffer *buf;
struct spa_buffer *buf;
uint8_t *map;
void *sdata, *ddata;
int sstride, dstride, ostride;
@ -166,46 +166,46 @@ static struct {
Uint32 format;
uint32_t id;
} video_formats[] = {
{ SDL_PIXELFORMAT_UNKNOWN, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX1LSB, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_UNKNOWN, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX1LSB, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX1MSB, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX4LSB, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX4MSB, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX8, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB332, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB444, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB555, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_BGR555, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_ARGB4444, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_RGBA4444, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_ABGR4444, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_BGRA4444, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_ARGB1555, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_RGBA5551, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_ABGR1555, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_BGRA5551, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB565, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_BGR565, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB24, offsetof (SpaTypeVideoFormat, RGB), },
{ SDL_PIXELFORMAT_RGB888, offsetof (SpaTypeVideoFormat, RGB), },
{ SDL_PIXELFORMAT_RGBX8888, offsetof (SpaTypeVideoFormat, RGBx), },
{ SDL_PIXELFORMAT_BGR24, offsetof (SpaTypeVideoFormat, BGR), },
{ SDL_PIXELFORMAT_BGR888, offsetof (SpaTypeVideoFormat, BGR), },
{ SDL_PIXELFORMAT_BGRX8888, offsetof (SpaTypeVideoFormat, BGRx), },
{ SDL_PIXELFORMAT_ARGB2101010, offsetof (SpaTypeVideoFormat, UNKNOWN), },
{ SDL_PIXELFORMAT_RGBA8888, offsetof (SpaTypeVideoFormat, RGBA), },
{ SDL_PIXELFORMAT_ARGB8888, offsetof (SpaTypeVideoFormat, ARGB), },
{ SDL_PIXELFORMAT_BGRA8888, offsetof (SpaTypeVideoFormat, BGRA), },
{ SDL_PIXELFORMAT_ABGR8888, offsetof (SpaTypeVideoFormat, ABGR), },
{ SDL_PIXELFORMAT_YV12, offsetof (SpaTypeVideoFormat, YV12), },
{ SDL_PIXELFORMAT_IYUV, offsetof (SpaTypeVideoFormat, I420), },
{ SDL_PIXELFORMAT_YUY2, offsetof (SpaTypeVideoFormat, YUY2), },
{ SDL_PIXELFORMAT_UYVY, offsetof (SpaTypeVideoFormat, UYVY), },
{ SDL_PIXELFORMAT_YVYU, offsetof (SpaTypeVideoFormat, YVYU), },
{ SDL_PIXELFORMAT_NV12, offsetof (SpaTypeVideoFormat, NV12), },
{ SDL_PIXELFORMAT_NV21, offsetof (SpaTypeVideoFormat, NV21), }
{ SDL_PIXELFORMAT_UNKNOWN, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX1LSB, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_UNKNOWN, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX1LSB, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX1MSB, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX4LSB, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX4MSB, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_INDEX8, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB332, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB444, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB555, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_BGR555, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_ARGB4444, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_RGBA4444, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_ABGR4444, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_BGRA4444, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_ARGB1555, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_RGBA5551, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_ABGR1555, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_BGRA5551, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB565, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_BGR565, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_RGB24, offsetof (struct spa_type_video_format, RGB), },
{ SDL_PIXELFORMAT_RGB888, offsetof (struct spa_type_video_format, RGB), },
{ SDL_PIXELFORMAT_RGBX8888, offsetof (struct spa_type_video_format, RGBx), },
{ SDL_PIXELFORMAT_BGR24, offsetof (struct spa_type_video_format, BGR), },
{ SDL_PIXELFORMAT_BGR888, offsetof (struct spa_type_video_format, BGR), },
{ SDL_PIXELFORMAT_BGRX8888, offsetof (struct spa_type_video_format, BGRx), },
{ SDL_PIXELFORMAT_ARGB2101010, offsetof (struct spa_type_video_format, UNKNOWN), },
{ SDL_PIXELFORMAT_RGBA8888, offsetof (struct spa_type_video_format, RGBA), },
{ SDL_PIXELFORMAT_ARGB8888, offsetof (struct spa_type_video_format, ARGB), },
{ SDL_PIXELFORMAT_BGRA8888, offsetof (struct spa_type_video_format, BGRA), },
{ SDL_PIXELFORMAT_ABGR8888, offsetof (struct spa_type_video_format, ABGR), },
{ SDL_PIXELFORMAT_YV12, offsetof (struct spa_type_video_format, YV12), },
{ SDL_PIXELFORMAT_IYUV, offsetof (struct spa_type_video_format, I420), },
{ SDL_PIXELFORMAT_YUY2, offsetof (struct spa_type_video_format, YUY2), },
{ SDL_PIXELFORMAT_UYVY, offsetof (struct spa_type_video_format, UYVY), },
{ SDL_PIXELFORMAT_YVYU, offsetof (struct spa_type_video_format, YVYU), },
{ SDL_PIXELFORMAT_NV12, offsetof (struct spa_type_video_format, NV12), },
{ SDL_PIXELFORMAT_NV21, offsetof (struct spa_type_video_format, NV21), }
};
static uint32_t
@ -241,13 +241,13 @@ id_to_sdl_format (struct data *data, uint32_t id)
static void
on_stream_format_changed (struct pw_listener *listener,
struct pw_stream *stream,
SpaFormat *format)
struct spa_format *format)
{
struct data *data = SPA_CONTAINER_OF (listener, struct data, on_stream_format_changed);
struct pw_context *ctx = stream->context;
SpaPODBuilder b = { NULL };
SpaPODFrame f[2];
SpaParam *params[2];
struct spa_pod_builder b = { NULL };
struct spa_pod_frame f[2];
struct spa_param *params[2];
if (format) {
Uint32 sdl_format;
@ -278,12 +278,12 @@ on_stream_format_changed (struct pw_listener *listener,
PROP (&f[1], ctx->type.param_alloc_buffers.stride, SPA_POD_TYPE_INT, data->stride),
PROP_U_MM (&f[1], ctx->type.param_alloc_buffers.buffers, SPA_POD_TYPE_INT, 32, 2, 32),
PROP (&f[1], ctx->type.param_alloc_buffers.align, SPA_POD_TYPE_INT, 16));
params[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaParam);
params[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_param);
spa_pod_builder_object (&b, &f[0], 0, ctx->type.param_alloc_meta_enable.MetaEnable,
PROP (&f[1], ctx->type.param_alloc_meta_enable.type, SPA_POD_TYPE_ID, ctx->type.meta.Header),
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (SpaMetaHeader)));
params[1] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaParam);
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (struct spa_meta_header)));
params[1] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_param);
pw_stream_finish_format (stream, SPA_RESULT_OK, params, 2);
}
@ -305,10 +305,10 @@ on_state_changed (struct pw_listener *listener,
case PW_CONTEXT_STATE_CONNECTED:
{
SpaFormat *formats[1];
struct spa_format *formats[1];
uint8_t buffer[1024];
SpaPODBuilder b = SPA_POD_BUILDER_INIT (buffer, sizeof (buffer));
SpaPODFrame f[2];
struct spa_pod_builder b = SPA_POD_BUILDER_INIT (buffer, sizeof (buffer));
struct spa_pod_frame f[2];
SDL_RendererInfo info;
int i, c;
@ -350,7 +350,7 @@ on_state_changed (struct pw_listener *listener,
0);
spa_pod_builder_pop (&b, &f[0]);
formats[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaFormat);
formats[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_format);
printf ("supported formats:\n");
spa_debug_format (formats[0], data->context->type.map);

View file

@ -35,16 +35,16 @@
struct type {
uint32_t format;
uint32_t props;
SpaTypeMeta meta;
SpaTypeData data;
SpaTypeMediaType media_type;
SpaTypeMediaSubtype media_subtype;
SpaTypeFormatVideo format_video;
SpaTypeVideoFormat video_format;
struct spa_type_meta meta;
struct spa_type_data data;
struct spa_type_media_type media_type;
struct spa_type_media_subtype media_subtype;
struct spa_type_format_video format_video;
struct spa_type_video_format video_format;
};
static inline void
init_type (struct type *type, SpaTypeMap *map)
init_type (struct type *type, struct spa_type_map *map)
{
type->format = spa_type_map_get_id (map, SPA_TYPE__Format);
type->props = spa_type_map_get_id (map, SPA_TYPE__Props);
@ -63,7 +63,7 @@ struct data {
bool running;
struct pw_loop *loop;
SpaSource *timer;
struct spa_source *timer;
struct pw_context *context;
struct pw_listener on_state_changed;
@ -72,7 +72,7 @@ struct data {
struct pw_listener on_stream_state_changed;
struct pw_listener on_stream_format_changed;
SpaVideoInfoRaw format;
struct spa_video_info_raw format;
int32_t stride;
uint8_t params_buffer[1024];
@ -81,16 +81,16 @@ struct data {
};
static void
on_timeout (SpaLoopUtils *utils,
SpaSource *source,
on_timeout (struct spa_loop_utils *utils,
struct spa_source *source,
void *userdata)
{
struct data *data = userdata;
uint32_t id;
SpaBuffer *buf;
struct spa_buffer *buf;
int i, j;
uint8_t *p, *map;
SpaMetaHeader *h;
struct spa_meta_header *h;
id = pw_stream_get_empty_buffer (data->stream);
if (id == SPA_ID_INVALID)
@ -183,13 +183,13 @@ on_stream_state_changed (struct pw_listener *listener,
static void
on_stream_format_changed (struct pw_listener *listener,
struct pw_stream *stream,
SpaFormat *format)
struct spa_format *format)
{
struct data *data = SPA_CONTAINER_OF (listener, struct data, on_stream_format_changed);
struct pw_context *ctx = stream->context;
SpaPODBuilder b = { NULL };
SpaPODFrame f[2];
SpaParam *params[2];
struct spa_pod_builder b = { NULL };
struct spa_pod_frame f[2];
struct spa_param *params[2];
if (format) {
spa_format_video_raw_parse (format, &data->format, &data->type.format_video);
@ -203,12 +203,12 @@ on_stream_format_changed (struct pw_listener *listener,
PROP (&f[1], ctx->type.param_alloc_buffers.stride, SPA_POD_TYPE_INT, data->stride),
PROP_U_MM (&f[1], ctx->type.param_alloc_buffers.buffers, SPA_POD_TYPE_INT, 32, 2, 32),
PROP (&f[1], ctx->type.param_alloc_buffers.align, SPA_POD_TYPE_INT, 16));
params[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaParam);
params[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_param);
spa_pod_builder_object (&b, &f[0], 0, ctx->type.param_alloc_meta_enable.MetaEnable,
PROP (&f[1], ctx->type.param_alloc_meta_enable.type, SPA_POD_TYPE_ID, ctx->type.meta.Header),
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (SpaMetaHeader)));
params[1] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaParam);
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (struct spa_meta_header)));
params[1] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_param);
pw_stream_finish_format (stream, SPA_RESULT_OK, params, 2);
}
@ -231,10 +231,10 @@ on_state_changed (struct pw_listener *listener,
case PW_CONTEXT_STATE_CONNECTED:
{
SpaFormat *formats[1];
struct spa_format *formats[1];
uint8_t buffer[1024];
SpaPODBuilder b = SPA_POD_BUILDER_INIT (buffer, sizeof (buffer));
SpaPODFrame f[2];
struct spa_pod_builder b = SPA_POD_BUILDER_INIT (buffer, sizeof (buffer));
struct spa_pod_frame f[2];
printf ("context state: \"%s\"\n", pw_context_state_as_string (context->state));
@ -247,7 +247,7 @@ on_state_changed (struct pw_listener *listener,
1, 1,
4096, 4096),
PROP (&f[1], data->type.format_video.framerate, SPA_POD_TYPE_FRACTION, 25, 1));
formats[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaFormat);
formats[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_format);
pw_signal_add (&data->stream->state_changed,
&data->on_stream_state_changed,

File diff suppressed because it is too large Load diff

View file

@ -1,305 +0,0 @@
/* GStreamer
* Copyright (C) <2012> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_BURST_CACHE_H__
#define __GST_BURST_CACHE_H__
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_BURST_CACHE \
(gst_burst_cache_get_type())
#define GST_BURST_CACHE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BURST_CACHE,GstBurstCache))
#define GST_BURST_CACHE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BURST_CACHE,GstBurstCacheClass))
#define GST_IS_BURST_CACHE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BURST_CACHE))
#define GST_IS_BURST_CACHE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BURST_CACHE))
#define GST_BURST_CACHE_GET_CLASS(klass) \
(G_TYPE_INSTANCE_GET_CLASS ((klass), GST_TYPE_BURST_CACHE, GstBurstCacheClass))
typedef struct _GstBurstCache GstBurstCache;
typedef struct _GstBurstCacheClass GstBurstCacheClass;
typedef struct _GstBurstCacheReader GstBurstCacheReader;
/**
* GstBurstCacheRecover:
* @GST_BURST_CACHE_RECOVER_NONE : no recovering is done
* @GST_BURST_CACHE_RECOVER_RESYNC_LATEST : reader is moved to last buffer
* @GST_BURST_CACHE_RECOVER_RESYNC_SOFT_LIMIT: reader is moved to the soft limit
* @GST_BURST_CACHE_RECOVER_RESYNC_KEYFRAME : reader is moved to latest keyframe
*
* Possible values for the recovery procedure to use when a reader consumes
* data too slowly and has a backlog of more that soft-limit buffers.
*/
typedef enum
{
GST_BURST_CACHE_RECOVER_NONE,
GST_BURST_CACHE_RECOVER_RESYNC_LATEST,
GST_BURST_CACHE_RECOVER_RESYNC_SOFT_LIMIT,
GST_BURST_CACHE_RECOVER_RESYNC_KEYFRAME
} GstBurstCacheRecover;
/**
* GstBurstCacheStart:
* @GST_BURST_CACHE_START_LATEST : reader receives most recent buffer
* @GST_BURST_CACHE_START_NEXT_KEYFRAME : reader receives next keyframe
* @GST_BURST_CACHE_START_LATEST_KEYFRAME : reader receives latest keyframe (burst)
* @GST_BURST_CACHE_START_BURST : reader receives specific amount of data
* @GST_BURST_CACHE_START_BURST_KEYFRAME : reader receives specific amount of data
* starting from latest keyframe
* @GST_BURST_CACHE_START_BURST_WITH_KEYFRAME : reader receives specific amount of data from
* a keyframe, or if there is not enough data after
* the keyframe, starting before the keyframe
*
* This enum defines the selection of the first buffer that is sent
* to a new reader.
*/
typedef enum
{
GST_BURST_CACHE_START_LATEST,
GST_BURST_CACHE_START_NEXT_KEYFRAME,
GST_BURST_CACHE_START_LATEST_KEYFRAME,
GST_BURST_CACHE_START_BURST,
GST_BURST_CACHE_START_BURST_KEYFRAME,
GST_BURST_CACHE_START_BURST_WITH_KEYFRAME
} GstBurstCacheStart;
/**
* GstBurstCacheError:
* @GST_BURST_CACHE_ERROR_NONE : No error
* @GST_BURST_CACHE_ERROR_SLOW : reader is too slow
* @GST_BURST_CACHE_ERROR_ERROR : reader is in error
* @GST_BURST_CACHE_ERROR_DUPLICATE: same reader added twice
*
* Error codes used in the reason GError.
*/
typedef enum
{
GST_BURST_CACHE_ERROR_NONE = 0,
GST_BURST_CACHE_ERROR_SLOW = 1,
GST_BURST_CACHE_ERROR_ERROR = 2,
GST_BURST_CACHE_ERROR_DUPLICATE = 3,
} GstBurstCacheError;
GQuark gst_burst_cache_error_quark (void);
#define GST_BURST_CACHE_ERROR gst_burst_cache_error_quark()
/**
* GstBurstCacheResult:
* @GST_BURST_CACHE_RESULT_ERROR : An error occured
* @GST_BURST_CACHE_RESULT_OK : No error
* @GST_BURST_CACHE_RESULT_WAIT : Wait for more buffers
* @GST_BURST_CACHE_RESULT_EOS : No more buffers
*
* Error codes used in the reason GError.
*/
typedef enum
{
GST_BURST_CACHE_RESULT_ERROR = 0,
GST_BURST_CACHE_RESULT_OK = 1,
GST_BURST_CACHE_RESULT_WAIT = 2,
GST_BURST_CACHE_RESULT_EOS = 3,
} GstBurstCacheResult;
/**
* GstBurstCacheReaderCallback:
* @cache: a #GstBurstCache
* @reader: a #GstBurstCacheReader
* @user_data: user data given when creating @reader
*
* Called when @reader in @cache has data. You can get the new data with
* gst_burst_cache_get_buffer() from this callback or any other thread.
*/
typedef void (*GstBurstCacheReaderCallback) (GstBurstCache *cache,
GstBurstCacheReader *reader,
gpointer user_data);
/**
* GstBurstCacheReader:
* @object: parent miniobject
* @bufpos: position of this reader in the global queue
* @draincount: the remaining number of buffers to drain or -1 if the
* reader is not draining.
* @new_reader: this is a new reader
* @discont: is the next buffer was discont
* @reason: the reason why the reader is being removed
*
* structure for a reader
*/
struct _GstBurstCacheReader {
GHook hook;
gint bufpos;
gint draincount;
GstBurstCacheReaderCallback callback;
gpointer user_data;
GDestroyNotify notify;
gboolean new_reader;
gboolean discont;
GError *reason;
/* method to sync reader when connecting */
GstBurstCacheStart start_method;
GstFormat min_format;
guint64 min_value;
GstFormat max_format;
guint64 max_value;
/* stats */
guint64 bytes_sent;
guint64 dropped_buffers;
guint64 avg_queue_size;
guint64 first_buffer_ts;
guint64 last_buffer_ts;
guint64 add_time;
guint64 remove_time;
guint64 last_activity_time;
guint64 timeout;
gchar debug[30]; /* a debug string used in debug calls to
identify the reader */
};
/**
* GstBurstCache:
* @parent: parent GObject
* @lock: lock to protect @readers
* @bufqueue: global queue of buffers
* @readers: list of readers we are serving
* @readers_cookie: Cookie to detect changes to @readers
* @limit_format: the format of @limit_max and @@limit_soft_max
* @limit_max: max units to queue for a reader
* @limit_soft_max: max units a reader can lag before recovery starts
* @recover: how to recover a lagging reader
* @bytes_min: min number of bytes to queue
* @time_min: min time to queue
* @buffers_min: min number of buffers to queue
* @bytes_to_serve: how much bytes we must serve
* @bytes_served: how much bytes have we served
* @bytes_queued: number of queued bytes
* @time_queued: amount of queued time
* @buffers_queued: number of queued buffers
*/
struct _GstBurstCache {
GObject parent;
/*< private >*/
GRecMutex lock;
GPtrArray *bufqueue;
/* the readers */
GHookList readers;
guint readers_cookie;
/* these values are used to check if a reader is reading fast
* enough and to control recovery */
GstFormat limit_format;
gint64 limit_max;
gint64 limit_soft_max;
GstBurstCacheRecover recover;
/* these values are used to control the amount of data
* kept in the queues. It allows readers to perform a burst
* on connect. */
gint bytes_min;
gint64 time_min;
gint buffers_min;
/* stats */
gint bytes_queued;
gint64 time_queued;
gint buffers_queued;
};
/**
* GstBurstCacheClass:
* @parent_class: parent GObjectClass
* @reader_ready: called when a reader has a new buffer available
*
* The GstBurstCache class structure.
*/
struct _GstBurstCacheClass {
GObjectClass parent_class;
};
GType gst_burst_cache_get_type (void);
GType gst_burst_cache_reader_get_type (void);
GstBurstCache * gst_burst_cache_new (guint reader_size);
void gst_burst_cache_set_min_amount (GstBurstCache *cache,
gint bytes_min,
gint64 time_min,
gint buffers_min);
void gst_burst_cache_get_min_amount (GstBurstCache *cache,
gint *bytes_min,
gint64 *time_min,
gint *buffers_min);
void gst_burst_cache_set_limits (GstBurstCache *cache,
GstFormat format,
gint64 max,
gint64 soft_max,
GstBurstCacheRecover recover);
void gst_burst_cache_get_limits (GstBurstCache *cache,
GstFormat *format,
gint64 *max,
gint64 *soft_max,
GstBurstCacheRecover *recover);
void gst_burst_cache_queue_buffer (GstBurstCache *cache,
GstBuffer *buffer);
void gst_burst_cache_remove_buffers (GstBurstCache *cache);
GstBurstCacheReader * gst_burst_cache_reader_new (GstBurstCache *cache,
GstBurstCacheReaderCallback callback,
gpointer user_data,
GDestroyNotify notify);
gboolean gst_burst_cache_reader_set_burst (GstBurstCacheReader *reader,
GstBurstCacheStart start_method,
GstFormat min_format, guint64 min_value,
GstFormat max_format, guint64 max_value);
void gst_burst_cache_reader_destroy (GstBurstCacheReader *reader);
gboolean gst_burst_cache_add_reader (GstBurstCache *cache,
GstBurstCacheReader *reader);
gboolean gst_burst_cache_remove_reader (GstBurstCache *cache,
GstBurstCacheReader *reader,
gboolean drain);
gboolean gst_burst_cache_error_reader (GstBurstCache *cache,
GstBurstCacheReader *reader,
GError *error);
void gst_burst_cache_remove_readers (GstBurstCache * cache);
GstBurstCacheResult gst_burst_cache_get_buffer (GstBurstCache *cache,
GstBurstCacheReader *reader,
GstBuffer **buffer);
G_END_DECLS
#endif /* __GST_BURST_CACHE_H__ */

View file

@ -198,7 +198,7 @@ new_node (const struct pw_node_info *info)
GstCaps *caps = NULL;
GstStructure *props;
const gchar *klass = NULL;
SpaDictItem *item;
struct spa_dict_item *item;
GstPipeWireDeviceType type;
int i;
@ -243,7 +243,7 @@ new_node (const struct pw_node_info *info)
static void
get_node_info_cb (struct pw_context *context,
SpaResult res,
int res,
const struct pw_node_info *info,
gpointer user_data)
{
@ -316,7 +316,7 @@ typedef struct {
static void
list_node_info_cb (struct pw_context *c,
SpaResult res,
int res,
const struct pw_node_info *info,
void *user_data)
{
@ -330,7 +330,7 @@ list_node_info_cb (struct pw_context *c,
static void
get_core_info_cb (struct pw_context *c,
SpaResult res,
int res,
const struct pw_core_info *info,
void *user_data)
{

View file

@ -31,29 +31,29 @@
#include "gstpipewireformat.h"
typedef struct {
struct media_type {
const char *name;
uint32_t *media_type;
uint32_t *media_subtype;
} MediaType;
};
static struct {
SpaTypeMap *map;
struct spa_type_map *map;
uint32_t format;
SpaTypeMediaType media_type;
SpaTypeMediaSubtype media_subtype;
SpaTypeMediaSubtypeVideo media_subtype_video;
SpaTypeMediaSubtypeAudio media_subtype_audio;
SpaTypeFormatVideo format_video;
SpaTypeFormatAudio format_audio;
SpaTypeVideoFormat video_format;
SpaTypeAudioFormat audio_format;
struct spa_type_media_type media_type;
struct spa_type_media_subtype media_subtype;
struct spa_type_media_subtype_video media_subtype_video;
struct spa_type_media_subtype_audio media_subtype_audio;
struct spa_type_format_video format_video;
struct spa_type_format_audio format_audio;
struct spa_type_video_format video_format;
struct spa_type_audio_format audio_format;
} type = { NULL, };
static void
ensure_types (void)
{
SpaTypeMap *map = type.map = spa_type_map_get_default ();
struct spa_type_map *map = type.map = spa_type_map_get_default ();
type.format = spa_type_map_get_id (map, SPA_TYPE__Format);
spa_type_media_type_map (map, &type.media_type);
@ -66,7 +66,7 @@ ensure_types (void)
spa_type_audio_format_map (map, &type.audio_format);
}
static const MediaType media_type_map[] = {
static const struct media_type media_type_map[] = {
{ "video/x-raw", &type.media_type.video, &type.media_subtype.raw },
{ "audio/x-raw", &type.media_type.audio, &type.media_subtype.raw },
{ "image/jpeg", &type.media_type.video, &type.media_subtype_video.mjpg },
@ -199,13 +199,13 @@ static const uint32_t *audio_format_map[] = {
};
typedef struct {
SpaPODBuilder b;
const MediaType *type;
struct spa_pod_builder b;
const struct media_type *type;
const GstCapsFeatures *cf;
const GstStructure *cs;
} ConvertData;
static const MediaType *
static const struct media_type *
find_media_types (const char *name)
{
int i;
@ -266,7 +266,7 @@ get_nth_int (const GValue *val, int idx, int *res)
}
static gboolean
get_nth_fraction (const GValue *val, int idx, SpaFraction *f)
get_nth_fraction (const GValue *val, int idx, struct spa_fraction *f)
{
const GValue *v = NULL;
GType type = G_VALUE_TYPE (val);
@ -294,7 +294,7 @@ get_nth_fraction (const GValue *val, int idx, SpaFraction *f)
}
static gboolean
get_nth_rectangle (const GValue *width, const GValue *height, int idx, SpaRectangle *r)
get_nth_rectangle (const GValue *width, const GValue *height, int idx, struct spa_rectangle *r)
{
const GValue *w = NULL, *h = NULL;
GType wt = G_VALUE_TYPE (width);
@ -373,7 +373,7 @@ get_range_type2 (const GValue *v1, const GValue *v2)
static gboolean
handle_video_fields (ConvertData *d)
{
SpaPODFrame f;
struct spa_pod_frame f;
const GValue *value, *value2;
int i;
@ -392,13 +392,13 @@ handle_video_fields (ConvertData *d)
spa_pod_builder_id (&d->b, *video_format_map[idx]);
}
if (i > 1)
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
SPA_POD_BUILDER_DEREF (&d->b, f.ref, struct spa_pod_prop)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
spa_pod_builder_pop (&d->b, &f);
}
value = gst_structure_get_value (d->cs, "width");
value2 = gst_structure_get_value (d->cs, "height");
if (value || value2) {
SpaRectangle v;
struct spa_rectangle v;
for (i = 0; get_nth_rectangle (value, value2, i, &v); i++) {
if (i == 0)
spa_pod_builder_push_prop (&d->b, &f,
@ -408,13 +408,13 @@ handle_video_fields (ConvertData *d)
spa_pod_builder_rectangle (&d->b, v.width, v.height);
}
if (i > 1)
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
SPA_POD_BUILDER_DEREF (&d->b, f.ref, struct spa_pod_prop)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
spa_pod_builder_pop (&d->b, &f);
}
value = gst_structure_get_value (d->cs, "framerate");
if (value) {
SpaFraction v;
struct spa_fraction v;
for (i = 0; get_nth_fraction (value, i, &v); i++) {
if (i == 0)
spa_pod_builder_push_prop (&d->b, &f,
@ -424,13 +424,13 @@ handle_video_fields (ConvertData *d)
spa_pod_builder_fraction (&d->b, v.num, v.denom);
}
if (i > 1)
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
SPA_POD_BUILDER_DEREF (&d->b, f.ref, struct spa_pod_prop)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
spa_pod_builder_pop (&d->b, &f);
}
value = gst_structure_get_value (d->cs, "max-framerate");
if (value) {
SpaFraction v;
struct spa_fraction v;
for (i = 0; get_nth_fraction (value, i, &v); i++) {
if (i == 0)
spa_pod_builder_push_prop (&d->b, &f,
@ -440,7 +440,7 @@ handle_video_fields (ConvertData *d)
spa_pod_builder_fraction (&d->b, v.num, v.denom);
}
if (i > 1)
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
SPA_POD_BUILDER_DEREF (&d->b, f.ref, struct spa_pod_prop)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
spa_pod_builder_pop (&d->b, &f);
}
return TRUE;
@ -449,7 +449,7 @@ handle_video_fields (ConvertData *d)
static gboolean
handle_audio_fields (ConvertData *d)
{
SpaPODFrame f;
struct spa_pod_frame f;
const GValue *value;
int i = 0;
@ -468,7 +468,7 @@ handle_audio_fields (ConvertData *d)
spa_pod_builder_id (&d->b, *audio_format_map[idx]);
}
if (i > 1)
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
SPA_POD_BUILDER_DEREF (&d->b, f.ref, struct spa_pod_prop)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
spa_pod_builder_pop (&d->b, &f);
}
@ -476,7 +476,7 @@ handle_audio_fields (ConvertData *d)
if (value) {
const char *v;
for (i = 0; (v = get_nth_string (value, i)); i++) {
SpaAudioLayout layout;
enum spa_audio_layout layout;
if (!strcmp (v, "interleaved"))
layout = SPA_AUDIO_LAYOUT_INTERLEAVED;
@ -493,7 +493,7 @@ handle_audio_fields (ConvertData *d)
spa_pod_builder_int (&d->b, layout);
}
if (i > 1)
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
SPA_POD_BUILDER_DEREF (&d->b, f.ref, struct spa_pod_prop)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
spa_pod_builder_pop (&d->b, &f);
}
value = gst_structure_get_value (d->cs, "rate");
@ -508,7 +508,7 @@ handle_audio_fields (ConvertData *d)
spa_pod_builder_int (&d->b, v);
}
if (i > 1)
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
SPA_POD_BUILDER_DEREF (&d->b, f.ref, struct spa_pod_prop)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
spa_pod_builder_pop (&d->b, &f);
}
value = gst_structure_get_value (d->cs, "channels");
@ -523,14 +523,14 @@ handle_audio_fields (ConvertData *d)
spa_pod_builder_int (&d->b, v);
}
if (i > 1)
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
SPA_POD_BUILDER_DEREF (&d->b, f.ref, struct spa_pod_prop)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
spa_pod_builder_pop (&d->b, &f);
}
return TRUE;
}
static uint32_t
write_pod (SpaPODBuilder *b, uint32_t ref, const void *data, uint32_t size)
write_pod (struct spa_pod_builder *b, uint32_t ref, const void *data, uint32_t size)
{
if (ref == -1)
ref = b->offset;
@ -543,11 +543,11 @@ write_pod (SpaPODBuilder *b, uint32_t ref, const void *data, uint32_t size)
return ref;
}
static SpaFormat *
static struct spa_format *
convert_1 (GstCapsFeatures *cf, GstStructure *cs)
{
ConvertData d;
SpaPODFrame f;
struct spa_pod_frame f;
spa_zero (d);
d.cf = cf;
@ -569,15 +569,15 @@ convert_1 (GstCapsFeatures *cf, GstStructure *cs)
spa_pod_builder_pop (&d.b, &f);
return SPA_MEMBER (d.b.data, 0, SpaFormat);
return SPA_MEMBER (d.b.data, 0, struct spa_format);
}
SpaFormat *
struct spa_format *
gst_caps_to_format (GstCaps *caps, guint index)
{
GstCapsFeatures *f;
GstStructure *s;
SpaFormat *res;
struct spa_format *res;
g_return_val_if_fail (GST_IS_CAPS (caps), NULL);
g_return_val_if_fail (gst_caps_is_fixed (caps), NULL);
@ -597,7 +597,7 @@ foreach_func (GstCapsFeatures *features,
GstStructure *structure,
GPtrArray *array)
{
SpaFormat *fmt;
struct spa_format *fmt;
if ((fmt = convert_1 (features, structure)))
g_ptr_array_insert (array, -1, fmt);
@ -620,10 +620,10 @@ gst_caps_to_format_all (GstCaps *caps)
}
static void
handle_id_prop (SpaPODProp *prop, const char *key, GstCaps *res)
handle_id_prop (struct spa_pod_prop *prop, const char *key, GstCaps *res)
{
const char * str;
uint32_t *id = SPA_POD_CONTENTS (SpaPODProp, prop);
uint32_t *id = SPA_POD_CONTENTS (struct spa_pod_prop, prop);
uint32_t i, n_items = SPA_POD_PROP_N_VALUES (prop);
uint32_t flags;
@ -660,9 +660,9 @@ handle_id_prop (SpaPODProp *prop, const char *key, GstCaps *res)
}
static void
handle_int_prop (SpaPODProp *prop, const char *key, GstCaps *res)
handle_int_prop (struct spa_pod_prop *prop, const char *key, GstCaps *res)
{
uint32_t *val = SPA_POD_CONTENTS (SpaPODProp, prop);
uint32_t *val = SPA_POD_CONTENTS (struct spa_pod_prop, prop);
uint32_t i, n_items = SPA_POD_PROP_N_VALUES (prop);
uint32_t flags;
@ -702,9 +702,9 @@ handle_int_prop (SpaPODProp *prop, const char *key, GstCaps *res)
}
static void
handle_rect_prop (SpaPODProp *prop, const char *width, const char *height, GstCaps *res)
handle_rect_prop (struct spa_pod_prop *prop, const char *width, const char *height, GstCaps *res)
{
SpaRectangle *rect = SPA_POD_CONTENTS (SpaPODProp, prop);
struct spa_rectangle *rect = SPA_POD_CONTENTS (struct spa_pod_prop, prop);
uint32_t i, n_items = SPA_POD_PROP_N_VALUES (prop);
uint32_t flags;
@ -753,9 +753,9 @@ handle_rect_prop (SpaPODProp *prop, const char *width, const char *height, GstCa
}
static void
handle_fraction_prop (SpaPODProp *prop, const char *key, GstCaps *res)
handle_fraction_prop (struct spa_pod_prop *prop, const char *key, GstCaps *res)
{
SpaFraction *fract = SPA_POD_CONTENTS (SpaPODProp, prop);
struct spa_fraction *fract = SPA_POD_CONTENTS (struct spa_pod_prop, prop);
uint32_t i, n_items = SPA_POD_PROP_N_VALUES (prop);
uint32_t flags;
@ -795,11 +795,11 @@ handle_fraction_prop (SpaPODProp *prop, const char *key, GstCaps *res)
}
}
GstCaps *
gst_caps_from_format (const SpaFormat *format)
gst_caps_from_format (const struct spa_format *format)
{
GstCaps *res = NULL;
uint32_t media_type, media_subtype;
SpaPODProp *prop;
struct spa_pod_prop *prop;
ensure_types();

View file

@ -26,10 +26,10 @@
G_BEGIN_DECLS
SpaFormat * gst_caps_to_format (GstCaps *caps, guint index);
struct spa_format * gst_caps_to_format (GstCaps *caps, guint index);
GPtrArray * gst_caps_to_format_all (GstCaps *caps);
GstCaps * gst_caps_from_format (const SpaFormat *format);
GstCaps * gst_caps_from_format (const struct spa_format *format);
G_END_DECLS

View file

@ -241,10 +241,10 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
guint size;
guint min_buffers;
guint max_buffers;
SpaParam *port_params[3];
SpaPODBuilder b = { NULL };
struct spa_param *port_params[3];
struct spa_pod_builder b = { NULL };
uint8_t buffer[1024];
SpaPODFrame f[2];
struct spa_pod_frame f[2];
config = gst_buffer_pool_get_config (GST_BUFFER_POOL (pool));
gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, &max_buffers);
@ -264,23 +264,23 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
PROP (&f[1], ctx->type.param_alloc_buffers.align, SPA_POD_TYPE_INT, 16),
0);
spa_pod_builder_pop (&b, &f[0]);
port_params[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaParam);
port_params[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_param);
spa_pod_builder_object (&b, &f[0], 0, ctx->type.param_alloc_meta_enable.MetaEnable,
PROP (&f[1], ctx->type.param_alloc_meta_enable.type, SPA_POD_TYPE_ID, ctx->type.meta.Header),
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (SpaMetaHeader)));
port_params[1] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaParam);
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (struct spa_meta_header)));
port_params[1] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_param);
spa_pod_builder_object (&b, &f[0], 0, ctx->type.param_alloc_meta_enable.MetaEnable,
PROP (&f[1], ctx->type.param_alloc_meta_enable.type, SPA_POD_TYPE_ID, ctx->type.meta.Ringbuffer),
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (SpaRingbuffer)),
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (struct spa_meta_ringbuffer)),
PROP (&f[1], ctx->type.param_alloc_meta_enable.ringbufferSize, SPA_POD_TYPE_INT,
size * SPA_MAX (4,
SPA_MAX (min_buffers, max_buffers))),
PROP (&f[1], ctx->type.param_alloc_meta_enable.ringbufferStride, SPA_POD_TYPE_INT, 0),
PROP (&f[1], ctx->type.param_alloc_meta_enable.ringbufferBlocks, SPA_POD_TYPE_INT, 1),
PROP (&f[1], ctx->type.param_alloc_meta_enable.ringbufferAlign, SPA_POD_TYPE_INT, 16));
port_params[2] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaParam);
port_params[2] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_param);
pw_stream_finish_format (sink->stream, SPA_RESULT_OK, port_params, 2);
}
@ -414,8 +414,8 @@ gst_pipewire_sink_get_property (GObject * object, guint prop_id,
typedef struct {
GstPipeWireSink *sink;
guint id;
SpaBuffer *buf;
SpaMetaHeader *header;
struct spa_buffer *buf;
struct spa_meta_header *header;
guint flags;
goffset offset;
} ProcessMemData;
@ -435,7 +435,7 @@ on_add_buffer (struct pw_listener *listener,
uint32_t id)
{
GstPipeWireSink *pwsink = SPA_CONTAINER_OF (listener, GstPipeWireSink, stream_add_buffer);
SpaBuffer *b;
struct spa_buffer *b;
GstBuffer *buf;
uint32_t i;
ProcessMemData data;
@ -455,7 +455,7 @@ on_add_buffer (struct pw_listener *listener,
data.header = spa_buffer_find_meta (b, stream->context->type.meta.Header);
for (i = 0; i < b->n_datas; i++) {
SpaData *d = &b->datas[i];
struct spa_data *d = &b->datas[i];
GstMemory *gmem = NULL;
if (d->type == stream->context->type.data.MemFd ||
@ -548,7 +548,7 @@ do_send_buffer (GstPipeWireSink *pwsink)
data->header->dts_offset = GST_BUFFER_DTS (buffer);
}
for (i = 0; i < data->buf->n_datas; i++) {
SpaData *d = &data->buf->datas[i];
struct spa_data *d = &data->buf->datas[i];
GstMemory *mem = gst_buffer_peek_memory (buffer, i);
d->chunk->offset = mem->offset - data->offset;
d->chunk->size = mem->size;
@ -604,7 +604,7 @@ on_state_changed (struct pw_listener *listener,
static void
on_format_changed (struct pw_listener *listener,
struct pw_stream *stream,
SpaFormat *format)
struct spa_format *format)
{
GstPipeWireSink *pwsink = SPA_CONTAINER_OF (listener, GstPipeWireSink, stream_format_changed);
@ -642,7 +642,7 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
pwsink->path,
flags,
possible->len,
(SpaFormat **) possible->pdata);
(struct spa_format **) possible->pdata);
while (TRUE) {
state = pwsink->stream->state;

View file

@ -364,8 +364,8 @@ gst_pipewire_src_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
typedef struct {
GstPipeWireSrc *src;
guint id;
SpaBuffer *buf;
SpaMetaHeader *header;
struct spa_buffer *buf;
struct spa_meta_header *header;
guint flags;
goffset offset;
} ProcessMemData;
@ -405,7 +405,7 @@ on_add_buffer (struct pw_listener *listener,
guint id)
{
GstPipeWireSrc *pwsrc = SPA_CONTAINER_OF (listener, GstPipeWireSrc, stream_add_buffer);
SpaBuffer *b;
struct spa_buffer *b;
GstBuffer *buf;
uint32_t i;
ProcessMemData data;
@ -427,7 +427,7 @@ on_add_buffer (struct pw_listener *listener,
data.header = spa_buffer_find_meta (b, ctx->type.meta.Header);
for (i = 0; i < b->n_datas; i++) {
SpaData *d = &b->datas[i];
struct spa_data *d = &b->datas[i];
GstMemory *gmem = NULL;
if (d->type == ctx->type.data.MemFd || d->type == ctx->type.data.DmaBuf) {
@ -490,7 +490,7 @@ on_new_buffer (struct pw_listener *listener,
GstPipeWireSrc *pwsrc = SPA_CONTAINER_OF (listener, GstPipeWireSrc, stream_new_buffer);
GstBuffer *buf;
ProcessMemData *data;
SpaMetaHeader *h;
struct spa_meta_header *h;
guint i;
buf = g_hash_table_lookup (pwsrc->buf_ids, GINT_TO_POINTER (id));
@ -514,7 +514,7 @@ on_new_buffer (struct pw_listener *listener,
GST_BUFFER_OFFSET (buf) = h->seq;
}
for (i = 0; i < data->buf->n_datas; i++) {
SpaData *d = &data->buf->datas[i];
struct spa_data *d = &data->buf->datas[i];
GstMemory *mem = gst_buffer_peek_memory (buf, i);
mem->offset = d->chunk->offset + data->offset;
mem->size = d->chunk->size;
@ -714,7 +714,7 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
pwsrc->path,
PW_STREAM_FLAG_AUTOCONNECT,
possible->len,
(SpaFormat **)possible->pdata);
(struct spa_format **)possible->pdata);
while (TRUE) {
enum pw_stream_state state = pwsrc->stream->state;
@ -781,7 +781,7 @@ connect_error:
static void
on_format_changed (struct pw_listener *listener,
struct pw_stream *stream,
SpaFormat *format)
struct spa_format *format)
{
GstPipeWireSrc *pwsrc = SPA_CONTAINER_OF (listener, GstPipeWireSrc, stream_format_changed);
GstCaps *caps;
@ -800,10 +800,10 @@ on_format_changed (struct pw_listener *listener,
gst_caps_unref (caps);
if (res) {
SpaParam *params[2];
SpaPODBuilder b = { NULL };
struct spa_param *params[2];
struct spa_pod_builder b = { NULL };
uint8_t buffer[512];
SpaPODFrame f[2];
struct spa_pod_frame f[2];
spa_pod_builder_init (&b, buffer, sizeof (buffer));
spa_pod_builder_object (&b, &f[0], 0, ctx->type.param_alloc_buffers.Buffers,
@ -811,12 +811,12 @@ on_format_changed (struct pw_listener *listener,
PROP_U_MM (&f[1], ctx->type.param_alloc_buffers.stride, SPA_POD_TYPE_INT, 0, 0, INT32_MAX),
PROP_U_MM (&f[1], ctx->type.param_alloc_buffers.buffers, SPA_POD_TYPE_INT, 16, 0, INT32_MAX),
PROP (&f[1], ctx->type.param_alloc_buffers.align, SPA_POD_TYPE_INT, 16));
params[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaParam);
params[0] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_param);
spa_pod_builder_object (&b, &f[0], 0, ctx->type.param_alloc_meta_enable.MetaEnable,
PROP (&f[1], ctx->type.param_alloc_meta_enable.type, SPA_POD_TYPE_ID, ctx->type.meta.Header),
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (SpaMetaHeader)));
params[1] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaParam);
PROP (&f[1], ctx->type.param_alloc_meta_enable.size, SPA_POD_TYPE_INT, sizeof (struct spa_meta_header)));
params[1] = SPA_POD_BUILDER_DEREF (&b, f[0].ref, struct spa_param);
GST_DEBUG_OBJECT (pwsrc, "doing finish format");
pw_stream_finish_format (pwsrc->stream, SPA_RESULT_OK, params, 2);

View file

@ -35,16 +35,16 @@ struct impl {
struct pw_listener global_added;
struct pw_listener global_removed;
SpaList client_list;
struct spa_list client_list;
};
struct client_info {
struct impl *impl;
struct pw_client *client;
SpaList link;
struct spa_list link;
struct pw_listener resource_added;
struct pw_listener resource_removed;
SpaList node_list;
struct spa_list node_list;
};
struct node_info {
@ -52,7 +52,7 @@ struct node_info {
struct client_info *info;
struct pw_node *node;
struct pw_resource *resource;
SpaList link;
struct spa_list link;
struct pw_listener state_changed;
struct pw_listener port_added;
struct pw_listener port_removed;

View file

@ -42,25 +42,25 @@ struct impl {
struct pw_listener global_added;
struct pw_listener global_removed;
SpaList client_list;
struct spa_list client_list;
struct pw_access access;
SpaSource *dispatch_event;
struct spa_source *dispatch_event;
};
struct client_info {
struct impl *impl;
SpaList link;
struct impl *impl;
struct spa_list link;
struct pw_client *client;
bool is_sandboxed;
SpaList async_pending;
bool is_sandboxed;
struct spa_list async_pending;
};
struct async_pending {
SpaList link;
bool handled;
struct client_info *info;
char *handle;
struct spa_list link;
bool handled;
struct client_info *info;
char *handle;
struct pw_access_data *access_data;
};
@ -232,7 +232,7 @@ check_global_owner (struct pw_core *core,
return false;
}
static SpaResult
static int
do_view_global (struct pw_access *access,
struct pw_client *client,
struct pw_global *global)
@ -253,7 +253,7 @@ do_view_global (struct pw_access *access,
return SPA_RESULT_OK;
}
static SpaResult
static int
do_create_node (struct pw_access *access,
struct pw_access_data *data,
const char *factory_name,
@ -310,7 +310,7 @@ portal_response (DBusConnection *connection, DBusMessage *msg, void *user_data)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
static SpaResult
static int
do_create_client_node (struct pw_access *access,
struct pw_access_data *data,
const char *name,
@ -453,7 +453,7 @@ on_global_removed (struct pw_listener *listener,
}
static void
dispatch_cb (SpaLoopUtils *utils, SpaSource *source, void *userdata)
dispatch_cb (struct spa_loop_utils *utils, struct spa_source *source, void *userdata)
{
struct impl *impl = userdata;
@ -471,10 +471,10 @@ dispatch_status (DBusConnection *conn, DBusDispatchStatus status, void *userdata
status == DBUS_DISPATCH_COMPLETE ? false : true);
}
static inline SpaIO
static inline enum spa_io
dbus_to_io (DBusWatch *watch)
{
SpaIO mask;
enum spa_io mask;
unsigned int flags;
/* no watch flags for disabled watches */
@ -493,7 +493,7 @@ dbus_to_io (DBusWatch *watch)
}
static inline unsigned int
io_to_dbus (SpaIO mask)
io_to_dbus (enum spa_io mask)
{
unsigned int flags = 0;
@ -509,10 +509,10 @@ io_to_dbus (SpaIO mask)
}
static void
handle_io_event (SpaLoopUtils *utils,
SpaSource *source,
handle_io_event (struct spa_loop_utils *utils,
struct spa_source *source,
int fd,
SpaIO mask,
enum spa_io mask,
void *userdata)
{
DBusWatch *watch = userdata;
@ -528,7 +528,7 @@ static dbus_bool_t
add_watch (DBusWatch *watch, void *userdata)
{
struct impl *impl = userdata;
SpaSource *source;
struct spa_source *source;
pw_log_debug ("add watch %p %d", watch, dbus_watch_get_unix_fd (watch));
@ -549,7 +549,7 @@ static void
remove_watch (DBusWatch *watch, void *userdata)
{
struct impl *impl = userdata;
SpaSource *source;
struct spa_source *source;
if ((source = dbus_watch_get_data (watch)))
pw_loop_destroy_source (impl->core->main_loop->loop, source);
@ -559,7 +559,7 @@ static void
toggle_watch (DBusWatch *watch, void *userdata)
{
struct impl *impl = userdata;
SpaSource *source;
struct spa_source *source;
source = dbus_watch_get_data (watch);
@ -569,7 +569,7 @@ toggle_watch (DBusWatch *watch, void *userdata)
}
static void
handle_timer_event (SpaLoopUtils *utils, SpaSource *source, void *userdata)
handle_timer_event (struct spa_loop_utils *utils, struct spa_source *source, void *userdata)
{
DBusTimeout *timeout = userdata;
uint64_t t;
@ -589,7 +589,7 @@ static dbus_bool_t
add_timeout (DBusTimeout *timeout, void *userdata)
{
struct impl *impl = userdata;
SpaSource *source;
struct spa_source *source;
struct timespec ts;
uint64_t t;
@ -617,7 +617,7 @@ static void
remove_timeout (DBusTimeout *timeout, void *userdata)
{
struct impl *impl = userdata;
SpaSource *source;
struct spa_source *source;
if ((source = dbus_timeout_get_data (timeout)))
pw_loop_destroy_source (impl->core->main_loop->loop, source);
@ -627,7 +627,7 @@ static void
toggle_timeout (DBusTimeout *timeout, void *userdata)
{
struct impl *impl = userdata;
SpaSource *source;
struct spa_source *source;
struct timespec ts, *tsp;
source = dbus_timeout_get_data (timeout);

View file

@ -34,22 +34,22 @@ struct impl {
struct pw_properties *properties;
void *hnd;
const SpaHandleFactory *factory;
const struct spa_handle_factory *factory;
};
static const SpaHandleFactory *
static const struct spa_handle_factory *
find_factory (struct impl *impl)
{
SpaEnumHandleFactoryFunc enum_func;
spa_handle_factory_enum_func_t enum_func;
uint32_t index;
const SpaHandleFactory *factory = NULL;
SpaResult res;
const struct spa_handle_factory *factory = NULL;
int res;
if ((impl->hnd = dlopen (AUDIOMIXER_LIB, RTLD_NOW)) == NULL) {
pw_log_error ("can't load %s: %s", AUDIOMIXER_LIB, dlerror());
return NULL;
}
if ((enum_func = dlsym (impl->hnd, "spa_enum_handle_factory")) == NULL) {
if ((enum_func = dlsym (impl->hnd, SPA_HANDLE_FACTORY_ENUM_FUNC_NAME)) == NULL) {
pw_log_error ("can't find enum function");
goto no_symbol;
}
@ -75,11 +75,11 @@ no_symbol:
static struct pw_node *
make_node (struct impl *impl)
{
SpaHandle *handle;
SpaResult res;
struct spa_handle *handle;
int res;
void *iface;
SpaNode *spa_node;
SpaClock *spa_clock;
struct spa_node *spa_node;
struct spa_clock *spa_clock;
struct pw_node *node;
handle = calloc (1, impl->factory->size);

View file

@ -52,15 +52,15 @@
struct impl {
struct pw_core *core;
SpaList link;
struct spa_list link;
struct pw_properties *properties;
GDBusConnection *connection;
GDBusObjectManagerServer *server_manager;
SpaList client_list;
SpaList object_list;
struct spa_list client_list;
struct spa_list object_list;
struct pw_listener global_added;
struct pw_listener global_removed;
@ -68,7 +68,7 @@ struct impl {
struct object {
struct impl *impl;
SpaList link;
struct spa_list link;
struct pw_global *global;
void *iface;
PipeWireObjectSkeleton *skel;
@ -78,15 +78,15 @@ struct object {
struct server {
struct object parent;
SpaList link;
struct spa_list link;
guint id;
};
struct client {
struct object parent;
SpaList link;
gchar *sender;
guint id;
struct object parent;
struct spa_list link;
gchar *sender;
guint id;
};
struct node {
@ -389,7 +389,7 @@ handle_create_client_node (PipeWireDaemon1 *interface,
struct impl *impl = user_data;
struct pw_client_node *node;
struct pw_client *client;
SpaResult res;
int res;
const char *sender, *object_path, *target_node;
struct pw_properties *props;
GError *error = NULL;

View file

@ -59,30 +59,31 @@ struct socket {
int fd_lock;
struct sockaddr_un addr;
char lock_addr[UNIX_PATH_MAX + LOCK_SUFFIXLEN];
struct pw_loop *loop;
SpaSource *source;
char *core_name;
SpaList link;
struct pw_loop *loop;
struct spa_source *source;
char *core_name;
struct spa_list link;
};
struct impl {
struct pw_core *core;
SpaList link;
struct spa_list link;
struct pw_properties *properties;
SpaList socket_list;
SpaList client_list;
struct spa_list socket_list;
struct spa_list client_list;
struct pw_listener before_iterate;
};
struct native_client {
struct impl *impl;
SpaList link;
struct impl *impl;
struct spa_list link;
struct pw_client *client;
int fd;
SpaSource *source;
struct spa_source *source;
struct pw_connection *connection;
struct pw_listener resource_added;
};
@ -120,11 +121,11 @@ on_before_iterate (struct pw_listener *listener,
}
static void
connection_data (SpaLoopUtils *utils,
SpaSource *source,
int fd,
SpaIO mask,
void *data)
connection_data (struct spa_loop_utils *utils,
struct spa_source *source,
int fd,
enum spa_io mask,
void *data)
{
struct native_client *client = data;
struct pw_connection *conn = client->connection;
@ -331,10 +332,10 @@ err:
}
static void
socket_data (SpaLoopUtils *utils,
SpaSource *source,
socket_data (struct spa_loop_utils *utils,
struct spa_source *source,
int fd,
SpaIO mask,
enum spa_io mask,
void *data)
{
struct impl *impl = data;

View file

@ -33,22 +33,22 @@ struct impl {
struct pw_listener global_added;
struct pw_listener global_removed;
SpaList node_list;
struct spa_list node_list;
};
typedef struct {
struct node_info {
struct impl *impl;
struct pw_node *node;
SpaList link;
struct spa_list link;
struct pw_listener node_state_request;
struct pw_listener node_state_changed;
SpaSource *idle_timeout;
} NodeInfo;
struct spa_source *idle_timeout;
};
static NodeInfo *
static struct node_info *
find_node_info (struct impl *impl, struct pw_node *node)
{
NodeInfo *info;
struct node_info *info;
spa_list_for_each (info, &impl->node_list, link) {
if (info->node == node)
@ -58,7 +58,7 @@ find_node_info (struct impl *impl, struct pw_node *node)
}
static void
remove_idle_timeout (NodeInfo *info)
remove_idle_timeout (struct node_info *info)
{
if (info->idle_timeout) {
pw_loop_destroy_source (info->impl->core->main_loop->loop, info->idle_timeout);
@ -67,7 +67,7 @@ remove_idle_timeout (NodeInfo *info)
}
static void
node_info_free (NodeInfo *info)
node_info_free (struct node_info *info)
{
spa_list_remove (&info->link);
remove_idle_timeout (info);
@ -77,11 +77,11 @@ node_info_free (NodeInfo *info)
}
static void
idle_timeout (SpaLoopUtils *utils,
SpaSource *source,
idle_timeout (struct spa_loop_utils *utils,
struct spa_source *source,
void *data)
{
NodeInfo *info = data;
struct node_info *info = data;
pw_log_debug ("module %p: node %p idle timeout", info->impl, info->node);
remove_idle_timeout (info);
@ -93,7 +93,7 @@ on_node_state_request (struct pw_listener *listener,
struct pw_node *node,
enum pw_node_state state)
{
NodeInfo *info = SPA_CONTAINER_OF (listener, NodeInfo, node_state_request);
struct node_info *info = SPA_CONTAINER_OF (listener, struct node_info, node_state_request);
remove_idle_timeout (info);
}
@ -103,7 +103,7 @@ on_node_state_changed (struct pw_listener *listener,
enum pw_node_state old,
enum pw_node_state state)
{
NodeInfo *info = SPA_CONTAINER_OF (listener, NodeInfo, node_state_changed);
struct node_info *info = SPA_CONTAINER_OF (listener, struct node_info, node_state_changed);
struct impl *impl = info->impl;
if (state != PW_NODE_STATE_IDLE) {
@ -134,9 +134,9 @@ on_global_added (struct pw_listener *listener,
if (global->type == impl->core->type.node) {
struct pw_node *node = global->object;
NodeInfo *info;
struct node_info *info;
info = calloc (1, sizeof (NodeInfo));
info = calloc (1, sizeof (struct node_info));
info->impl = impl;
info->node = node;
spa_list_insert (impl->node_list.prev, &info->link);
@ -156,7 +156,7 @@ on_global_removed (struct pw_listener *listener,
if (global->type == impl->core->type.node) {
struct pw_node *node = global->object;
NodeInfo *info;
struct node_info *info;
if ((info = find_node_info (impl, node)))
node_info_free (info);

View file

@ -30,11 +30,11 @@
#include "spa-monitor.h"
#include "spa-node.h"
static SpaResult
setup_video_node (struct pw_core *core, SpaNode *spa_node, struct pw_properties *pw_props) {
SpaResult res;
SpaProps *props;
SpaPODProp *prop;
static int
setup_video_node (struct pw_core *core, struct spa_node *spa_node, struct pw_properties *pw_props) {
int res;
struct spa_props *props;
struct spa_pod_prop *prop;
const char *pattern, *pattern_type;
/* Retrieve pattern property */
@ -53,9 +53,9 @@ setup_video_node (struct pw_core *core, SpaNode *spa_node, struct pw_properties
return SPA_RESULT_ERROR;
}
if ((prop = spa_pod_object_find_prop (props, spa_type_map_get_id (core->type.map, SPA_TYPE_PROPS__patternType)))) {
if ((prop = spa_pod_object_find_prop (&props->object, spa_type_map_get_id (core->type.map, SPA_TYPE_PROPS__patternType)))) {
if (prop->body.value.type == SPA_POD_TYPE_ID)
SPA_POD_VALUE (SpaPODId, &prop->body.value) = spa_type_map_get_id (core->type.map, pattern_type);
SPA_POD_VALUE (struct spa_pod_id, &prop->body.value) = spa_type_map_get_id (core->type.map, pattern_type);
}
if ((res = spa_node_set_props (spa_node, props)) != SPA_RESULT_OK) {

View file

@ -36,9 +36,9 @@
struct monitor_item
{
char *id;
SpaList link;
struct pw_node *node;
char *id;
struct spa_list link;
struct pw_node *node;
};
struct impl {
@ -48,24 +48,24 @@ struct impl {
void *hnd;
SpaList item_list;
struct spa_list item_list;
};
static void
add_item (struct pw_spa_monitor *this, SpaMonitorItem *item)
add_item (struct pw_spa_monitor *this, struct spa_monitor_item *item)
{
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
SpaResult res;
SpaHandle *handle;
int res;
struct spa_handle *handle;
struct monitor_item *mitem;
void *node_iface;
void *clock_iface;
struct pw_properties *props = NULL;
const char *name, *id, *klass;
SpaHandleFactory *factory;
SpaPOD *info = NULL;
struct spa_handle_factory *factory;
struct spa_pod *info = NULL;
spa_pod_object_query (item,
spa_pod_object_query (&item->object,
impl->core->type.monitor.name, SPA_POD_TYPE_STRING, &name,
impl->core->type.monitor.id, SPA_POD_TYPE_STRING, &id,
impl->core->type.monitor.klass, SPA_POD_TYPE_STRING, &klass,
@ -78,7 +78,7 @@ add_item (struct pw_spa_monitor *this, SpaMonitorItem *item)
props = pw_properties_new (NULL, NULL);
if (info) {
SpaPODIter it;
struct spa_pod_iter it;
spa_pod_iter_pod (&it, info);
while (true) {
@ -146,13 +146,13 @@ destroy_item (struct monitor_item *mitem)
}
static void
remove_item (struct pw_spa_monitor *this, SpaMonitorItem *item)
remove_item (struct pw_spa_monitor *this, struct spa_monitor_item *item)
{
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
struct monitor_item *mitem;
const char *name, *id;
spa_pod_object_query (item,
spa_pod_object_query (&item->object,
impl->core->type.monitor.name, SPA_POD_TYPE_STRING, &name,
impl->core->type.monitor.id, SPA_POD_TYPE_STRING, &id,
0);
@ -164,26 +164,26 @@ remove_item (struct pw_spa_monitor *this, SpaMonitorItem *item)
}
static void
on_monitor_event (SpaMonitor *monitor,
SpaEventMonitor *event,
void *user_data)
on_monitor_event (struct spa_monitor *monitor,
struct spa_event *event,
void *user_data)
{
struct pw_spa_monitor *this = user_data;
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
if (SPA_EVENT_TYPE (event) == impl->core->type.monitor.Added) {
SpaMonitorItem *item = SPA_POD_CONTENTS (SpaEvent, event);
struct spa_monitor_item *item = SPA_POD_CONTENTS (struct spa_event, event);
add_item (this, item);
}
else if (SPA_EVENT_TYPE (event) == impl->core->type.monitor.Removed) {
SpaMonitorItem *item = SPA_POD_CONTENTS (SpaEvent, event);
struct spa_monitor_item *item = SPA_POD_CONTENTS (struct spa_event, event);
remove_item (this, item);
}
else if (SPA_EVENT_TYPE (event) == impl->core->type.monitor.Changed) {
SpaMonitorItem *item = SPA_POD_CONTENTS (SpaEvent, event);
struct spa_monitor_item *item = SPA_POD_CONTENTS (struct spa_event, event);
const char *name;
spa_pod_object_query (item,
spa_pod_object_query (&item->object,
impl->core->type.monitor.name, SPA_POD_TYPE_STRING, &name,
0);
@ -196,8 +196,8 @@ update_monitor (struct pw_core *core,
const char *name)
{
const char *monitors;
SpaDictItem item;
SpaDict dict = SPA_DICT_INIT(1, &item);
struct spa_dict_item item;
struct spa_dict dict = SPA_DICT_INIT(1, &item);
if (core->properties)
monitors = pw_properties_get (core->properties, "monitors");
@ -216,6 +216,10 @@ update_monitor (struct pw_core *core,
free ((void*)item.value);
}
static const struct spa_monitor_callbacks callbacks = {
on_monitor_event,
};
struct pw_spa_monitor *
pw_spa_monitor_load (struct pw_core *core,
const char *lib,
@ -224,19 +228,19 @@ pw_spa_monitor_load (struct pw_core *core,
{
struct impl *impl;
struct pw_spa_monitor *this;
SpaHandle *handle;
SpaResult res;
struct spa_handle *handle;
int res;
void *iface;
void *hnd;
uint32_t index;
SpaEnumHandleFactoryFunc enum_func;
const SpaHandleFactory *factory;
spa_handle_factory_enum_func_t enum_func;
const struct spa_handle_factory *factory;
if ((hnd = dlopen (lib, RTLD_NOW)) == NULL) {
pw_log_error ("can't load %s: %s", lib, dlerror());
return NULL;
}
if ((enum_func = dlsym (hnd, "spa_enum_handle_factory")) == NULL) {
if ((enum_func = dlsym (hnd, SPA_HANDLE_FACTORY_ENUM_FUNC_NAME)) == NULL) {
pw_log_error ("can't find enum function");
goto no_symbol;
}
@ -284,8 +288,8 @@ pw_spa_monitor_load (struct pw_core *core,
spa_list_init (&impl->item_list);
for (index = 0;; index++) {
SpaMonitorItem *item;
SpaResult res;
struct spa_monitor_item *item;
int res;
if ((res = spa_monitor_enum_items (this->monitor, &item, index)) < 0) {
if (res != SPA_RESULT_ENUM_END)
@ -294,7 +298,7 @@ pw_spa_monitor_load (struct pw_core *core,
}
add_item (this, item);
}
spa_monitor_set_event_callback (this->monitor, on_monitor_event, this);
spa_monitor_set_callbacks (this->monitor, &callbacks, sizeof (callbacks), this);
return this;

View file

@ -28,12 +28,12 @@ extern "C" {
#endif
struct pw_spa_monitor {
SpaMonitor *monitor;
struct spa_monitor *monitor;
char *lib;
char *factory_name;
char *system_name;
SpaHandle *handle;
struct spa_handle *handle;
PW_SIGNAL (destroy_signal, (struct pw_listener *listener, struct pw_spa_monitor *monitor));
};

View file

@ -42,21 +42,21 @@ pw_spa_node_load (struct pw_core *core,
{
struct pw_spa_node *this;
struct impl *impl;
SpaNode *spa_node;
SpaClock *spa_clock;
SpaResult res;
SpaHandle *handle;
struct spa_node *spa_node;
struct spa_clock *spa_clock;
int res;
struct spa_handle *handle;
void *hnd;
uint32_t index;
SpaEnumHandleFactoryFunc enum_func;
const SpaHandleFactory *factory;
spa_handle_factory_enum_func_t enum_func;
const struct spa_handle_factory *factory;
void *iface;
if ((hnd = dlopen (lib, RTLD_NOW)) == NULL) {
pw_log_error ("can't load %s: %s", lib, dlerror());
return NULL;
}
if ((enum_func = dlsym (hnd, "spa_enum_handle_factory")) == NULL) {
if ((enum_func = dlsym (hnd, SPA_HANDLE_FACTORY_ENUM_FUNC_NAME)) == NULL) {
pw_log_error ("can't find enum function");
goto no_symbol;
}

View file

@ -32,13 +32,13 @@ struct pw_spa_node {
char *lib;
char *factory_name;
SpaHandle *handle;
struct spa_handle *handle;
PW_SIGNAL (destroy_signal, (struct pw_listener *listener,
struct pw_spa_node *node));
};
typedef SpaResult (*setup_node_t) (struct pw_core *core,
SpaNode *spa_node,
typedef int (*setup_node_t) (struct pw_core *core,
struct spa_node *spa_node,
struct pw_properties *pw_props);
struct pw_spa_node * pw_spa_node_load (struct pw_core *core,

View file

@ -32,7 +32,7 @@ extern "C" {
#include <pipewire/server/resource.h>
struct pw_access_data {
SpaResult res;
int res;
struct pw_resource *resource;
void * (*async_copy) (struct pw_access_data *data, size_t size);
@ -48,15 +48,15 @@ struct pw_access_data {
* PipeWire Access support struct.
*/
struct pw_access {
SpaResult (*view_global) (struct pw_access *access,
int (*view_global) (struct pw_access *access,
struct pw_client *client,
struct pw_global *global);
SpaResult (*create_node) (struct pw_access *access,
int (*create_node) (struct pw_access *access,
struct pw_access_data *data,
const char *factory_name,
const char *name,
struct pw_properties *properties);
SpaResult (*create_client_node) (struct pw_access *access,
int (*create_client_node) (struct pw_access *access,
struct pw_access_data *data,
const char *name,
struct pw_properties *properties);

View file

@ -56,24 +56,24 @@
#define CHECK_PORT_BUFFER(this,b,p) (b < p->n_buffers)
struct proxy_buffer {
SpaBuffer *outbuf;
SpaBuffer buffer;
SpaMeta metas[4];
SpaData datas[4];
off_t offset;
size_t size;
bool outstanding;
struct spa_buffer *outbuf;
struct spa_buffer buffer;
struct spa_meta metas[4];
struct spa_data datas[4];
off_t offset;
size_t size;
bool outstanding;
};
struct proxy_port {
bool valid;
SpaPortInfo info;
SpaFormat *format;
struct spa_port_info info;
struct spa_format *format;
uint32_t n_formats;
SpaFormat **formats;
struct spa_format **formats;
uint32_t n_params;
SpaParam **params;
SpaPortIO *io;
struct spa_param **params;
struct spa_port_io *io;
uint32_t n_buffers;
struct proxy_buffer buffers[MAX_BUFFERS];
@ -84,21 +84,21 @@ struct proxy_port {
struct proxy
{
SpaNode node;
struct spa_node node;
struct impl *impl;
SpaTypeMap *map;
SpaLog *log;
SpaLoop *main_loop;
SpaLoop *data_loop;
struct spa_type_map *map;
struct spa_log *log;
struct spa_loop *main_loop;
struct spa_loop *data_loop;
SpaNodeCallbacks callbacks;
struct spa_node_callbacks callbacks;
void *user_data;
struct pw_resource *resource;
SpaSource data_source;
struct spa_source data_source;
int writefd;
uint32_t max_inputs;
@ -130,7 +130,7 @@ struct impl {
int other_fds[2];
};
static SpaResult
static int
clear_buffers (struct proxy *this, struct proxy_port *port)
{
if (port->n_buffers) {
@ -143,16 +143,16 @@ clear_buffers (struct proxy *this, struct proxy_port *port)
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_get_props (SpaNode *node,
SpaProps **props)
static int
spa_proxy_node_get_props (struct spa_node *node,
struct spa_props **props)
{
return SPA_RESULT_NOT_IMPLEMENTED;
}
static SpaResult
spa_proxy_node_set_props (SpaNode *node,
const SpaProps *props)
static int
spa_proxy_node_set_props (struct spa_node *node,
const struct spa_props *props)
{
return SPA_RESULT_NOT_IMPLEMENTED;
}
@ -184,12 +184,12 @@ send_have_output (struct proxy *this)
do_flush (this);
}
static SpaResult
spa_proxy_node_send_command (SpaNode *node,
SpaCommand *command)
static int
spa_proxy_node_send_command (struct spa_node *node,
struct spa_command *command)
{
struct proxy *this;
SpaResult res = SPA_RESULT_OK;
int res = SPA_RESULT_OK;
struct pw_core *core;
if (node == NULL || command == NULL)
@ -220,9 +220,9 @@ spa_proxy_node_send_command (SpaNode *node,
return res;
}
static SpaResult
spa_proxy_node_set_callbacks (SpaNode *node,
const SpaNodeCallbacks *callbacks,
static int
spa_proxy_node_set_callbacks (struct spa_node *node,
const struct spa_node_callbacks *callbacks,
size_t callbacks_size,
void *user_data)
{
@ -238,8 +238,8 @@ spa_proxy_node_set_callbacks (SpaNode *node,
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_get_n_ports (SpaNode *node,
static int
spa_proxy_node_get_n_ports (struct spa_node *node,
uint32_t *n_input_ports,
uint32_t *max_input_ports,
uint32_t *n_output_ports,
@ -264,8 +264,8 @@ spa_proxy_node_get_n_ports (SpaNode *node,
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_get_port_ids (SpaNode *node,
static int
spa_proxy_node_get_port_ids (struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
@ -296,15 +296,15 @@ spa_proxy_node_get_port_ids (SpaNode *node,
static void
do_update_port (struct proxy *this,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t change_mask,
uint32_t n_possible_formats,
const SpaFormat **possible_formats,
const SpaFormat *format,
const struct spa_format **possible_formats,
const struct spa_format *format,
uint32_t n_params,
const SpaParam **params,
const SpaPortInfo *info)
const struct spa_param **params,
const struct spa_port_info *info)
{
struct proxy_port *port;
uint32_t i;
@ -319,7 +319,7 @@ do_update_port (struct proxy *this,
for (i = 0; i < port->n_formats; i++)
free (port->formats[i]);
port->n_formats = n_possible_formats;
port->formats = realloc (port->formats, port->n_formats * sizeof (SpaFormat *));
port->formats = realloc (port->formats, port->n_formats * sizeof (struct spa_format *));
for (i = 0; i < port->n_formats; i++)
port->formats[i] = spa_format_copy (possible_formats[i]);
}
@ -333,7 +333,7 @@ do_update_port (struct proxy *this,
for (i = 0; i < port->n_params; i++)
free (port->params[i]);
port->n_params = n_params;
port->params = realloc (port->params, port->n_params * sizeof (SpaParam *));
port->params = realloc (port->params, port->n_params * sizeof (struct spa_param *));
for (i = 0; i < port->n_params; i++)
port->params[i] = spa_param_copy (params[i]);
}
@ -356,7 +356,7 @@ do_update_port (struct proxy *this,
static void
clear_port (struct proxy *this,
struct proxy_port *port,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id)
{
do_update_port (this,
@ -377,7 +377,7 @@ clear_port (struct proxy *this,
static void
do_uninit_port (struct proxy *this,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id)
{
struct proxy_port *port;
@ -394,9 +394,9 @@ do_uninit_port (struct proxy *this,
port->valid = false;
}
static SpaResult
spa_proxy_node_add_port (SpaNode *node,
SpaDirection direction,
static int
spa_proxy_node_add_port (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id)
{
struct proxy *this;
@ -416,9 +416,9 @@ spa_proxy_node_add_port (SpaNode *node,
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_remove_port (SpaNode *node,
SpaDirection direction,
static int
spa_proxy_node_remove_port (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id)
{
struct proxy *this;
@ -436,19 +436,19 @@ spa_proxy_node_remove_port (SpaNode *node,
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_port_enum_formats (SpaNode *node,
SpaDirection direction,
static int
spa_proxy_node_port_enum_formats (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
SpaFormat **format,
const SpaFormat *filter,
struct spa_format **format,
const struct spa_format *filter,
uint32_t index)
{
struct proxy *this;
struct proxy_port *port;
SpaFormat *fmt;
SpaPODBuilder b = { NULL, };
SpaResult res;
struct spa_format *fmt;
struct spa_pod_builder b = { NULL, };
int res;
uint32_t count, match = 0;
if (node == NULL || format == NULL)
@ -474,17 +474,17 @@ next:
if ((res = spa_format_filter (fmt, filter, &b)) != SPA_RESULT_OK || match++ != index)
goto next;
*format = SPA_POD_BUILDER_DEREF (&b, 0, SpaFormat);
*format = SPA_POD_BUILDER_DEREF (&b, 0, struct spa_format);
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_port_set_format (SpaNode *node,
SpaDirection direction,
static int
spa_proxy_node_port_set_format (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
uint32_t flags,
const SpaFormat *format)
const struct spa_format *format)
{
struct proxy *this;
@ -509,11 +509,11 @@ spa_proxy_node_port_set_format (SpaNode *node,
return SPA_RESULT_RETURN_ASYNC (this->seq++);
}
static SpaResult
spa_proxy_node_port_get_format (SpaNode *node,
SpaDirection direction,
static int
spa_proxy_node_port_get_format (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
const SpaFormat **format)
const struct spa_format **format)
{
struct proxy *this;
struct proxy_port *port;
@ -536,11 +536,11 @@ spa_proxy_node_port_get_format (SpaNode *node,
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_port_get_info (SpaNode *node,
SpaDirection direction,
static int
spa_proxy_node_port_get_info (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
const SpaPortInfo **info)
const struct spa_port_info **info)
{
struct proxy *this;
struct proxy_port *port;
@ -560,12 +560,12 @@ spa_proxy_node_port_get_info (SpaNode *node,
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_port_enum_params (SpaNode *node,
SpaDirection direction,
static int
spa_proxy_node_port_enum_params (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
uint32_t index,
SpaParam **param)
struct spa_param **param)
{
struct proxy *this;
struct proxy_port *port;
@ -587,20 +587,20 @@ spa_proxy_node_port_enum_params (SpaNode *node,
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_port_set_param (SpaNode *node,
SpaDirection direction,
static int
spa_proxy_node_port_set_param (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
const SpaParam *param)
const struct spa_param *param)
{
return SPA_RESULT_NOT_IMPLEMENTED;
}
static SpaResult
spa_proxy_node_port_set_io (SpaNode *node,
SpaDirection direction,
static int
spa_proxy_node_port_set_io (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
SpaPortIO *io)
struct spa_port_io *io)
{
struct proxy *this;
struct proxy_port *port;
@ -619,12 +619,12 @@ spa_proxy_node_port_set_io (SpaNode *node,
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_port_use_buffers (SpaNode *node,
SpaDirection direction,
uint32_t port_id,
SpaBuffer **buffers,
uint32_t n_buffers)
static int
spa_proxy_node_port_use_buffers (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
struct spa_buffer **buffers,
uint32_t n_buffers)
{
struct proxy *this;
struct impl *impl;
@ -632,7 +632,7 @@ spa_proxy_node_port_use_buffers (SpaNode *node,
uint32_t i, j;
size_t n_mem;
struct pw_client_node_buffer *mb;
SpaMetaShared *msh;
struct spa_meta_shared *msh;
this = SPA_CONTAINER_OF (node, struct proxy, node);
impl = this->impl;
@ -670,7 +670,7 @@ spa_proxy_node_port_use_buffers (SpaNode *node,
}
b->outbuf = buffers[i];
memcpy (&b->buffer, buffers[i], sizeof (SpaBuffer));
memcpy (&b->buffer, buffers[i], sizeof (struct spa_buffer));
b->buffer.datas = b->datas;
b->buffer.metas = b->metas;
@ -690,13 +690,13 @@ spa_proxy_node_port_use_buffers (SpaNode *node,
msh->size);
for (j = 0; j < buffers[i]->n_metas; j++) {
memcpy (&b->buffer.metas[j], &buffers[i]->metas[j], sizeof (SpaMeta));
memcpy (&b->buffer.metas[j], &buffers[i]->metas[j], sizeof (struct spa_meta));
}
for (j = 0; j < buffers[i]->n_datas; j++) {
SpaData *d = &buffers[i]->datas[j];
struct spa_data *d = &buffers[i]->datas[j];
memcpy (&b->buffer.datas[j], d, sizeof (SpaData));
memcpy (&b->buffer.datas[j], d, sizeof (struct spa_data));
if (d->type == impl->core->type.data.DmaBuf ||
d->type == impl->core->type.data.MemFd) {
@ -735,14 +735,14 @@ spa_proxy_node_port_use_buffers (SpaNode *node,
return SPA_RESULT_RETURN_ASYNC (this->seq++);
}
static SpaResult
spa_proxy_node_port_alloc_buffers (SpaNode *node,
SpaDirection direction,
uint32_t port_id,
SpaParam **params,
uint32_t n_params,
SpaBuffer **buffers,
uint32_t *n_buffers)
static int
spa_proxy_node_port_alloc_buffers (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
struct spa_param **params,
uint32_t n_params,
struct spa_buffer **buffers,
uint32_t *n_buffers)
{
struct proxy *this;
struct proxy_port *port;
@ -763,8 +763,8 @@ spa_proxy_node_port_alloc_buffers (SpaNode *node,
return SPA_RESULT_NOT_IMPLEMENTED;
}
static SpaResult
spa_proxy_node_port_reuse_buffer (SpaNode *node,
static int
spa_proxy_node_port_reuse_buffer (struct spa_node *node,
uint32_t port_id,
uint32_t buffer_id)
{
@ -784,17 +784,17 @@ spa_proxy_node_port_reuse_buffer (SpaNode *node,
{
struct pw_event_transport_reuse_buffer rb = PW_EVENT_TRANSPORT_REUSE_BUFFER_INIT
(impl->core->type.event_transport.ReuseBuffer, port_id, buffer_id);
pw_transport_add_event (impl->transport, (SpaEvent *)&rb);
pw_transport_add_event (impl->transport, (struct spa_event *)&rb);
}
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_port_send_command (SpaNode *node,
SpaDirection direction,
uint32_t port_id,
SpaCommand *command)
static int
spa_proxy_node_port_send_command (struct spa_node *node,
enum spa_direction direction,
uint32_t port_id,
struct spa_command *command)
{
struct proxy *this;
@ -807,8 +807,8 @@ spa_proxy_node_port_send_command (SpaNode *node,
return SPA_RESULT_NOT_IMPLEMENTED;
}
static SpaResult
spa_proxy_node_process_input (SpaNode *node)
static int
spa_proxy_node_process_input (struct spa_node *node)
{
struct impl *impl;
struct proxy *this;
@ -821,7 +821,7 @@ spa_proxy_node_process_input (SpaNode *node)
impl = this->impl;
for (i = 0; i < MAX_INPUTS; i++) {
SpaPortIO *io = this->in_ports[i].io;
struct spa_port_io *io = this->in_ports[i].io;
if (!io)
continue;
@ -836,8 +836,8 @@ spa_proxy_node_process_input (SpaNode *node)
return SPA_RESULT_OK;
}
static SpaResult
spa_proxy_node_process_output (SpaNode *node)
static int
spa_proxy_node_process_output (struct spa_node *node)
{
struct proxy *this;
struct impl *impl;
@ -848,7 +848,7 @@ spa_proxy_node_process_output (SpaNode *node)
impl = this->impl;
for (i = 0; i < MAX_OUTPUTS; i++) {
SpaPortIO *io = this->out_ports[i].io, tmp;
struct spa_port_io *io = this->out_ports[i].io, tmp;
if (!io)
continue;
@ -859,7 +859,7 @@ spa_proxy_node_process_output (SpaNode *node)
spa_log_trace (this->log, "reuse buffer %d", io->buffer_id);
pw_transport_add_event (impl->transport, (SpaEvent *)&rb);
pw_transport_add_event (impl->transport, (struct spa_event *)&rb);
io->buffer_id = SPA_ID_INVALID;
flush = true;
}
@ -882,16 +882,16 @@ spa_proxy_node_process_output (SpaNode *node)
return SPA_RESULT_HAVE_BUFFER;
}
static SpaResult
static int
handle_node_event (struct proxy *this,
SpaEvent *event)
struct spa_event *event)
{
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, proxy);
int i;
if (SPA_EVENT_TYPE (event) == impl->core->type.event_transport.HaveOutput) {
for (i = 0; i < MAX_OUTPUTS; i++) {
SpaPortIO *io = this->out_ports[i].io;
struct spa_port_io *io = this->out_ports[i].io;
if (!io)
continue;
@ -916,7 +916,7 @@ client_node_update (void *object,
uint32_t change_mask,
uint32_t max_input_ports,
uint32_t max_output_ports,
const SpaProps *props)
const struct spa_props *props)
{
struct pw_resource *resource = object;
struct pw_client_node *node = resource->object;
@ -934,15 +934,15 @@ client_node_update (void *object,
static void
client_node_port_update (void *object,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t change_mask,
uint32_t n_possible_formats,
const SpaFormat **possible_formats,
const SpaFormat *format,
const struct spa_format **possible_formats,
const struct spa_format *format,
uint32_t n_params,
const SpaParam **params,
const SpaPortInfo *info)
const struct spa_param **params,
const struct spa_port_info *info)
{
struct pw_resource *resource = object;
struct pw_client_node *node = resource->object;
@ -974,7 +974,7 @@ client_node_port_update (void *object,
static void
client_node_event (void *object,
SpaEvent *event)
struct spa_event *event)
{
struct pw_resource *resource = object;
struct pw_client_node *node = resource->object;
@ -1000,7 +1000,7 @@ static struct pw_client_node_methods client_node_methods = {
};
static void
proxy_on_data_fd_events (SpaSource *source)
proxy_on_data_fd_events (struct spa_source *source)
{
struct proxy *this = source->data;
struct impl *impl = this->impl;
@ -1011,21 +1011,21 @@ proxy_on_data_fd_events (SpaSource *source)
}
if (source->rmask & SPA_IO_IN) {
SpaEvent event;
struct spa_event event;
uint64_t cmd;
read (this->data_source.fd, &cmd, 8);
while (pw_transport_next_event (impl->transport, &event) == SPA_RESULT_OK) {
SpaEvent *ev = alloca (SPA_POD_SIZE (&event));
struct spa_event *ev = alloca (SPA_POD_SIZE (&event));
pw_transport_parse_event (impl->transport, ev);
handle_node_event (this, ev);
}
}
}
static const SpaNode proxy_node = {
sizeof (SpaNode),
static const struct spa_node proxy_node = {
sizeof (struct spa_node),
NULL,
spa_proxy_node_get_props,
spa_proxy_node_set_props,
@ -1050,11 +1050,11 @@ static const SpaNode proxy_node = {
spa_proxy_node_process_output,
};
static SpaResult
proxy_init (struct proxy *this,
SpaDict *info,
const SpaSupport *support,
uint32_t n_support)
static int
proxy_init (struct proxy *this,
struct spa_dict *info,
const struct spa_support *support,
uint32_t n_support)
{
uint32_t i;
@ -1126,7 +1126,7 @@ on_global_added (struct pw_listener *listener,
global->owner = impl->this.client;
}
static SpaResult
static int
proxy_clear (struct proxy *this)
{
uint32_t i;
@ -1287,7 +1287,7 @@ pw_client_node_destroy (struct pw_client_node * this)
*
* Returns: %SPA_RESULT_OK on success
*/
SpaResult
int
pw_client_node_get_fds (struct pw_client_node *this,
int *readfd,
int *writefd)

View file

@ -50,7 +50,7 @@ struct pw_client_node * pw_client_node_new (struct pw_client *cl
struct pw_properties *properties);
void pw_client_node_destroy (struct pw_client_node *node);
SpaResult pw_client_node_get_fds (struct pw_client_node *node,
int pw_client_node_get_fds (struct pw_client_node *node,
int *readfd,
int *writefd);

View file

@ -37,7 +37,7 @@ client_unbind_func (void *data)
spa_list_remove (&resource->link);
}
static SpaResult
static int
client_bind_func (struct pw_global *global,
struct pw_client *client,
uint32_t version,
@ -166,8 +166,8 @@ pw_client_destroy (struct pw_client * client)
}
void
pw_client_update_properties (struct pw_client *client,
const SpaDict *dict)
pw_client_update_properties (struct pw_client *client,
const struct spa_dict *dict)
{
struct pw_resource *resource;

View file

@ -40,7 +40,7 @@ extern "C" {
*/
struct pw_client {
struct pw_core *core;
SpaList link;
struct spa_list link;
struct pw_global *global;
struct pw_properties *properties;
@ -59,7 +59,7 @@ struct pw_client {
uint32_t n_types;
struct pw_map types;
SpaList resource_list;
struct spa_list resource_list;
PW_SIGNAL (resource_added, (struct pw_listener *listener,
struct pw_client *client,
struct pw_resource *resource));
@ -77,7 +77,7 @@ struct pw_client * pw_client_new (struct pw_core *core,
void pw_client_destroy (struct pw_client *client);
void pw_client_update_properties (struct pw_client *client,
const SpaDict *dict);
const struct spa_dict *dict);
#ifdef __cplusplus
}

View file

@ -28,7 +28,7 @@ extern "C" {
#include <pipewire/server/core.h>
struct pw_command {
SpaList link;
struct spa_list link;
const char *name;
};

View file

@ -34,7 +34,7 @@ struct global_impl {
struct impl {
struct pw_core this;
SpaSupport support[4];
struct spa_support support[4];
};
#define ACCESS_VIEW_GLOBAL(client,global) (client->core->access == NULL || \
@ -88,8 +88,8 @@ destroy_registry_resource (void *object)
}
static void
core_client_update (void *object,
const SpaDict *props)
core_client_update (void *object,
const struct spa_dict *props)
{
struct pw_resource *resource = object;
@ -148,7 +148,7 @@ static void
core_create_node (void *object,
const char *factory_name,
const char *name,
const SpaDict *props,
const struct spa_dict *props,
uint32_t new_id)
{
struct pw_resource *resource = object;
@ -201,7 +201,7 @@ async_create_client_node_complete (struct pw_access_data *data)
struct pw_resource *resource = d->data.resource;
struct pw_client *client = resource->client;
struct pw_client_node *node;
SpaResult res;
int res;
int readfd, writefd;
if (data->res != SPA_RESULT_OK)
@ -248,7 +248,7 @@ done:
static void
core_create_client_node (void *object,
const char *name,
const SpaDict *props,
const struct spa_dict *props,
uint32_t new_id)
{
struct pw_resource *resource = object;
@ -256,7 +256,7 @@ core_create_client_node (void *object,
int i;
struct pw_properties *properties;
struct access_create_client_node access_data;
SpaResult res;
int res;
properties = pw_properties_new (NULL, NULL);
if (properties == NULL)
@ -333,7 +333,7 @@ core_unbind_func (void *data)
spa_list_remove (&resource->link);
}
static SpaResult
static int
core_bind_func (struct pw_global *global,
struct pw_client *client,
uint32_t version,
@ -501,13 +501,13 @@ pw_core_add_global (struct pw_core *core,
return true;
}
SpaResult
int
pw_global_bind (struct pw_global *global,
struct pw_client *client,
uint32_t version,
uint32_t id)
{
SpaResult res;
int res;
struct global_impl *impl = SPA_CONTAINER_OF (global, struct global_impl, this);
if (impl->bind) {
@ -546,7 +546,7 @@ pw_global_destroy (struct pw_global *global)
void
pw_core_update_properties (struct pw_core *core,
const SpaDict *dict)
const struct spa_dict *dict)
{
struct pw_resource *resource;
@ -576,7 +576,7 @@ pw_core_find_port (struct pw_core *core,
uint32_t id,
struct pw_properties *props,
uint32_t n_format_filters,
SpaFormat **format_filters,
struct spa_format **format_filters,
char **error)
{
struct pw_port *best = NULL;
@ -634,18 +634,18 @@ pw_core_find_port (struct pw_core *core,
return best;
}
SpaFormat *
struct spa_format *
pw_core_find_format (struct pw_core *core,
struct pw_port *output,
struct pw_port *input,
struct pw_properties *props,
uint32_t n_format_filters,
SpaFormat **format_filterss,
struct spa_format **format_filterss,
char **error)
{
uint32_t out_state, in_state;
SpaResult res;
SpaFormat *filter = NULL, *format;
int res;
struct spa_format *filter = NULL, *format;
uint32_t iidx = 0, oidx = 0;
out_state = output->state;
@ -663,7 +663,7 @@ pw_core_find_format (struct pw_core *core,
if ((res = spa_node_port_get_format (output->node->node,
SPA_DIRECTION_OUTPUT,
output->port_id,
(const SpaFormat **)&format)) < 0) {
(const struct spa_format **)&format)) < 0) {
asprintf (error, "error get output format: %d", res);
goto error;
}
@ -672,7 +672,7 @@ pw_core_find_format (struct pw_core *core,
if ((res = spa_node_port_get_format (input->node->node,
SPA_DIRECTION_INPUT,
input->port_id,
(const SpaFormat **)&format)) < 0) {
(const struct spa_format **)&format)) < 0) {
asprintf (error, "error get input format: %d", res);
goto error;
}

View file

@ -36,7 +36,7 @@ struct pw_global;
#include <pipewire/server/link.h>
#include <pipewire/server/node-factory.h>
typedef SpaResult (*pw_bind_func_t) (struct pw_global *global,
typedef int (*pw_bind_func_t) (struct pw_global *global,
struct pw_client *client,
uint32_t version,
uint32_t id);
@ -45,7 +45,7 @@ struct pw_global {
struct pw_core *core;
struct pw_client *owner;
SpaList link;
struct spa_list link;
uint32_t id;
uint32_t type;
uint32_t version;
@ -72,18 +72,18 @@ struct pw_core {
struct pw_map objects;
SpaList resource_list;
SpaList registry_resource_list;
SpaList global_list;
SpaList client_list;
SpaList node_list;
SpaList node_factory_list;
SpaList link_list;
struct spa_list resource_list;
struct spa_list registry_resource_list;
struct spa_list global_list;
struct spa_list client_list;
struct spa_list node_list;
struct spa_list node_factory_list;
struct spa_list link_list;
struct pw_main_loop *main_loop;
struct pw_data_loop *data_loop;
SpaSupport *support;
struct spa_support *support;
uint32_t n_support;
PW_SIGNAL (destroy_signal, (struct pw_listener *listener,
@ -101,8 +101,8 @@ struct pw_core * pw_core_new (struct pw_main_loop *main_loop,
struct pw_properties *props);
void pw_core_destroy (struct pw_core *core);
void pw_core_update_properties (struct pw_core *core,
const SpaDict *dict);
void pw_core_update_properties (struct pw_core *core,
const struct spa_dict *dict);
bool pw_core_add_global (struct pw_core *core,
struct pw_client *owner,
@ -112,18 +112,18 @@ bool pw_core_add_global (struct pw_core *core,
pw_bind_func_t bind,
struct pw_global **global);
SpaResult pw_global_bind (struct pw_global *global,
int pw_global_bind (struct pw_global *global,
struct pw_client *client,
uint32_t version,
uint32_t id);
void pw_global_destroy (struct pw_global *global);
SpaFormat * pw_core_find_format (struct pw_core *core,
struct spa_format * pw_core_find_format (struct pw_core *core,
struct pw_port *output,
struct pw_port *input,
struct pw_properties *props,
uint32_t n_format_filters,
SpaFormat **format_filters,
struct spa_format **format_filters,
char **error);
struct pw_port * pw_core_find_port (struct pw_core *core,
@ -131,7 +131,7 @@ struct pw_port * pw_core_find_port (struct pw_core *core,
uint32_t id,
struct pw_properties *props,
uint32_t n_format_filters,
SpaFormat **format_filters,
struct spa_format **format_filters,
char **error);
struct pw_node_factory * pw_core_find_node_factory (struct pw_core *core,

View file

@ -36,7 +36,7 @@ struct impl
{
struct pw_data_loop this;
SpaSource *event;
struct spa_source *event;
bool running;
pthread_t thread;
@ -91,7 +91,7 @@ do_loop (void *user_data)
{
struct impl *impl = user_data;
struct pw_data_loop *this = &impl->this;
SpaResult res;
int res;
make_realtime (this);
@ -110,9 +110,9 @@ do_loop (void *user_data)
static void
do_stop (SpaLoopUtils *utils,
SpaSource *source,
void *data)
do_stop (struct spa_loop_utils *utils,
struct spa_source *source,
void *data)
{
struct impl *impl = data;
impl->running = false;
@ -169,7 +169,7 @@ pw_data_loop_destroy (struct pw_data_loop *loop)
free (impl);
}
SpaResult
int
pw_data_loop_start (struct pw_data_loop *loop)
{
struct impl *impl = SPA_CONTAINER_OF (loop, struct impl, this);
@ -187,7 +187,7 @@ pw_data_loop_start (struct pw_data_loop *loop)
return SPA_RESULT_OK;
}
SpaResult
int
pw_data_loop_stop (struct pw_data_loop *loop)
{
struct impl *impl = SPA_CONTAINER_OF (loop, struct impl, this);

View file

@ -41,8 +41,8 @@ struct pw_data_loop {
struct pw_data_loop * pw_data_loop_new (void);
void pw_data_loop_destroy (struct pw_data_loop *loop);
SpaResult pw_data_loop_start (struct pw_data_loop *loop);
SpaResult pw_data_loop_stop (struct pw_data_loop *loop);
int pw_data_loop_start (struct pw_data_loop *loop);
int pw_data_loop_stop (struct pw_data_loop *loop);
bool pw_data_loop_in_thread (struct pw_data_loop *loop);

View file

@ -40,7 +40,7 @@ struct impl {
struct pw_work_queue *work;
SpaFormat **format_filter;
struct spa_format **format_filter;
struct pw_properties *properties;
struct pw_listener input_port_destroy;
@ -50,7 +50,7 @@ struct impl {
void *buffer_owner;
struct pw_memblock buffer_mem;
SpaBuffer **buffers;
struct spa_buffer **buffers;
uint32_t n_buffers;
};
@ -79,7 +79,7 @@ pw_link_update_state (struct pw_link *link,
static void
complete_ready (void *obj,
void *data,
SpaResult res,
int res,
uint32_t id)
{
struct pw_port *port = data;
@ -94,7 +94,7 @@ complete_ready (void *obj,
static void
complete_paused (void *obj,
void *data,
SpaResult res,
int res,
uint32_t id)
{
struct pw_port *port = data;
@ -109,7 +109,7 @@ complete_paused (void *obj,
static void
complete_streaming (void *obj,
void *data,
SpaResult res,
int res,
uint32_t id)
{
struct pw_port *port = data;
@ -121,12 +121,12 @@ complete_streaming (void *obj,
pw_log_warn ("port %p: failed to go to STREAMING", port);
}
static SpaResult
static int
do_negotiate (struct pw_link *this, uint32_t in_state, uint32_t out_state)
{
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
SpaResult res = SPA_RESULT_ERROR, res2;
SpaFormat *format;
int res = SPA_RESULT_ERROR, res2;
struct spa_format *format;
char *error = NULL;
if (in_state != PW_PORT_STATE_CONFIGURE && out_state != PW_PORT_STATE_CONFIGURE)
@ -191,25 +191,25 @@ error:
}
}
static SpaParam *
find_param (SpaParam **params, int n_params, uint32_t type)
static struct spa_param *
find_param (struct spa_param **params, int n_params, uint32_t type)
{
uint32_t i;
for (i = 0; i < n_params; i++) {
if (spa_pod_is_object_type (&params[i]->pod, type))
if (spa_pod_is_object_type (&params[i]->object.pod, type))
return params[i];
}
return NULL;
}
static SpaParam *
find_meta_enable (struct pw_core *core, SpaParam **params, int n_params, uint32_t type)
static struct spa_param *
find_meta_enable (struct pw_core *core, struct spa_param **params, int n_params, uint32_t type)
{
uint32_t i;
for (i = 0; i < n_params; i++) {
if (spa_pod_is_object_type (&params[i]->pod, core->type.param_alloc_meta_enable.MetaEnable)) {
if (spa_pod_is_object_type (&params[i]->object.pod, core->type.param_alloc_meta_enable.MetaEnable)) {
uint32_t qtype;
if (spa_param_query (params[i],
@ -223,41 +223,41 @@ find_meta_enable (struct pw_core *core, SpaParam **params, int n_params, uint32_
return NULL;
}
static SpaBuffer **
static struct spa_buffer **
alloc_buffers (struct pw_link *this,
uint32_t n_buffers,
uint32_t n_params,
SpaParam **params,
struct spa_param **params,
uint32_t n_datas,
size_t *data_sizes,
ssize_t *data_strides,
struct pw_memblock *mem)
{
SpaBuffer **buffers, *bp;
struct spa_buffer **buffers, *bp;
uint32_t i;
size_t skel_size, data_size, meta_size;
SpaChunk *cdp;
struct spa_chunk *cdp;
void *ddp;
uint32_t n_metas;
SpaMeta *metas;
struct spa_meta *metas;
n_metas = data_size = meta_size = 0;
/* each buffer */
skel_size = sizeof (SpaBuffer);
skel_size = sizeof (struct spa_buffer);
metas = alloca (sizeof (SpaMeta) * n_params + 1);
metas = alloca (sizeof (struct spa_meta) * n_params + 1);
/* add shared metadata */
metas[n_metas].type = this->core->type.meta.Shared;
metas[n_metas].size = sizeof (SpaMetaShared);
metas[n_metas].size = sizeof (struct spa_meta_shared);
meta_size += metas[n_metas].size;
n_metas++;
skel_size += sizeof (SpaMeta);
skel_size += sizeof (struct spa_meta);
/* collect metadata */
for (i = 0; i < n_params; i++) {
if (spa_pod_is_object_type (&params[i]->pod, this->core->type.param_alloc_meta_enable.MetaEnable)) {
if (spa_pod_is_object_type (&params[i]->object.pod, this->core->type.param_alloc_meta_enable.MetaEnable)) {
uint32_t type, size;
if (spa_param_query (params[i],
@ -272,21 +272,21 @@ alloc_buffers (struct pw_link *this,
metas[n_metas].size = size;
meta_size += metas[n_metas].size;
n_metas++;
skel_size += sizeof (SpaMeta);
skel_size += sizeof (struct spa_meta);
}
}
data_size += meta_size;
/* data */
for (i = 0; i < n_datas; i++) {
data_size += sizeof (SpaChunk);
data_size += sizeof (struct spa_chunk);
data_size += data_sizes[i];
skel_size += sizeof (SpaData);
skel_size += sizeof (struct spa_data);
}
buffers = calloc (n_buffers, skel_size + sizeof (SpaBuffer *));
buffers = calloc (n_buffers, skel_size + sizeof (struct spa_buffer *));
/* pointer to buffer structures */
bp = SPA_MEMBER (buffers, n_buffers * sizeof (SpaBuffer *), SpaBuffer);
bp = SPA_MEMBER (buffers, n_buffers * sizeof (struct spa_buffer *), struct spa_buffer);
pw_memblock_alloc (PW_MEMBLOCK_FLAG_WITH_FD |
PW_MEMBLOCK_FLAG_MAP_READWRITE |
@ -296,25 +296,25 @@ alloc_buffers (struct pw_link *this,
for (i = 0; i < n_buffers; i++) {
int j;
SpaBuffer *b;
struct spa_buffer *b;
void *p;
buffers[i] = b = SPA_MEMBER (bp, skel_size * i, SpaBuffer);
buffers[i] = b = SPA_MEMBER (bp, skel_size * i, struct spa_buffer);
p = SPA_MEMBER (mem->ptr, data_size * i, void);
b->id = i;
b->n_metas = n_metas;
b->metas = SPA_MEMBER (b, sizeof (SpaBuffer), SpaMeta);
b->metas = SPA_MEMBER (b, sizeof (struct spa_buffer), struct spa_meta);
for (j = 0; j < n_metas; j++) {
SpaMeta *m = &b->metas[j];
struct spa_meta *m = &b->metas[j];
m->type = metas[j].type;
m->data = p;
m->size = metas[j].size;
if (m->type == this->core->type.meta.Shared) {
SpaMetaShared *msh = p;
struct spa_meta_shared *msh = p;
msh->flags = 0;
msh->fd = mem->fd;
@ -322,20 +322,20 @@ alloc_buffers (struct pw_link *this,
msh->size = data_size;
}
else if (m->type == this->core->type.meta.Ringbuffer) {
SpaMetaRingbuffer *rb = p;
struct spa_meta_ringbuffer *rb = p;
spa_ringbuffer_init (&rb->ringbuffer, data_sizes[0]);
}
p += m->size;
}
/* pointer to data structure */
b->n_datas = n_datas;
b->datas = SPA_MEMBER (b->metas, n_metas * sizeof (SpaMeta), SpaData);
b->datas = SPA_MEMBER (b->metas, n_metas * sizeof (struct spa_meta), struct spa_data);
cdp = p;
ddp = SPA_MEMBER (cdp, sizeof (SpaChunk) * n_datas, void);
ddp = SPA_MEMBER (cdp, sizeof (struct spa_chunk) * n_datas, void);
for (j = 0; j < n_datas; j++) {
SpaData *d = &b->datas[j];
struct spa_data *d = &b->datas[j];
d->chunk = &cdp[j];
if (data_sizes[j] > 0) {
@ -360,14 +360,14 @@ alloc_buffers (struct pw_link *this,
static int
spa_node_param_filter (struct pw_link *this,
SpaNode *in_node,
struct spa_node *in_node,
uint32_t in_port,
SpaNode *out_node,
struct spa_node *out_node,
uint32_t out_port,
SpaPODBuilder *result)
struct spa_pod_builder *result)
{
SpaResult res;
SpaParam *oparam, *iparam;
int res;
struct spa_param *oparam, *iparam;
int iidx, oidx, num = 0;
for (iidx = 0; ; iidx++) {
@ -378,7 +378,7 @@ spa_node_param_filter (struct pw_link *this,
spa_debug_param (iparam, this->core->type.map);
for (oidx = 0; ; oidx++) {
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t offset;
if (spa_node_port_enum_params (out_node, SPA_DIRECTION_OUTPUT, out_port, oidx, &oparam) < 0)
@ -387,16 +387,16 @@ spa_node_param_filter (struct pw_link *this,
if (pw_log_level_enabled (SPA_LOG_LEVEL_DEBUG))
spa_debug_param (oparam, this->core->type.map);
if (iparam->body.body.type != oparam->body.body.type)
if (iparam->object.body.type != oparam->object.body.type)
continue;
offset = result->offset;
spa_pod_builder_push_object (result, &f, 0, iparam->body.body.type);
spa_pod_builder_push_object (result, &f, 0, iparam->object.body.type);
if ((res = spa_props_filter (result,
SPA_POD_CONTENTS (SpaParam, iparam),
SPA_POD_CONTENTS_SIZE (SpaParam, iparam),
SPA_POD_CONTENTS (SpaParam, oparam),
SPA_POD_CONTENTS_SIZE (SpaParam, oparam))) < 0) {
SPA_POD_CONTENTS (struct spa_param, iparam),
SPA_POD_CONTENTS_SIZE (struct spa_param, iparam),
SPA_POD_CONTENTS (struct spa_param, oparam),
SPA_POD_CONTENTS_SIZE (struct spa_param, oparam))) < 0) {
result->offset = offset;
result->stack = NULL;
continue;
@ -408,12 +408,12 @@ spa_node_param_filter (struct pw_link *this,
return num;
}
static SpaResult
static int
do_allocation (struct pw_link *this, uint32_t in_state, uint32_t out_state)
{
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
SpaResult res;
const SpaPortInfo *iinfo, *oinfo;
int res;
const struct spa_port_info *iinfo, *oinfo;
uint32_t in_flags, out_flags;
char *error = NULL;
@ -487,9 +487,9 @@ do_allocation (struct pw_link *this, uint32_t in_state, uint32_t out_state)
}
if (impl->buffers == NULL) {
SpaParam **params, *param;
struct spa_param **params, *param;
uint8_t buffer[4096];
SpaPODBuilder b = SPA_POD_BUILDER_INIT (buffer, sizeof (buffer));
struct spa_pod_builder b = SPA_POD_BUILDER_INIT (buffer, sizeof (buffer));
int i, offset, n_params;
uint32_t max_buffers;
size_t minsize = 1024, stride = 0;
@ -501,9 +501,9 @@ do_allocation (struct pw_link *this, uint32_t in_state, uint32_t out_state)
this->output->port_id,
&b);
params = alloca (n_params * sizeof (SpaParam *));
params = alloca (n_params * sizeof (struct spa_param *));
for (i = 0, offset = 0; i < n_params; i++) {
params[i] = SPA_MEMBER (buffer, offset, SpaParam);
params[i] = SPA_MEMBER (buffer, offset, struct spa_param);
spa_param_fixate (params[i]);
spa_debug_param (params[i], this->core->type.map);
offset += SPA_ROUND_UP_N (SPA_POD_SIZE (params[i]), 8);
@ -666,10 +666,10 @@ error:
}
}
static SpaResult
static int
do_start (struct pw_link *this, uint32_t in_state, uint32_t out_state)
{
SpaResult res = SPA_RESULT_OK;
int res = SPA_RESULT_OK;
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
if (in_state < PW_PORT_STATE_PAUSED || out_state < PW_PORT_STATE_PAUSED)
@ -691,10 +691,10 @@ do_start (struct pw_link *this, uint32_t in_state, uint32_t out_state)
return res;
}
static SpaResult
static int
check_states (struct pw_link *this,
void *user_data,
SpaResult res)
int res)
{
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
uint32_t in_state, out_state;
@ -745,7 +745,7 @@ static void
on_input_async_complete_notify (struct pw_listener *listener,
struct pw_node *node,
uint32_t seq,
SpaResult res)
int res)
{
struct impl *impl = SPA_CONTAINER_OF (listener, struct impl, input_async_complete);
@ -757,7 +757,7 @@ static void
on_output_async_complete_notify (struct pw_listener *listener,
struct pw_node *node,
uint32_t seq,
SpaResult res)
int res)
{
struct impl *impl = SPA_CONTAINER_OF (listener, struct impl, output_async_complete);
@ -868,7 +868,7 @@ link_unbind_func (void *data)
pw_link_free (this);
}
static SpaResult
static int
link_bind_func (struct pw_global *global,
struct pw_client *client,
uint32_t version,
@ -917,7 +917,7 @@ struct pw_link *
pw_link_new (struct pw_core *core,
struct pw_port *output,
struct pw_port *input,
SpaFormat **format_filter,
struct spa_format **format_filter,
struct pw_properties *properties)
{
struct impl *impl;
@ -998,13 +998,13 @@ clear_port_buffers (struct pw_link *link, struct pw_port *port)
}
}
static SpaResult
do_link_remove_done (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
static int
do_link_remove_done (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
{
struct pw_link *this = user_data;
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
@ -1041,15 +1041,15 @@ do_link_remove_done (SpaLoop *loop,
return SPA_RESULT_OK;
}
static SpaResult
do_link_remove (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
static int
do_link_remove (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
{
SpaResult res;
int res;
struct pw_link *this = user_data;
if (this->rt.input) {

View file

@ -39,7 +39,7 @@ extern "C" {
*/
struct pw_link {
struct pw_core *core;
SpaList link;
struct spa_list link;
struct pw_global *global;
struct pw_properties *properties;
@ -56,22 +56,22 @@ struct pw_link {
PW_SIGNAL (free_signal, (struct pw_listener *,
struct pw_link *));
SpaList resource_list;
struct spa_list resource_list;
struct pw_port *output;
SpaList output_link;
struct pw_port *input;
SpaList input_link;
struct pw_port *output;
struct spa_list output_link;
struct pw_port *input;
struct spa_list input_link;
PW_SIGNAL (port_unlinked, (struct pw_listener *listener,
struct pw_link *link,
struct pw_port *port));
struct {
uint32_t in_ready;
struct pw_port *input;
struct pw_port *output;
SpaList input_link;
SpaList output_link;
uint32_t in_ready;
struct pw_port *input;
struct pw_port *output;
struct spa_list input_link;
struct spa_list output_link;
} rt;
};
@ -79,7 +79,7 @@ struct pw_link {
struct pw_link * pw_link_new (struct pw_core *core,
struct pw_port *output,
struct pw_port *input,
SpaFormat **format_filter,
struct spa_format **format_filter,
struct pw_properties *properties);
void pw_link_destroy (struct pw_link *link);

View file

@ -89,7 +89,7 @@ find_module (const char * path, const char *name)
return filename;
}
static SpaResult
static int
module_bind_func (struct pw_global *global,
struct pw_client *client,
uint32_t version,

View file

@ -29,7 +29,7 @@ extern "C" {
struct pw_module {
struct pw_core *core;
SpaList link;
struct spa_list link;
struct pw_global *global;
struct pw_module_info info;

View file

@ -37,7 +37,7 @@ extern "C" {
*/
struct pw_node_factory {
struct pw_core *core;
SpaList link;
struct spa_list link;
struct pw_global *global;
const char *name;

View file

@ -46,8 +46,8 @@ update_port_ids (struct pw_node *node)
uint32_t *input_port_ids, *output_port_ids;
uint32_t n_input_ports, n_output_ports, max_input_ports, max_output_ports;
uint32_t i;
SpaList *ports;
SpaResult res;
struct spa_list *ports;
int res;
if (node->node == NULL)
return;
@ -158,10 +158,10 @@ update_port_ids (struct pw_node *node)
pw_signal_emit (&node->initialized, node);
}
static SpaResult
static int
pause_node (struct pw_node *this)
{
SpaResult res;
int res;
if (this->state <= PW_NODE_STATE_IDLE)
return SPA_RESULT_OK;
@ -175,10 +175,10 @@ pause_node (struct pw_node *this)
return res;
}
static SpaResult
static int
start_node (struct pw_node *this)
{
SpaResult res;
int res;
pw_log_debug ("node %p: start node", this);
@ -189,10 +189,10 @@ start_node (struct pw_node *this)
return res;
}
static SpaResult
static int
suspend_node (struct pw_node *this)
{
SpaResult res = SPA_RESULT_OK;
int res = SPA_RESULT_OK;
struct pw_port *p;
pw_log_debug ("node %p: suspend node", this);
@ -224,8 +224,8 @@ suspend_node (struct pw_node *this)
static void
send_clock_update (struct pw_node *this)
{
SpaResult res;
SpaCommandNodeClockUpdate cu =
int res;
struct spa_command_node_clock_update cu =
SPA_COMMAND_NODE_CLOCK_UPDATE_INIT(
this->core->type.command_node.ClockUpdate,
SPA_COMMAND_NODE_CLOCK_UPDATE_TIME |
@ -249,22 +249,22 @@ send_clock_update (struct pw_node *this)
&cu.body.monotonic_time.value);
}
if ((res = spa_node_send_command (this->node, (SpaCommand *)&cu)) < 0)
if ((res = spa_node_send_command (this->node, (struct spa_command *)&cu)) < 0)
pw_log_debug ("got error %d", res);
}
static SpaResult
static int
do_pull (struct pw_node *this)
{
SpaResult res = SPA_RESULT_OK;
int res = SPA_RESULT_OK;
struct pw_port *inport;
bool have_output = false;
spa_list_for_each (inport, &this->input_ports, link) {
struct pw_link *link;
struct pw_port *outport;
SpaPortIO *pi;
SpaPortIO *po;
struct spa_port_io *pi;
struct spa_port_io *po;
pi = &inport->io;
pw_log_trace ("node %p: need input port %d, %d %d", this,
@ -311,13 +311,13 @@ do_pull (struct pw_node *this)
}
static void
on_node_event (SpaNode *node, SpaEvent *event, void *user_data)
on_node_event (struct spa_node *node, struct spa_event *event, void *user_data)
{
struct pw_node *this = user_data;
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
if (SPA_EVENT_TYPE (event) == this->core->type.event_node.AsyncComplete) {
SpaEventNodeAsyncComplete *ac = (SpaEventNodeAsyncComplete *) event;
struct spa_event_node_async_complete *ac = (struct spa_event_node_async_complete *) event;
pw_log_debug ("node %p: async complete event %d %d", this, ac->body.seq.value, ac->body.res.value);
pw_work_queue_complete (impl->work, this, ac->body.seq.value, ac->body.res.value);
@ -329,7 +329,7 @@ on_node_event (SpaNode *node, SpaEvent *event, void *user_data)
}
static void
on_node_need_input (SpaNode *node, void *user_data)
on_node_need_input (struct spa_node *node, void *user_data)
{
struct pw_node *this = user_data;
@ -337,15 +337,15 @@ on_node_need_input (SpaNode *node, void *user_data)
}
static void
on_node_have_output (SpaNode *node, void *user_data)
on_node_have_output (struct spa_node *node, void *user_data)
{
struct pw_node *this = user_data;
SpaResult res;
int res;
struct pw_port *outport;
spa_list_for_each (outport, &this->output_ports, link) {
struct pw_link *link;
SpaPortIO *po;
struct spa_port_io *po;
po = &outport->io;
if (po->buffer_id == SPA_ID_INVALID)
@ -374,7 +374,7 @@ on_node_have_output (SpaNode *node, void *user_data)
}
static void
on_node_reuse_buffer (SpaNode *node, uint32_t port_id, uint32_t buffer_id, void *user_data)
on_node_reuse_buffer (struct spa_node *node, uint32_t port_id, uint32_t buffer_id, void *user_data)
{
struct pw_node *this = user_data;
struct pw_port *inport;
@ -402,7 +402,7 @@ node_unbind_func (void *data)
spa_list_remove (&resource->link);
}
static SpaResult
static int
node_bind_func (struct pw_global *global,
struct pw_client *client,
uint32_t version,
@ -432,7 +432,7 @@ node_bind_func (struct pw_global *global,
info.n_inputs = this->n_input_ports;
info.input_formats = NULL;
for (info.n_input_formats = 0; ; info.n_input_formats++) {
SpaFormat *fmt;
struct spa_format *fmt;
if (spa_node_port_enum_formats (this->node,
SPA_DIRECTION_INPUT,
@ -442,14 +442,14 @@ node_bind_func (struct pw_global *global,
info.n_input_formats) < 0)
break;
info.input_formats = realloc (info.input_formats, sizeof (SpaFormat*) * (info.n_input_formats + 1));
info.input_formats = realloc (info.input_formats, sizeof (struct spa_format*) * (info.n_input_formats + 1));
info.input_formats[info.n_input_formats] = spa_format_copy (fmt);
}
info.max_outputs = this->max_output_ports;
info.n_outputs = this->n_output_ports;
info.output_formats = NULL;
for (info.n_output_formats = 0; ; info.n_output_formats++) {
SpaFormat *fmt;
struct spa_format *fmt;
if (spa_node_port_enum_formats (this->node,
SPA_DIRECTION_OUTPUT,
@ -459,7 +459,7 @@ node_bind_func (struct pw_global *global,
info.n_output_formats) < 0)
break;
info.output_formats = realloc (info.output_formats, sizeof (SpaFormat*) * (info.n_output_formats + 1));
info.output_formats = realloc (info.output_formats, sizeof (struct spa_format*) * (info.n_output_formats + 1));
info.output_formats[info.n_output_formats] = spa_format_copy (fmt);
}
info.state = this->state;
@ -520,7 +520,7 @@ pw_node_set_data_loop (struct pw_node *node,
pw_signal_emit (&node->loop_changed, node);
}
static const SpaNodeCallbacks node_callbacks = {
static const struct spa_node_callbacks node_callbacks = {
&on_node_event,
&on_node_need_input,
&on_node_have_output,
@ -532,8 +532,8 @@ pw_node_new (struct pw_core *core,
struct pw_client *owner,
const char *name,
bool async,
SpaNode *node,
SpaClock *clock,
struct spa_node *node,
struct spa_clock *clock,
struct pw_properties *properties)
{
struct impl *impl;
@ -611,13 +611,13 @@ no_mem:
return NULL;
}
static SpaResult
do_node_remove_done (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
static int
do_node_remove_done (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
{
struct pw_node *this = user_data;
struct impl *impl = SPA_CONTAINER_OF (this, struct impl, this);
@ -649,17 +649,17 @@ do_node_remove_done (SpaLoop *loop,
return SPA_RESULT_OK;
}
static SpaResult
do_node_remove (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
static int
do_node_remove (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
{
struct pw_node *this = user_data;
struct pw_port *port, *tmp;
SpaResult res;
int res;
pause_node (this);
@ -736,9 +736,9 @@ pw_node_get_free_port (struct pw_node *node,
enum pw_direction direction)
{
uint32_t *n_ports, max_ports;
SpaList *ports;
struct spa_list *ports;
struct pw_port *port = NULL, *p, **portmap;
SpaResult res;
int res;
int i;
if (direction == PW_DIRECTION_INPUT) {
@ -793,7 +793,7 @@ pw_node_get_free_port (struct pw_node *node,
static void
on_state_complete (struct pw_node *node,
void *data,
SpaResult res)
int res)
{
enum pw_node_state state = SPA_PTR_TO_INT (data);
char *error = NULL;
@ -829,13 +829,13 @@ node_activate (struct pw_node *this)
*
* Set the state of @node to @state.
*
* Returns: a #SpaResult
* Returns: a #int
*/
SpaResult
int
pw_node_set_state (struct pw_node *node,
enum pw_node_state state)
{
SpaResult res = SPA_RESULT_OK;
int res = SPA_RESULT_OK;
struct impl *impl = SPA_CONTAINER_OF (node, struct impl, this);
pw_signal_emit (&node->state_request, node, state);

View file

@ -46,7 +46,7 @@ extern "C" {
*/
struct pw_node {
struct pw_core *core;
SpaList link;
struct spa_list link;
struct pw_global *global;
struct pw_client *owner;
@ -62,25 +62,25 @@ struct pw_node {
enum pw_node_state old,
enum pw_node_state state));
SpaHandle *handle;
SpaNode *node;
struct spa_handle *handle;
struct spa_node *node;
bool live;
SpaClock *clock;
struct spa_clock *clock;
SpaList resource_list;
struct spa_list resource_list;
PW_SIGNAL (initialized, (struct pw_listener *listener,
struct pw_node *object));
uint32_t max_input_ports;
uint32_t n_input_ports;
SpaList input_ports;
struct spa_list input_ports;
struct pw_port **input_port_map;
uint32_t n_used_input_links;
uint32_t max_output_ports;
uint32_t n_output_ports;
SpaList output_ports;
struct spa_list output_ports;
struct pw_port **output_port_map;
uint32_t n_used_output_links;
@ -99,7 +99,7 @@ struct pw_node {
PW_SIGNAL (async_complete, (struct pw_listener *listener,
struct pw_node *node,
uint32_t seq,
SpaResult res));
int res));
struct pw_data_loop *data_loop;
PW_SIGNAL (loop_changed, (struct pw_listener *listener,
@ -110,8 +110,8 @@ struct pw_node * pw_node_new (struct pw_core *core,
struct pw_client *owner,
const char *name,
bool async,
SpaNode *node,
SpaClock *clock,
struct spa_node *node,
struct spa_clock *clock,
struct pw_properties *properties);
void pw_node_destroy (struct pw_node *node);
@ -122,7 +122,7 @@ void pw_node_set_data_loop (struct pw_node *node,
struct pw_port * pw_node_get_free_port (struct pw_node *node,
enum pw_direction direction);
SpaResult pw_node_set_state (struct pw_node *node,
int pw_node_set_state (struct pw_node *node,
enum pw_node_state state);
void pw_node_update_state (struct pw_node *node,
enum pw_node_state state,

View file

@ -71,8 +71,8 @@ pw_port_destroy (struct pw_port *port)
free (port);
}
static SpaResult
do_add_link (SpaLoop *loop,
static int
do_add_link (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
@ -130,7 +130,7 @@ pw_port_get_link (struct pw_port *output_port,
struct pw_link *
pw_port_link (struct pw_port *output_port,
struct pw_port *input_port,
SpaFormat **format_filter,
struct spa_format **format_filter,
struct pw_properties *properties,
char **error)
{
@ -199,10 +199,10 @@ no_mem:
return NULL;
}
SpaResult
int
pw_port_pause_rt (struct pw_port *port)
{
SpaResult res;
int res;
if (port->state <= PW_PORT_STATE_PAUSED)
return SPA_RESULT_OK;
@ -216,13 +216,13 @@ pw_port_pause_rt (struct pw_port *port)
return res;
}
static SpaResult
do_remove_link_done (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
static int
do_remove_link_done (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
{
struct pw_port *port = user_data;
struct pw_node *node = port->node;
@ -263,18 +263,18 @@ do_remove_link_done (SpaLoop *loop,
return SPA_RESULT_OK;
}
static SpaResult
do_remove_link (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
static int
do_remove_link (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
{
struct pw_port *port = user_data;
struct pw_node *this = port->node;
struct pw_link *link = ((struct pw_link**)data)[0];
SpaResult res;
int res;
if (port->direction == PW_DIRECTION_INPUT) {
pw_port_pause_rt (link->rt.input);
@ -295,10 +295,10 @@ do_remove_link (SpaLoop *loop,
return res;
}
SpaResult
int
pw_port_unlink (struct pw_port *port, struct pw_link *link)
{
SpaResult res;
int res;
struct impl *impl = SPA_CONTAINER_OF (port, struct impl, this);
pw_log_debug ("port %p: start unlink %p", port, link);
@ -312,16 +312,16 @@ pw_port_unlink (struct pw_port *port, struct pw_link *link)
return res;
}
static SpaResult
do_clear_buffers_done (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
static int
do_clear_buffers_done (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
{
struct pw_port *port = user_data;
SpaResult res;
int res;
if (port->state <= PW_PORT_STATE_READY)
return SPA_RESULT_OK;
@ -339,17 +339,17 @@ do_clear_buffers_done (SpaLoop *loop,
return res;
}
static SpaResult
do_clear_buffers (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
static int
do_clear_buffers (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
void *data,
void *user_data)
{
struct pw_port *port = user_data;
struct pw_node *node = port->node;
SpaResult res;
int res;
pw_port_pause_rt (port);
@ -361,10 +361,10 @@ do_clear_buffers (SpaLoop *loop,
return res;
}
SpaResult
int
pw_port_clear_buffers (struct pw_port *port)
{
SpaResult res;
int res;
struct impl *impl = SPA_CONTAINER_OF (port, struct impl, this);
pw_log_debug ("port %p: clear buffers", port);

View file

@ -45,7 +45,7 @@ enum pw_port_state {
};
struct pw_port {
SpaList link;
struct spa_list link;
PW_SIGNAL (destroy_signal, (struct pw_listener *listener, struct pw_port *));
@ -53,17 +53,17 @@ struct pw_port {
enum pw_direction direction;
uint32_t port_id;
enum pw_port_state state;
SpaPortIO io;
struct spa_port_io io;
bool allocated;
struct pw_memblock buffer_mem;
SpaBuffer **buffers;
struct spa_buffer **buffers;
uint32_t n_buffers;
SpaList links;
struct spa_list links;
struct {
SpaList links;
struct spa_list links;
} rt;
};
@ -75,14 +75,14 @@ void pw_port_destroy (struct pw_port *port
struct pw_link * pw_port_link (struct pw_port *output_port,
struct pw_port *input_port,
SpaFormat **format_filter,
struct spa_format **format_filter,
struct pw_properties *properties,
char **error);
SpaResult pw_port_unlink (struct pw_port *port,
int pw_port_unlink (struct pw_port *port,
struct pw_link *link);
SpaResult pw_port_pause_rt (struct pw_port *port);
SpaResult pw_port_clear_buffers (struct pw_port *port);
int pw_port_pause_rt (struct pw_port *port);
int pw_port_clear_buffers (struct pw_port *port);
#ifdef __cplusplus

View file

@ -27,12 +27,12 @@
typedef bool (*demarshal_func_t) (void *object, void *data, size_t size);
struct builder {
SpaPODBuilder b;
struct spa_pod_builder b;
struct pw_connection *connection;
};
static uint32_t
write_pod (SpaPODBuilder *b, uint32_t ref, const void *data, uint32_t size)
write_pod (struct spa_pod_builder *b, uint32_t ref, const void *data, uint32_t size)
{
if (ref == -1)
ref = b->offset;
@ -75,7 +75,7 @@ core_marshal_info (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t i, n_items;
core_update_map (resource->client);
@ -111,7 +111,7 @@ core_marshal_done (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -124,14 +124,14 @@ core_marshal_done (void *object,
static void
core_marshal_error (void *object,
uint32_t id,
SpaResult res,
int res,
const char *error, ...)
{
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
char buffer[128];
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
va_list ap;
core_update_map (resource->client);
@ -155,7 +155,7 @@ core_marshal_remove_id (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -174,7 +174,7 @@ core_marshal_update_types (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t i;
spa_pod_builder_add (&b.b,
@ -198,8 +198,8 @@ core_demarshal_client_update (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaDict props;
SpaPODIter it;
struct spa_dict props;
struct spa_pod_iter it;
uint32_t i;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -208,7 +208,7 @@ core_demarshal_client_update (void *object,
0))
return false;
props.items = alloca (props.n_items * sizeof (SpaDictItem));
props.items = alloca (props.n_items * sizeof (struct spa_dict_item));
for (i = 0; i < props.n_items; i++) {
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_STRING, &props.items[i].key,
@ -226,7 +226,7 @@ core_demarshal_sync (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t seq;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -245,7 +245,7 @@ core_demarshal_get_registry (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
struct spa_pod_iter it;
int32_t new_id;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -264,10 +264,10 @@ core_demarshal_create_node (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t new_id, i;
const char *factory_name, *name;
SpaDict props;
struct spa_dict props;
if (!spa_pod_iter_struct (&it, data, size) ||
!spa_pod_iter_get (&it,
@ -277,7 +277,7 @@ core_demarshal_create_node (void *object,
0))
return false;
props.items = alloca (props.n_items * sizeof (SpaDictItem));
props.items = alloca (props.n_items * sizeof (struct spa_dict_item));
for (i = 0; i < props.n_items; i++) {
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_STRING, &props.items[i].key,
@ -302,10 +302,10 @@ core_demarshal_create_client_node (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t new_id, i;
const char *name;
SpaDict props;
struct spa_dict props;
if (!spa_pod_iter_struct (&it, data, size) ||
!spa_pod_iter_get (&it,
@ -314,7 +314,7 @@ core_demarshal_create_client_node (void *object,
0))
return false;
props.items = alloca (props.n_items * sizeof (SpaDictItem));
props.items = alloca (props.n_items * sizeof (struct spa_dict_item));
for (i = 0; i < props.n_items; i++) {
if (!spa_pod_iter_get (&it,
SPA_POD_TYPE_STRING, &props.items[i].key,
@ -338,7 +338,7 @@ core_demarshal_update_types (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t first_id, n_types;
const char **types;
int i;
@ -367,7 +367,7 @@ registry_marshal_global (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -385,7 +385,7 @@ registry_marshal_global_remove (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -401,7 +401,7 @@ registry_demarshal_bind (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t id, new_id;
if (!spa_pod_iter_struct (&it, data, size) ||
@ -422,7 +422,7 @@ module_marshal_info (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t i, n_items;
core_update_map (resource->client);
@ -456,7 +456,7 @@ node_marshal_info (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t i, n_items;
core_update_map (resource->client);
@ -505,7 +505,7 @@ client_marshal_info (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t i, n_items;
core_update_map (resource->client);
@ -536,7 +536,7 @@ client_node_marshal_done (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -549,12 +549,12 @@ client_node_marshal_done (void *object,
static void
client_node_marshal_event (void *object,
const SpaEvent *event)
const struct spa_event *event)
{
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -567,13 +567,13 @@ client_node_marshal_event (void *object,
static void
client_node_marshal_add_port (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id)
{
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -588,13 +588,13 @@ client_node_marshal_add_port (void *object,
static void
client_node_marshal_remove_port (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id)
{
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -609,15 +609,15 @@ client_node_marshal_remove_port (void *object,
static void
client_node_marshal_set_format (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t flags,
const SpaFormat *format)
const struct spa_format *format)
{
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -641,7 +641,7 @@ client_node_marshal_set_property (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -655,7 +655,7 @@ client_node_marshal_set_property (void *object,
static void
client_node_marshal_add_mem (void *object,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t mem_id,
uint32_t type,
@ -667,7 +667,7 @@ client_node_marshal_add_mem (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -687,7 +687,7 @@ client_node_marshal_add_mem (void *object,
static void
client_node_marshal_use_buffers (void *object,
uint32_t seq,
SpaDirection direction,
enum spa_direction direction,
uint32_t port_id,
uint32_t n_buffers,
struct pw_client_node_buffer *buffers)
@ -695,7 +695,7 @@ client_node_marshal_use_buffers (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
uint32_t i, j;
core_update_map (resource->client);
@ -708,7 +708,7 @@ client_node_marshal_use_buffers (void *object,
SPA_POD_TYPE_INT, n_buffers, 0);
for (i = 0; i < n_buffers; i++) {
SpaBuffer *buf = buffers[i].buffer;
struct spa_buffer *buf = buffers[i].buffer;
spa_pod_builder_add (&b.b,
SPA_POD_TYPE_INT, buffers[i].mem_id,
@ -718,14 +718,14 @@ client_node_marshal_use_buffers (void *object,
SPA_POD_TYPE_INT, buf->n_metas, 0);
for (j = 0; j < buf->n_metas; j++) {
SpaMeta *m = &buf->metas[j];
struct spa_meta *m = &buf->metas[j];
spa_pod_builder_add (&b.b,
SPA_POD_TYPE_ID, m->type,
SPA_POD_TYPE_INT, m->size, 0);
}
spa_pod_builder_add (&b.b, SPA_POD_TYPE_INT, buf->n_datas, 0);
for (j = 0; j < buf->n_datas; j++) {
SpaData *d = &buf->datas[j];
struct spa_data *d = &buf->datas[j];
spa_pod_builder_add (&b.b,
SPA_POD_TYPE_ID, d->type,
SPA_POD_TYPE_INT, SPA_PTR_TO_UINT32 (d->data),
@ -742,12 +742,12 @@ client_node_marshal_use_buffers (void *object,
static void
client_node_marshal_node_command (void *object,
uint32_t seq,
const SpaCommand *command)
const struct spa_command *command)
{
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -761,12 +761,12 @@ client_node_marshal_node_command (void *object,
static void
client_node_marshal_port_command (void *object,
uint32_t port_id,
const SpaCommand *command)
const struct spa_command *command)
{
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -786,7 +786,7 @@ client_node_marshal_transport (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);
@ -804,9 +804,9 @@ client_node_demarshal_update (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t change_mask, max_input_ports, max_output_ports;
const SpaProps *props;
const struct spa_props *props;
if (!spa_pod_iter_struct (&it, data, size) ||
!pw_pod_remap_data (SPA_POD_TYPE_STRUCT, data, size, &resource->client->types) ||
@ -828,12 +828,12 @@ client_node_demarshal_port_update (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
struct spa_pod_iter it;
uint32_t i, direction, port_id, change_mask, n_possible_formats, n_params;
const SpaParam **params = NULL;
const SpaFormat **possible_formats = NULL, *format = NULL;
SpaPortInfo info, *infop = NULL;
SpaPOD *ipod;
const struct spa_param **params = NULL;
const struct spa_format **possible_formats = NULL, *format = NULL;
struct spa_port_info info, *infop = NULL;
struct spa_pod *ipod;
if (!spa_pod_iter_struct (&it, data, size) ||
!pw_pod_remap_data (SPA_POD_TYPE_STRUCT, data, size, &resource->client->types) ||
@ -845,7 +845,7 @@ client_node_demarshal_port_update (void *object,
0))
return false;
possible_formats = alloca (n_possible_formats * sizeof (SpaFormat*));
possible_formats = alloca (n_possible_formats * sizeof (struct spa_format*));
for (i = 0; i < n_possible_formats; i++)
if (!spa_pod_iter_get (&it, SPA_POD_TYPE_OBJECT, &possible_formats[i], 0))
return false;
@ -856,7 +856,7 @@ client_node_demarshal_port_update (void *object,
0))
return false;
params = alloca (n_params * sizeof (SpaParam*));
params = alloca (n_params * sizeof (struct spa_param*));
for (i = 0; i < n_params; i++)
if (!spa_pod_iter_get (&it, SPA_POD_TYPE_OBJECT, &params[i], 0))
return false;
@ -867,7 +867,7 @@ client_node_demarshal_port_update (void *object,
return false;
if (ipod) {
SpaPODIter it2;
struct spa_pod_iter it2;
infop = &info;
if (!spa_pod_iter_pod (&it2, ipod) ||
@ -897,8 +897,8 @@ client_node_demarshal_event (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
SpaEvent *event;
struct spa_pod_iter it;
struct spa_event *event;
if (!spa_pod_iter_struct (&it, data, size) ||
!pw_pod_remap_data (SPA_POD_TYPE_STRUCT, data, size, &resource->client->types) ||
@ -915,7 +915,7 @@ client_node_demarshal_destroy (void *object,
size_t size)
{
struct pw_resource *resource = object;
SpaPODIter it;
struct spa_pod_iter it;
if (!spa_pod_iter_struct (&it, data, size))
return false;
@ -931,7 +931,7 @@ link_marshal_info (void *object,
struct pw_resource *resource = object;
struct pw_connection *connection = resource->client->protocol_private;
struct builder b = { { NULL, 0, 0, NULL, write_pod }, connection };
SpaPODFrame f;
struct spa_pod_frame f;
core_update_map (resource->client);

View file

@ -36,7 +36,7 @@ typedef void (*pw_destroy_t) (void *object);
struct pw_resource {
struct pw_core *core;
SpaList link;
struct spa_list link;
struct pw_client *client;

View file

@ -27,28 +27,28 @@ struct work_item {
uint32_t id;
void *obj;
uint32_t seq;
SpaResult res;
int res;
pw_work_func_t func;
void *data;
SpaList link;
struct spa_list link;
};
struct impl {
struct pw_work_queue this;
SpaSource *wakeup;
struct spa_source *wakeup;
uint32_t counter;
SpaList work_list;
SpaList free_list;
int n_queued;
struct spa_list work_list;
struct spa_list free_list;
int n_queued;
};
static void
process_work_queue (SpaLoopUtils *utils,
SpaSource *source,
void *data)
process_work_queue (struct spa_loop_utils *utils,
struct spa_source *source,
void *data)
{
struct impl *impl = data;
struct pw_work_queue *this = &impl->this;
@ -135,7 +135,7 @@ pw_work_queue_destroy (struct pw_work_queue * queue)
uint32_t
pw_work_queue_add (struct pw_work_queue *queue,
void *obj,
SpaResult res,
int res,
pw_work_func_t func,
void *data)
{
@ -205,7 +205,7 @@ bool
pw_work_queue_complete (struct pw_work_queue *queue,
void *obj,
uint32_t seq,
SpaResult res)
int res)
{
struct work_item *item;
struct impl *impl = SPA_CONTAINER_OF (queue, struct impl, this);

View file

@ -28,7 +28,7 @@ extern "C" {
typedef void (*pw_work_func_t) (void *obj,
void *data,
SpaResult res,
int res,
uint32_t id);
/**
@ -48,7 +48,7 @@ void pw_work_queue_destroy (struct pw_work_queue *que
uint32_t pw_work_queue_add (struct pw_work_queue *queue,
void *obj,
SpaResult res,
int res,
pw_work_func_t func,
void *data);
void pw_work_queue_cancel (struct pw_work_queue *queue,
@ -57,7 +57,7 @@ void pw_work_queue_cancel (struct pw_work_queue *que
bool pw_work_queue_complete (struct pw_work_queue *queue,
void *obj,
uint32_t seq,
SpaResult res);
int res);
#ifdef __cplusplus
}

View file

@ -33,9 +33,9 @@ struct data {
};
static void
print_properties (SpaDict *props, char mark)
print_properties (struct spa_dict *props, char mark)
{
SpaDictItem *item;
struct spa_dict_item *item;
if (props == NULL)
return;
@ -55,7 +55,7 @@ struct dumpdata {
static void
dump_core_info (struct pw_context *c,
SpaResult res,
int res,
const struct pw_core_info *info,
void *user_data)
{
@ -78,7 +78,7 @@ dump_core_info (struct pw_context *c,
static void
dump_client_info (struct pw_context *c,
SpaResult res,
int res,
const struct pw_client_info *info,
void *user_data)
{
@ -96,7 +96,7 @@ dump_client_info (struct pw_context *c,
static void
dump_node_info (struct pw_context *c,
SpaResult res,
int res,
const struct pw_node_info *info,
void *user_data)
{
@ -135,7 +135,7 @@ dump_node_info (struct pw_context *c,
static void
dump_module_info (struct pw_context *c,
SpaResult res,
int res,
const struct pw_module_info *info,
void *user_data)
{
@ -159,7 +159,7 @@ dump_module_info (struct pw_context *c,
static void
dump_link_info (struct pw_context *c,
SpaResult res,
int res,
const struct pw_link_info *info,
void *user_data)
{