mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
Add set_active method on node
Require that nodes need to be activated before they are scheduled. Make method to activate remote node. Add method to pause/resume stream.
This commit is contained in:
parent
acfdc63f26
commit
d96d40e30a
19 changed files with 135 additions and 46 deletions
|
|
@ -458,8 +458,8 @@ static void make_node(struct data *data)
|
|||
data->node = pw_node_new(data->core, "SDL-sink", props, 0);
|
||||
data->impl_node = impl_node;
|
||||
pw_node_set_implementation(data->node, &data->impl_node);
|
||||
|
||||
pw_node_register(data->node, NULL, NULL);
|
||||
pw_node_set_active(data->node, true);
|
||||
|
||||
pw_remote_export(data->remote, data->node);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -355,6 +355,7 @@ static void make_node(struct data *data)
|
|||
pw_node_set_implementation(data->node, &data->impl_node);
|
||||
|
||||
pw_node_register(data->node, NULL, NULL);
|
||||
pw_node_set_active(data->node, true);
|
||||
|
||||
pw_remote_export(data->remote, data->node);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ static int make_node(struct data *data)
|
|||
PW_VERSION_NODE,
|
||||
props, SPA_ID_INVALID);
|
||||
|
||||
pw_node_set_active(data->node, true);
|
||||
|
||||
pw_remote_export(data->remote, data->node);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -149,10 +149,18 @@ on_stream_new_buffer(void *_data, uint32_t id)
|
|||
handle_events(data);
|
||||
}
|
||||
|
||||
static void on_stream_state_changed(void *data, enum pw_stream_state old,
|
||||
static void on_stream_state_changed(void *_data, enum pw_stream_state old,
|
||||
enum pw_stream_state state, const char *error)
|
||||
{
|
||||
struct data *data = _data;
|
||||
printf("stream state: \"%s\"\n", pw_stream_state_as_string(state));
|
||||
switch (state) {
|
||||
case PW_STREAM_STATE_CONFIGURE:
|
||||
pw_stream_set_active(data->stream, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static struct {
|
||||
|
|
@ -355,7 +363,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
pw_stream_connect(data->stream,
|
||||
PW_DIRECTION_INPUT,
|
||||
PW_STREAM_MODE_BUFFER,
|
||||
data->path, PW_STREAM_FLAG_AUTOCONNECT, 1, formats);
|
||||
data->path, PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE, 1, formats);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue