mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -05:00
stream: emit the RequestProcess event
Emit the RequestProcess event when pw_stream_trigger_process() was called but we are not the driver node. Fixes #1728
This commit is contained in:
parent
b5080a0395
commit
baca092ba5
1 changed files with 22 additions and 10 deletions
|
|
@ -2192,6 +2192,18 @@ do_trigger_process(struct spa_loop *loop,
|
||||||
return spa_node_call_ready(&impl->callbacks, res);
|
return spa_node_call_ready(&impl->callbacks, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int trigger_request_process(struct stream *impl)
|
||||||
|
{
|
||||||
|
uint8_t buffer[1024];
|
||||||
|
struct spa_pod_builder b = { 0 };
|
||||||
|
|
||||||
|
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||||
|
spa_node_emit_event(&impl->hooks,
|
||||||
|
spa_pod_builder_add_object(&b,
|
||||||
|
SPA_TYPE_EVENT_Node, SPA_NODE_EVENT_RequestProcess));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
int pw_stream_trigger_process(struct pw_stream *stream)
|
int pw_stream_trigger_process(struct pw_stream *stream)
|
||||||
{
|
{
|
||||||
|
|
@ -2203,9 +2215,9 @@ int pw_stream_trigger_process(struct pw_stream *stream)
|
||||||
/* flag to check for old or new behaviour */
|
/* flag to check for old or new behaviour */
|
||||||
impl->using_trigger = true;
|
impl->using_trigger = true;
|
||||||
|
|
||||||
if (!impl->driving)
|
if (!impl->driving) {
|
||||||
return -EINVAL;
|
res = trigger_request_process(impl);
|
||||||
|
} else {
|
||||||
if (impl->direction == SPA_DIRECTION_OUTPUT &&
|
if (impl->direction == SPA_DIRECTION_OUTPUT &&
|
||||||
!impl->process_rt) {
|
!impl->process_rt) {
|
||||||
pw_loop_invoke(impl->context->main_loop,
|
pw_loop_invoke(impl->context->main_loop,
|
||||||
|
|
@ -2213,6 +2225,6 @@ int pw_stream_trigger_process(struct pw_stream *stream)
|
||||||
}
|
}
|
||||||
res = pw_loop_invoke(impl->context->data_loop,
|
res = pw_loop_invoke(impl->context->data_loop,
|
||||||
do_trigger_process, 1, NULL, 0, false, impl);
|
do_trigger_process, 1, NULL, 0, false, impl);
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue