mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-01-03 11:09:08 -05:00
rt-poll: make small poll helper object
Remove the event loop code into a separate object so that we can share the same loop for multiple nodes. Some cleanups
This commit is contained in:
parent
b9409e297b
commit
7b53fa8685
11 changed files with 517 additions and 239 deletions
|
|
@ -43,8 +43,6 @@ typedef struct {
|
|||
* @user_data: user data
|
||||
* @fds: array of file descriptors
|
||||
* @n_fds: number of elements in @fds
|
||||
* @now: the current time
|
||||
* @timeout: the next desired wakeup time relative to @now
|
||||
*
|
||||
* Data passed to #SpaPollNotify.
|
||||
*/
|
||||
|
|
@ -52,8 +50,6 @@ typedef struct {
|
|||
void *user_data;
|
||||
SpaPollFd *fds;
|
||||
unsigned int n_fds;
|
||||
uint64_t now;
|
||||
uint64_t timeout;
|
||||
} SpaPollNotifyData;
|
||||
|
||||
typedef int (*SpaPollNotify) (SpaPollNotifyData *data);
|
||||
|
|
@ -67,7 +63,7 @@ typedef int (*SpaPollNotify) (SpaPollNotifyData *data);
|
|||
* @idle_cb: callback called when there is no other work
|
||||
* @before_cb: callback called before starting the poll
|
||||
* @after_cb: callback called after the poll loop
|
||||
* @user_data: user data pass to callbacks
|
||||
* @user_data: user data passed to callbacks
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
|
|
|
|||
|
|
@ -196,8 +196,6 @@ spa_alsa_sink_node_set_event_callback (SpaNode *node,
|
|||
this->event_cb = event;
|
||||
this->user_data = user_data;
|
||||
|
||||
update_state (this, SPA_NODE_STATE_CONFIGURE);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
|
|
@ -656,6 +654,8 @@ alsa_sink_init (const SpaHandleFactory *factory,
|
|||
|
||||
this->status.flags = SPA_PORT_STATUS_FLAG_NEED_INPUT;
|
||||
|
||||
update_state (this, SPA_NODE_STATE_CONFIGURE);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -200,8 +200,6 @@ spa_alsa_source_node_set_event_callback (SpaNode *node,
|
|||
this->event_cb = event;
|
||||
this->user_data = user_data;
|
||||
|
||||
update_state (this, SPA_NODE_STATE_CONFIGURE);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
|
|
@ -820,6 +818,9 @@ alsa_source_init (const SpaHandleFactory *factory,
|
|||
this->props[1].props.unset_mask &= ~1;
|
||||
}
|
||||
}
|
||||
|
||||
update_state (this, SPA_NODE_STATE_CONFIGURE);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -286,8 +286,6 @@ spa_v4l2_source_node_set_event_callback (SpaNode *node,
|
|||
this->event_cb = event;
|
||||
this->user_data = user_data;
|
||||
|
||||
update_state (this, SPA_NODE_STATE_CONFIGURE);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
|
|
@ -855,6 +853,8 @@ v4l2_source_init (const SpaHandleFactory *factory,
|
|||
}
|
||||
}
|
||||
|
||||
update_state (this, SPA_NODE_STATE_CONFIGURE);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue