mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
media-session: rework device reservation
Monitor the device reservation objects and mark the device available. Don't select nodes from devices that are not available. Acquire the device reservation when a device starts. Release the device reservation when we suspend the device again.
This commit is contained in:
parent
11086f23ea
commit
d3634aca7e
6 changed files with 188 additions and 59 deletions
|
|
@ -92,6 +92,8 @@ static void idle_timeout(void *data, uint64_t expirations)
|
|||
remove_idle_timeout(node);
|
||||
|
||||
pw_node_send_command((struct pw_node*)node->obj->obj.proxy, cmd);
|
||||
|
||||
sm_object_release(&node->obj->obj);
|
||||
}
|
||||
|
||||
static void add_idle_timeout(struct node *node)
|
||||
|
|
@ -118,6 +120,7 @@ static int on_node_idle(struct impl *impl, struct node *node)
|
|||
static int on_node_running(struct impl *impl, struct node *node)
|
||||
{
|
||||
pw_log_debug(NAME" %p: node %d running", impl, node->id);
|
||||
sm_object_acquire(&node->obj->obj);
|
||||
remove_idle_timeout(node);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue