mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-25 06:59:57 -05:00
Use refcounting for async shutdown
fix some memory leaks
This commit is contained in:
parent
ee0aa6a2ac
commit
6d4db64767
21 changed files with 216 additions and 260 deletions
|
|
@ -42,8 +42,6 @@ pinos_node_state_as_string (PinosNodeState state)
|
|||
return "creating";
|
||||
case PINOS_NODE_STATE_SUSPENDED:
|
||||
return "suspended";
|
||||
case PINOS_NODE_STATE_INITIALIZING:
|
||||
return "initializing";
|
||||
case PINOS_NODE_STATE_IDLE:
|
||||
return "idle";
|
||||
case PINOS_NODE_STATE_RUNNING:
|
||||
|
|
|
|||
|
|
@ -57,9 +57,8 @@ enum _PinosNodeState {
|
|||
PINOS_NODE_STATE_ERROR = -1,
|
||||
PINOS_NODE_STATE_CREATING = 0,
|
||||
PINOS_NODE_STATE_SUSPENDED = 1,
|
||||
PINOS_NODE_STATE_INITIALIZING = 2,
|
||||
PINOS_NODE_STATE_IDLE = 3,
|
||||
PINOS_NODE_STATE_RUNNING = 4,
|
||||
PINOS_NODE_STATE_IDLE = 2,
|
||||
PINOS_NODE_STATE_RUNNING = 3,
|
||||
};
|
||||
|
||||
const char * pinos_node_state_as_string (PinosNodeState state);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,11 @@ id_map_get_uri (SpaIDMap *map, uint32_t id)
|
|||
IDMap *this = SPA_CONTAINER_OF (map, IDMap, map);
|
||||
if (id == SPA_ID_INVALID)
|
||||
return NULL;
|
||||
return pinos_map_lookup (&this->uris, id);
|
||||
|
||||
if (SPA_LIKELY (pinos_map_check_id (&this->uris, id)))
|
||||
return pinos_map_lookup_unchecked (&this->uris, id);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static IDMap default_id_map = {
|
||||
|
|
|
|||
|
|
@ -844,8 +844,6 @@ pinos_stream_connect (PinosStream *stream,
|
|||
{
|
||||
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
|
||||
PinosMessageCreateClientNode ccn;
|
||||
SpaDict dict;
|
||||
SpaDictItem items[1];
|
||||
|
||||
impl->direction = direction == PINOS_DIRECTION_INPUT ? SPA_DIRECTION_INPUT : SPA_DIRECTION_OUTPUT;
|
||||
impl->port_id = 0;
|
||||
|
|
@ -866,7 +864,7 @@ pinos_stream_connect (PinosStream *stream,
|
|||
|
||||
impl->node_proxy = pinos_proxy_new (stream->context,
|
||||
SPA_ID_INVALID,
|
||||
0);
|
||||
stream->context->uri.client_node);
|
||||
|
||||
pinos_proxy_set_dispatch (impl->node_proxy,
|
||||
stream_dispatch_func,
|
||||
|
|
@ -874,11 +872,7 @@ pinos_stream_connect (PinosStream *stream,
|
|||
|
||||
ccn.seq = ++impl->seq;
|
||||
ccn.name = "client-node";
|
||||
dict.n_items = 1;
|
||||
dict.items = items;
|
||||
items[0].key = "pinos.target.node";
|
||||
items[0].value = port_path;
|
||||
ccn.props = &dict;
|
||||
ccn.props = &stream->properties->dict;
|
||||
ccn.new_id = impl->node_proxy->id;
|
||||
|
||||
pinos_proxy_send_message (stream->context->core_proxy,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue