diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index b06898434..5834d810e 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -21,9 +21,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -298,6 +300,7 @@ struct client { char *load_init; /* initialization string */ jack_uuid_t session_id; /* requested session_id */ + struct pw_loop *l; struct pw_data_loop *loop; struct pw_properties *props; @@ -1232,7 +1235,7 @@ static struct link *find_activation(struct spa_list *links, uint32_t node_id) static void client_remove_source(struct client *c) { if (c->socket_source) { - pw_loop_destroy_source(c->loop->loop, c->socket_source); + pw_loop_destroy_source(c->l, c->socket_source); c->socket_source = NULL; } } @@ -1860,7 +1863,7 @@ static int client_node_transport(void *data, c, readfd, writefd, c->node_id); close(writefd); - c->socket_source = pw_loop_add_io(c->loop->loop, + c->socket_source = pw_loop_add_io(c->l, readfd, SPA_IO_ERR | SPA_IO_HUP, true, on_rtsocket_condition, c); @@ -2020,7 +2023,7 @@ static int client_node_command(void *data, const struct spa_command *command) case SPA_NODE_COMMAND_Suspend: case SPA_NODE_COMMAND_Pause: if (c->started) { - pw_loop_update_io(c->loop->loop, + pw_loop_update_io(c->l, c->socket_source, SPA_IO_ERR | SPA_IO_HUP); c->started = false; @@ -2029,7 +2032,7 @@ static int client_node_command(void *data, const struct spa_command *command) case SPA_NODE_COMMAND_Start: if (!c->started) { - pw_loop_update_io(c->loop->loop, + pw_loop_update_io(c->l, c->socket_source, SPA_IO_IN | SPA_IO_ERR | SPA_IO_HUP); c->started = true; @@ -3638,6 +3641,7 @@ jack_client_t * jack_client_open (const char *client_name, &thread_utils_impl, client); client->loop = pw_context_get_data_loop(client->context.context); + client->l = pw_data_loop_get_loop(client->loop); pw_data_loop_stop(client->loop); pw_context_set_object(client->context.context, diff --git a/src/modules/module-client-node/client-node.c b/src/modules/module-client-node/client-node.c index 4125e4fac..929ddbbbc 100644 --- a/src/modules/module-client-node/client-node.c +++ b/src/modules/module-client-node/client-node.c @@ -86,6 +86,7 @@ struct impl { struct pw_impl_client_node this; struct pw_context *context; + struct pw_mempool *context_pool; struct spa_node node; @@ -98,6 +99,7 @@ struct impl { struct pw_resource *resource; struct pw_impl_client *client; + struct pw_mempool *client_pool; struct spa_source data_source; @@ -236,7 +238,7 @@ static void clear_data(struct impl *impl, struct spa_data *d) struct pw_memblock *m; id = SPA_PTR_TO_UINT32(d->data); - m = pw_mempool_find_id(impl->client->pool, id); + m = pw_mempool_find_id(impl->client_pool, id); if (m) { pw_log_debug("%p: mem %d", impl, m->id); pw_memblock_unref(m); @@ -354,11 +356,11 @@ static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size) if (impl->this.flags & 1) return 0; - old = pw_mempool_find_tag(impl->client->pool, tag, sizeof(tag)); + old = pw_mempool_find_tag(impl->client_pool, tag, sizeof(tag)); if (data) { - mm = pw_mempool_import_map(impl->client->pool, - impl->context->pool, data, size, tag); + mm = pw_mempool_import_map(impl->client_pool, + impl->context_pool, data, size, tag); if (mm == NULL) return -errno; @@ -657,11 +659,11 @@ static int do_port_set_io(struct impl *impl, if ((mix = find_mix(port, mix_id)) == NULL || !mix->valid) return -EINVAL; - old = pw_mempool_find_tag(impl->client->pool, tag, sizeof(tag)); + old = pw_mempool_find_tag(impl->client_pool, tag, sizeof(tag)); if (data) { - mm = pw_mempool_import_map(impl->client->pool, - impl->context->pool, data, size, tag); + mm = pw_mempool_import_map(impl->client_pool, + impl->context_pool, data, size, tag); if (mm == NULL) return -errno; @@ -761,7 +763,7 @@ do_port_use_buffers(struct impl *impl, else return -EINVAL; - if ((mem = pw_mempool_find_ptr(impl->context->pool, baseptr)) == NULL) + if ((mem = pw_mempool_find_ptr(impl->context_pool, baseptr)) == NULL) return -EINVAL; endptr = SPA_PTROFF(baseptr, buffers[i]->n_datas * sizeof(struct spa_chunk), void); @@ -771,7 +773,7 @@ do_port_use_buffers(struct impl *impl, for (j = 0; j < buffers[i]->n_datas; j++) { struct spa_data *d = &buffers[i]->datas[j]; if (d->type == SPA_DATA_MemPtr) { - if ((m = pw_mempool_find_ptr(impl->context->pool, d->data)) == NULL || + if ((m = pw_mempool_find_ptr(impl->context_pool, d->data)) == NULL || m != mem) return -EINVAL; endptr = SPA_MAX(endptr, SPA_PTROFF(d->data, d->maxsize, void)); @@ -780,7 +782,7 @@ do_port_use_buffers(struct impl *impl, if (endptr > SPA_PTROFF(baseptr, mem->size, void)) return -EINVAL; - m = pw_mempool_import_block(impl->client->pool, mem); + m = pw_mempool_import_block(impl->client_pool, mem); if (m == NULL) return -errno; @@ -818,7 +820,7 @@ do_port_use_buffers(struct impl *impl, flags |= PW_MEMBLOCK_FLAG_WRITABLE; spa_log_debug(impl->log, "mem %d type:%d fd:%d", j, d->type, (int)d->fd); - m = pw_mempool_import(impl->client->pool, + m = pw_mempool_import(impl->client_pool, flags, d->type, d->fd); if (m == NULL) return -errno; @@ -1201,7 +1203,7 @@ static void node_peer_added(void *data, struct pw_impl_node *peer) struct impl *impl = data; struct pw_memblock *m; - m = pw_mempool_import_block(impl->client->pool, peer->activation); + m = pw_mempool_import_block(impl->client_pool, peer->activation); if (m == NULL) { pw_log_warn("%p: can't ensure mem: %m", impl); return; @@ -1226,7 +1228,7 @@ static void node_peer_removed(void *data, struct pw_impl_node *peer) struct impl *impl = data; struct pw_memblock *m; - m = pw_mempool_find_fd(impl->client->pool, peer->activation->fd); + m = pw_mempool_find_fd(impl->client_pool, peer->activation->fd); if (m == NULL) { pw_log_warn("%p: unknown peer %p fd:%d", impl, peer, peer->source.fd); @@ -1256,7 +1258,7 @@ void pw_impl_client_node_registered(struct pw_impl_client_node *this, struct pw_ pw_log_debug("%p: %d", &impl->node, node_id); - impl->activation = pw_mempool_import_block(client->pool, node->activation); + impl->activation = pw_mempool_import_block(impl->client_pool, node->activation); if (impl->activation == NULL) { pw_log_debug("%p: can't import block: %m", &impl->node); return; @@ -1290,7 +1292,7 @@ static int add_area(struct impl *impl) size = sizeof(struct spa_io_buffers) * AREA_SIZE; - area = pw_mempool_alloc(impl->context->pool, + area = pw_mempool_alloc(impl->context_pool, PW_MEMBLOCK_FLAG_READWRITE | PW_MEMBLOCK_FLAG_MAP | PW_MEMBLOCK_FLAG_SEAL, @@ -1343,7 +1345,7 @@ static void node_free(void *data) spa_hook_remove(&impl->node_listener); - while ((mm = pw_mempool_find_tag(impl->client->pool, tag, sizeof(uint32_t))) != NULL) + while ((mm = pw_mempool_find_tag(impl->client_pool, tag, sizeof(uint32_t))) != NULL) pw_memmap_free(mm); if (impl->activation) @@ -1670,6 +1672,7 @@ struct pw_impl_client_node *pw_impl_client_node_new(struct pw_resource *resource this = &impl->this; impl->context = context; + impl->context_pool = pw_context_get_mempool(context); impl->data_source.fd = -1; pw_log_debug("%p: new", &impl->node); @@ -1677,6 +1680,7 @@ struct pw_impl_client_node *pw_impl_client_node_new(struct pw_resource *resource impl_init(impl, NULL, support, n_support); impl->resource = resource; impl->client = client; + impl->client_pool = pw_impl_client_get_mempool(client); this->flags = do_register ? 0 : 1; pw_map_init(&impl->ports[0], 64, 64); diff --git a/src/modules/module-client-node/v0/client-node.c b/src/modules/module-client-node/v0/client-node.c index e552950de..771e16684 100644 --- a/src/modules/module-client-node/v0/client-node.c +++ b/src/modules/module-client-node/v0/client-node.c @@ -15,13 +15,14 @@ #include #include #include +#include #include #include +#include #define PW_ENABLE_DEPRECATED #include "pipewire/pipewire.h" -#include "pipewire/private.h" #include "pipewire/context.h" #include "modules/spa/spa-node.h" @@ -130,6 +131,7 @@ struct impl { bool client_reuse; struct pw_context *context; + struct pw_mempool *context_pool; struct node node; @@ -335,7 +337,7 @@ static inline void do_flush(struct node *this) static int send_clock_update(struct node *this) { - struct pw_impl_client *client = this->resource->client; + struct pw_impl_client *client = pw_resource_get_client(this->resource); uint32_t type = pw_protocol_native0_name_to_v2(client, SPA_TYPE_INFO_NODE_COMMAND_BASE "ClockUpdate"); struct timespec ts; int64_t now; @@ -468,7 +470,7 @@ do_update_port(struct node *this, } for (i = 0; i < port->n_params; i++) { port->params[i] = params[i] ? - pw_protocol_native0_pod_from_v2(this->resource->client, params[i]) : NULL; + pw_protocol_native0_pod_from_v2(pw_resource_get_client(this->resource), params[i]) : NULL; if (port->params[i] && spa_pod_is_object_id(port->params[i], SPA_PARAM_Format)) port->have_format = true; @@ -661,7 +663,7 @@ impl_node_port_set_io(void *object, if (data) { - if ((mem = pw_mempool_find_ptr(impl->context->pool, data)) == NULL) + if ((mem = pw_mempool_find_ptr(impl->context_pool, data)) == NULL) return -EINVAL; mem_offset = SPA_PTRDIFF(data, mem->map->ptr); @@ -744,7 +746,7 @@ impl_node_port_use_buffers(void *object, else return -EINVAL; - if ((mem = pw_mempool_find_ptr(impl->context->pool, baseptr)) == NULL) + if ((mem = pw_mempool_find_ptr(impl->context_pool, baseptr)) == NULL) return -EINVAL; data_size = 0; @@ -910,8 +912,7 @@ static int impl_node_process(void *object) struct node *this = object; struct impl *impl = this->impl; struct pw_impl_node *n = impl->this.node; - - return impl_node_process_input(n->node); + return impl_node_process_input(pw_impl_node_get_implementation(n)); } static int handle_node_message(struct node *this, struct pw_client_node0_message *message) @@ -1363,9 +1364,10 @@ struct pw_impl_client_node0 *pw_impl_client_node0_new(struct pw_resource *resour } convert_properties(properties); - pw_properties_setf(properties, PW_KEY_CLIENT_ID, "%d", client->global->id); + pw_properties_setf(properties, PW_KEY_CLIENT_ID, "%d", pw_global_get_id(pw_impl_client_get_global(client))); impl->context = context; + impl->context_pool = pw_context_get_mempool(context); impl->fds[0] = impl->fds[1] = -1; pw_log_debug("client-node %p: new", impl); diff --git a/src/modules/module-client-node/v0/client-node.h b/src/modules/module-client-node/v0/client-node.h index 197d0ad17..5c274060b 100644 --- a/src/modules/module-client-node/v0/client-node.h +++ b/src/modules/module-client-node/v0/client-node.h @@ -43,6 +43,16 @@ struct spa_command_node0_clock_update { struct spa_command_node0_clock_update_body body; }; +enum spa_node0_event { + SPA_NODE0_EVENT_START = SPA_TYPE_VENDOR_PipeWire, + SPA_NODE0_EVENT_RequestClockUpdate, +}; + +enum spa_node0_command { + SPA_NODE0_COMMAND_START = SPA_TYPE_VENDOR_PipeWire, + SPA_NODE0_COMMAND_ClockUpdate, +}; + #define SPA_COMMAND_NODE0_CLOCK_UPDATE_INIT(type,change_mask,rate,ticks,monotonic_time,offset,scale,state,flags,latency) \ SPA_COMMAND_INIT_FULL(struct spa_command_node0_clock_update, \ sizeof(struct spa_command_node0_clock_update_body), 0, type, \ diff --git a/src/modules/module-client-node/v0/transport.c b/src/modules/module-client-node/v0/transport.c index 242932516..c8d61c112 100644 --- a/src/modules/module-client-node/v0/transport.c +++ b/src/modules/module-client-node/v0/transport.c @@ -10,7 +10,6 @@ #include #include -#include #include "ext-client-node.h" @@ -190,7 +189,7 @@ pw_client_node0_transport_new(struct pw_context *context, trans = &impl->trans; impl->offset = 0; - impl->mem = pw_mempool_alloc(context->pool, + impl->mem = pw_mempool_alloc(pw_context_get_mempool(context), PW_MEMBLOCK_FLAG_READWRITE | PW_MEMBLOCK_FLAG_MAP | PW_MEMBLOCK_FLAG_SEAL, diff --git a/src/modules/module-ffado-driver.c b/src/modules/module-ffado-driver.c index 228cdbcc7..56f2577c6 100644 --- a/src/modules/module-ffado-driver.c +++ b/src/modules/module-ffado-driver.c @@ -27,7 +27,6 @@ #include #include -#include #include #include diff --git a/src/modules/module-jack-tunnel.c b/src/modules/module-jack-tunnel.c index 51c616b35..51a331330 100644 --- a/src/modules/module-jack-tunnel.c +++ b/src/modules/module-jack-tunnel.c @@ -27,7 +27,6 @@ #include #include -#include #include "module-jack-tunnel/weakjack.h" diff --git a/src/modules/module-netjack2-driver.c b/src/modules/module-netjack2-driver.c index 8ffcff676..3547c9967 100644 --- a/src/modules/module-netjack2-driver.c +++ b/src/modules/module-netjack2-driver.c @@ -31,7 +31,6 @@ #include #include -#include #include "module-netjack2/packets.h" #include "module-netjack2/peer.c" @@ -186,7 +185,7 @@ struct stream { struct impl { struct pw_context *context; struct pw_loop *main_loop; - struct pw_data_loop *data_loop; + struct pw_loop *data_loop; struct spa_system *system; #define MODE_SINK (1<<0) @@ -617,7 +616,7 @@ on_data_io(void *data, int fd, uint32_t mask) if (mask & (SPA_IO_ERR | SPA_IO_HUP)) { pw_log_warn("error:%08x", mask); - pw_loop_update_io(impl->data_loop->loop, impl->socket, 0); + pw_loop_update_io(impl->data_loop, impl->socket, 0); return; } if (mask & SPA_IO_IN) { @@ -889,7 +888,7 @@ static int handle_follower_setup(struct impl *impl, struct nj2_session_params *p send(impl->socket->fd, params, sizeof(*params), 0); impl->done = true; - pw_loop_update_io(impl->data_loop->loop, impl->socket, SPA_IO_IN); + pw_loop_update_io(impl->data_loop, impl->socket, SPA_IO_IN); return 0; connect_error: @@ -1013,7 +1012,7 @@ static int create_netjack2_socket(struct impl *impl) goto out; } - impl->socket = pw_loop_add_io(impl->data_loop->loop, fd, + impl->socket = pw_loop_add_io(impl->data_loop, fd, 0, false, on_data_io, impl); if (impl->socket == NULL) { res = -errno; @@ -1035,7 +1034,7 @@ static int send_stop_driver(struct impl *impl) impl->started = false; if (impl->socket) - pw_loop_update_io(impl->data_loop->loop, impl->socket, 0); + pw_loop_update_io(impl->data_loop, impl->socket, 0); pw_log_info("sending STOP_DRIVER"); nj2_session_params_hton(¶ms, &impl->peer.params); @@ -1057,7 +1056,7 @@ static int destroy_netjack2_socket(struct impl *impl) update_timer(impl, 0); if (impl->socket) { - pw_loop_destroy_source(impl->data_loop->loop, impl->socket); + pw_loop_destroy_source(impl->data_loop, impl->socket); impl->socket = NULL; } if (impl->setup_socket) { @@ -1214,6 +1213,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) { struct pw_context *context = pw_impl_module_get_context(module); struct pw_properties *props = NULL; + struct pw_data_loop *data_loop; struct impl *impl; const char *str; int res; @@ -1236,7 +1236,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) goto error; } impl->props = props; - impl->data_loop = pw_context_get_data_loop(context); + data_loop = pw_context_get_data_loop(context); + impl->data_loop = pw_data_loop_get_loop(data_loop); impl->sink.props = pw_properties_new(NULL, NULL); impl->source.props = pw_properties_new(NULL, NULL); diff --git a/src/modules/module-netjack2-manager.c b/src/modules/module-netjack2-manager.c index 13516349c..97b693e2d 100644 --- a/src/modules/module-netjack2-manager.c +++ b/src/modules/module-netjack2-manager.c @@ -32,7 +32,6 @@ #include #include -#include #include "module-netjack2/packets.h" @@ -224,7 +223,7 @@ struct follower { struct impl { struct pw_context *context; struct pw_loop *main_loop; - struct pw_data_loop *data_loop; + struct pw_loop *data_loop; struct spa_system *system; #define MODE_SINK (1<<0) @@ -340,7 +339,7 @@ static void sink_process(void *d, struct spa_io_position *position) netjack2_send_data(&follower->peer, nframes, midi, n_midi, audio, n_audio); if (follower->socket) - pw_loop_update_io(s->impl->data_loop->loop, follower->socket, SPA_IO_IN); + pw_loop_update_io(s->impl->data_loop, follower->socket, SPA_IO_IN); } static void source_process(void *d, struct spa_io_position *position) @@ -373,7 +372,7 @@ static void follower_free(struct follower *follower) pw_properties_free(follower->sink.props); if (follower->socket) - pw_loop_destroy_source(impl->data_loop->loop, follower->socket); + pw_loop_destroy_source(impl->data_loop, follower->socket); if (follower->setup_socket) pw_loop_destroy_source(impl->main_loop, follower->setup_socket); @@ -460,13 +459,13 @@ on_data_io(void *data, int fd, uint32_t mask) if (mask & (SPA_IO_ERR | SPA_IO_HUP)) { pw_log_warn("error:%08x", mask); - pw_loop_destroy_source(impl->data_loop->loop, follower->socket); + pw_loop_destroy_source(impl->data_loop, follower->socket); follower->socket = NULL; pw_loop_invoke(impl->main_loop, do_stop_follower, 1, NULL, 0, false, follower); return; } if (mask & SPA_IO_IN) { - pw_loop_update_io(impl->data_loop->loop, follower->socket, 0); + pw_loop_update_io(impl->data_loop, follower->socket, 0); pw_filter_trigger_process(follower->source.filter); } @@ -1000,7 +999,7 @@ static int handle_follower_available(struct impl *impl, struct nj2_session_param goto socket_failed; } - follower->socket = pw_loop_add_io(impl->data_loop->loop, fd, + follower->socket = pw_loop_add_io(impl->data_loop, fd, 0, false, on_data_io, follower); if (follower->socket == NULL) { res = -errno; @@ -1254,6 +1253,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) { struct pw_context *context = pw_impl_module_get_context(module); struct pw_properties *props = NULL; + struct pw_data_loop *data_loop; struct impl *impl; const char *str; int res; @@ -1277,7 +1277,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) goto error; } impl->props = props; - impl->data_loop = pw_context_get_data_loop(context); + data_loop = pw_context_get_data_loop(context); + impl->data_loop = pw_data_loop_get_loop(data_loop); impl->sink_props = pw_properties_new(NULL, NULL); impl->source_props = pw_properties_new(NULL, NULL); diff --git a/src/modules/module-profiler.c b/src/modules/module-profiler.c index 6aa0ee69c..97a1c37c0 100644 --- a/src/modules/module-profiler.c +++ b/src/modules/module-profiler.c @@ -12,6 +12,7 @@ #include "config.h" +#include #include #include #include @@ -74,6 +75,7 @@ struct impl { struct pw_context *context; struct pw_properties *properties; + struct pw_loop *main_loop; struct pw_loop *data_loop; struct spa_hook context_listener; @@ -111,7 +113,7 @@ static void start_flush(struct impl *impl) value.tv_nsec = 1; interval.tv_sec = DEFAULT_INTERVAL; interval.tv_nsec = 0; - pw_loop_update_timer(impl->context->main_loop, + pw_loop_update_timer(impl->main_loop, impl->flush_timeout, &value, &interval, false); impl->flushing = true; } @@ -127,7 +129,7 @@ static void stop_flush(struct impl *impl) value.tv_nsec = 0; interval.tv_sec = 0; interval.tv_nsec = 0; - pw_loop_update_timer(impl->context->main_loop, + pw_loop_update_timer(impl->main_loop, impl->flush_timeout, &value, &interval, false); impl->flushing = false; } @@ -348,7 +350,7 @@ static void module_destroy(void *data) pw_properties_free(impl->properties); - pw_loop_destroy_source(pw_context_get_main_loop(impl->context), impl->flush_timeout); + pw_loop_destroy_source(impl->main_loop, impl->flush_timeout); free(impl); } @@ -380,7 +382,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) struct pw_context *context = pw_impl_module_get_context(module); struct pw_properties *props; struct impl *impl; - struct pw_loop *main_loop = pw_context_get_main_loop(context); static const char * const keys[] = { PW_KEY_OBJECT_SERIAL, NULL @@ -403,7 +404,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) impl->context = context; impl->properties = props; - impl->data_loop = pw_context_get_data_loop(impl->context)->loop; + impl->main_loop = pw_context_get_main_loop(impl->context); + impl->data_loop = pw_data_loop_get_loop(pw_context_get_data_loop(impl->context)); spa_ringbuffer_init(&impl->buffer); @@ -416,11 +418,11 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) free(impl); return -errno; } - pw_properties_setf(impl->properties, PW_KEY_OBJECT_ID, "%d", impl->global->id); + pw_properties_setf(impl->properties, PW_KEY_OBJECT_ID, "%d", pw_global_get_id(impl->global)); pw_properties_setf(impl->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64, pw_global_get_serial(impl->global)); - impl->flush_timeout = pw_loop_add_timer(main_loop, flush_timeout, impl); + impl->flush_timeout = pw_loop_add_timer(impl->main_loop, flush_timeout, impl); pw_global_update_keys(impl->global, &impl->properties->dict, keys); diff --git a/src/modules/module-protocol-native/v0/typemap.h b/src/modules/module-protocol-native/v0/typemap.h index 1d80ea281..980cc41cc 100644 --- a/src/modules/module-protocol-native/v0/typemap.h +++ b/src/modules/module-protocol-native/v0/typemap.h @@ -1,3 +1,13 @@ +enum spa_node0_event { + SPA_NODE0_EVENT_START = SPA_TYPE_VENDOR_PipeWire, + SPA_NODE0_EVENT_RequestClockUpdate, +}; + +enum spa_node0_command { + SPA_NODE0_COMMAND_START = SPA_TYPE_VENDOR_PipeWire, + SPA_NODE0_COMMAND_ClockUpdate, +}; + static const struct type_info { const char *type; const char *name; diff --git a/src/modules/module-pulse-tunnel.c b/src/modules/module-pulse-tunnel.c index 38fefc9e4..f097653af 100644 --- a/src/modules/module-pulse-tunnel.c +++ b/src/modules/module-pulse-tunnel.c @@ -30,7 +30,6 @@ #include #include -#include #include #include "module-protocol-pulse/defs.h" diff --git a/src/pipewire/context.c b/src/pipewire/context.c index 6495088c8..e4aff6ea2 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -559,6 +559,12 @@ struct pw_work_queue *pw_context_get_work_queue(struct pw_context *context) return context->work_queue; } +SPA_EXPORT +struct pw_mempool *pw_context_get_mempool(struct pw_context *context) +{ + return context->pool; +} + SPA_EXPORT const struct pw_properties *pw_context_get_properties(struct pw_context *context) { diff --git a/src/pipewire/context.h b/src/pipewire/context.h index e57afa2b8..3971d78b4 100644 --- a/src/pipewire/context.h +++ b/src/pipewire/context.h @@ -122,6 +122,9 @@ struct pw_data_loop *pw_context_get_data_loop(struct pw_context *context); /** Get the work queue from the context: Since 0.3.26 */ struct pw_work_queue *pw_context_get_work_queue(struct pw_context *context); +/** Get the memmory pool from the context: Since 0.3.74 */ +struct pw_mempool *pw_context_get_mempool(struct pw_context *context); + /** Iterate the globals of the context. The callback should return * 0 to fetch the next item, any other value stops the iteration and returns * the value. When all callbacks return 0, this function returns 0 when all diff --git a/src/pipewire/impl-client.c b/src/pipewire/impl-client.c index f16558c05..556567dac 100644 --- a/src/pipewire/impl-client.c +++ b/src/pipewire/impl-client.c @@ -571,6 +571,12 @@ struct pw_global *pw_impl_client_get_global(struct pw_impl_client *client) return client->global; } +SPA_EXPORT +struct pw_mempool *pw_impl_client_get_mempool(struct pw_impl_client *client) +{ + return client->pool; +} + SPA_EXPORT const struct pw_properties *pw_impl_client_get_properties(struct pw_impl_client *client) { diff --git a/src/pipewire/impl-client.h b/src/pipewire/impl-client.h index 746a4fbf6..f9278f5f8 100644 --- a/src/pipewire/impl-client.h +++ b/src/pipewire/impl-client.h @@ -143,6 +143,9 @@ struct pw_resource *pw_impl_client_find_resource(struct pw_impl_client *client, /** Get the global associated with this client */ struct pw_global *pw_impl_client_get_global(struct pw_impl_client *client); +/** Get the mempool associated with this client, Since 0.3.74 */ +struct pw_mempool *pw_impl_client_get_mempool(struct pw_impl_client *client); + /** listen to events from this client */ void pw_impl_client_add_listener(struct pw_impl_client *client, struct spa_hook *listener, diff --git a/src/pipewire/private.h b/src/pipewire/private.h index eff5cd614..0f62ee44e 100644 --- a/src/pipewire/private.h +++ b/src/pipewire/private.h @@ -181,16 +181,6 @@ typedef uint32_t (*pw_permission_func_t) (struct pw_global *global, #define pw_impl_client_emit_resource_removed(o,r) pw_impl_client_emit(o, resource_removed, 0, r) #define pw_impl_client_emit_busy_changed(o,b) pw_impl_client_emit(o, busy_changed, 0, b) -enum spa_node0_event { - SPA_NODE0_EVENT_START = SPA_TYPE_VENDOR_PipeWire, - SPA_NODE0_EVENT_RequestClockUpdate, -}; - -enum spa_node0_command { - SPA_NODE0_COMMAND_START = SPA_TYPE_VENDOR_PipeWire, - SPA_NODE0_COMMAND_ClockUpdate, -}; - #define pw_impl_core_emit(s,m,v,...) spa_hook_list_call(&s->listener_list, struct pw_impl_core_events, m, v, ##__VA_ARGS__) #define pw_impl_core_emit_destroy(s) pw_impl_core_emit(s, destroy, 0)