mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
stream: Align with pw_filter
Remove some of the unused states in pw_stream. The app can know the state by following the format and buffer events. Make it possible to be notified of io are updates. This should make it possible to follow the transport etc. Make it possible to be notified of any param changes. Rename finish_format to update_params because that is what it does. Make this work in the same was as the filter: updating the params removes all old params of the types and installs the new ones. Don't get the Props and PropInfo from the node proxy, instead get them directly from the adapter that we have locally. Update the controls directly on the adapter instead of going to the server first.
This commit is contained in:
parent
be53554def
commit
738603fd04
11 changed files with 232 additions and 268 deletions
|
|
@ -186,7 +186,7 @@ static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum
|
|||
printf("stream state: \"%s\"\n", pw_stream_state_as_string(state));
|
||||
|
||||
switch (state) {
|
||||
case PW_STREAM_STATE_CONFIGURE:
|
||||
case PW_STREAM_STATE_PAUSED:
|
||||
printf("node id: %d\n", pw_stream_get_node_id(data->stream));
|
||||
break;
|
||||
case PW_STREAM_STATE_STREAMING:
|
||||
|
|
@ -210,7 +210,7 @@ static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum
|
|||
}
|
||||
|
||||
static void
|
||||
on_stream_format_changed(void *_data, const struct spa_pod *format)
|
||||
on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
||||
{
|
||||
struct data *data = _data;
|
||||
struct pw_stream *stream = data->stream;
|
||||
|
|
@ -218,11 +218,10 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer));
|
||||
const struct spa_pod *params[5];
|
||||
|
||||
if (format == NULL) {
|
||||
pw_stream_finish_format(stream, 0, NULL, 0);
|
||||
if (param == NULL || id != SPA_PARAM_Format)
|
||||
return;
|
||||
}
|
||||
spa_format_video_raw_parse(format, &data->format);
|
||||
|
||||
spa_format_video_raw_parse(param, &data->format);
|
||||
|
||||
data->stride = SPA_ROUND_UP_N(data->format.size.width * BPP, 4);
|
||||
|
||||
|
|
@ -258,13 +257,13 @@ on_stream_format_changed(void *_data, const struct spa_pod *format)
|
|||
SPA_PARAM_META_size, SPA_POD_Int(
|
||||
CURSOR_META_SIZE(CURSOR_WIDTH,CURSOR_HEIGHT)));
|
||||
|
||||
pw_stream_finish_format(stream, 0, params, 5);
|
||||
pw_stream_update_params(stream, params, 5);
|
||||
}
|
||||
|
||||
static const struct pw_stream_events stream_events = {
|
||||
PW_VERSION_STREAM_EVENTS,
|
||||
.state_changed = on_stream_state_changed,
|
||||
.format_changed = on_stream_format_changed,
|
||||
.param_changed = on_stream_param_changed,
|
||||
};
|
||||
|
||||
static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remote_state state, const char *error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue