mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-22 06:59:59 -05:00
Move suspend on idle in module
Move suspend-on-idle code from the node to a module Add some more SpaLoop API
This commit is contained in:
parent
d250ed42e6
commit
3dcbf4b228
13 changed files with 363 additions and 110 deletions
|
|
@ -284,11 +284,17 @@ pinos_loop_set_hooks (PinosLoop *loop,
|
|||
}
|
||||
|
||||
void
|
||||
pinos_loop_set_thread (PinosLoop *loop,
|
||||
void *thread)
|
||||
pinos_loop_enter_thread (PinosLoop *loop)
|
||||
{
|
||||
PinosLoopImpl *impl = SPA_CONTAINER_OF (loop, PinosLoopImpl, this);
|
||||
impl->thread = *((pthread_t*)thread);
|
||||
impl->thread = pthread_self();
|
||||
}
|
||||
|
||||
void
|
||||
pinos_loop_leave_thread (PinosLoop *loop)
|
||||
{
|
||||
PinosLoopImpl *impl = SPA_CONTAINER_OF (loop, PinosLoopImpl, this);
|
||||
impl->thread = 0;
|
||||
}
|
||||
|
||||
SpaResult
|
||||
|
|
|
|||
|
|
@ -30,9 +30,6 @@ extern "C" {
|
|||
|
||||
typedef struct _PinosLoop PinosLoop;
|
||||
|
||||
typedef bool (*PinosCheckfunc) (PinosLoop *loop,
|
||||
void *data);
|
||||
|
||||
typedef void (*PinosLoopHook) (PinosLoop *loop,
|
||||
void *data);
|
||||
|
||||
|
|
@ -72,8 +69,8 @@ void pinos_loop_set_hooks (PinosLoop *loop,
|
|||
PinosLoopHook pre_func,
|
||||
PinosLoopHook post_func,
|
||||
void *data);
|
||||
void pinos_loop_set_thread (PinosLoop *loop,
|
||||
void *thread);
|
||||
void pinos_loop_enter_thread (PinosLoop *loop);
|
||||
void pinos_loop_leave_thread (PinosLoop *loop);
|
||||
|
||||
SpaResult pinos_loop_iterate (PinosLoop *loop,
|
||||
int timeout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue