mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
stream: invoke RequestProcess in the main loop
pw_stream_trigger_process() can be called from any thread but the RequestProcess event always needs to be scheduled in the main-loop.
This commit is contained in:
parent
7da61e2dfa
commit
917d865ea8
2 changed files with 10 additions and 4 deletions
|
|
@ -1958,8 +1958,10 @@ do_trigger_process(struct spa_loop *loop,
|
|||
return spa_node_call_ready(&impl->callbacks, res);
|
||||
}
|
||||
|
||||
static int trigger_request_process(struct filter *impl)
|
||||
static int do_trigger_request_process(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct filter *impl = user_data;
|
||||
uint8_t buffer[1024];
|
||||
struct spa_pod_builder b = { 0 };
|
||||
|
||||
|
|
@ -1979,7 +1981,8 @@ int pw_filter_trigger_process(struct pw_filter *filter)
|
|||
pw_log_trace_fp("%p", impl);
|
||||
|
||||
if (!impl->driving) {
|
||||
res = trigger_request_process(impl);
|
||||
res = pw_loop_invoke(impl->context->main_loop,
|
||||
do_trigger_request_process, 1, NULL, 0, false, impl);
|
||||
} else {
|
||||
res = pw_loop_invoke(impl->context->data_loop,
|
||||
do_trigger_process, 1, NULL, 0, false, impl);
|
||||
|
|
|
|||
|
|
@ -2389,8 +2389,10 @@ do_trigger_process(struct spa_loop *loop,
|
|||
return spa_node_call_ready(&impl->callbacks, res);
|
||||
}
|
||||
|
||||
static int trigger_request_process(struct stream *impl)
|
||||
static int do_trigger_request_process(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct stream *impl = user_data;
|
||||
uint8_t buffer[1024];
|
||||
struct spa_pod_builder b = { 0 };
|
||||
|
||||
|
|
@ -2413,7 +2415,8 @@ int pw_stream_trigger_process(struct pw_stream *stream)
|
|||
impl->using_trigger = true;
|
||||
|
||||
if (!impl->driving && !impl->trigger) {
|
||||
res = trigger_request_process(impl);
|
||||
res = pw_loop_invoke(impl->context->main_loop,
|
||||
do_trigger_request_process, 1, NULL, 0, false, impl);
|
||||
} else {
|
||||
if (!impl->process_rt)
|
||||
call_process(impl);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue