mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
combine-stream tag forward
This commit is contained in:
parent
99d342bd23
commit
e757868cf9
1 changed files with 26 additions and 0 deletions
|
|
@ -25,6 +25,7 @@
|
||||||
#include <spa/param/audio/format-utils.h>
|
#include <spa/param/audio/format-utils.h>
|
||||||
#include <spa/param/audio/raw.h>
|
#include <spa/param/audio/raw.h>
|
||||||
#include <spa/param/latency-utils.h>
|
#include <spa/param/latency-utils.h>
|
||||||
|
#include <spa/param/tag-utils.h>
|
||||||
|
|
||||||
#include <pipewire/impl.h>
|
#include <pipewire/impl.h>
|
||||||
#include <pipewire/i18n.h>
|
#include <pipewire/i18n.h>
|
||||||
|
|
@ -618,6 +619,27 @@ static int do_add_stream(struct spa_loop *loop, bool async, uint32_t seq,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void param_tag_changed(struct impl *impl, const struct spa_pod *param)
|
||||||
|
{
|
||||||
|
if (param == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pw_log_debug("tag update");
|
||||||
|
struct stream *s;
|
||||||
|
struct spa_tag_info tag;
|
||||||
|
const struct spa_pod *params[1] = { param };
|
||||||
|
void *state = NULL;
|
||||||
|
|
||||||
|
if (spa_tag_parse(param, &tag, &state) < 0)
|
||||||
|
return;
|
||||||
|
spa_list_for_each(s, &impl->streams, link) {
|
||||||
|
if (s->stream == NULL)
|
||||||
|
continue;
|
||||||
|
pw_log_debug("updating stream %d", s->id);
|
||||||
|
pw_stream_update_params(s->stream, params, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int do_remove_stream(struct spa_loop *loop, bool async, uint32_t seq,
|
static int do_remove_stream(struct spa_loop *loop, bool async, uint32_t seq,
|
||||||
const void *data, size_t size, void *user_data)
|
const void *data, size_t size, void *user_data)
|
||||||
{
|
{
|
||||||
|
|
@ -1247,6 +1269,10 @@ static void combine_param_changed(void *d, uint32_t id, const struct spa_pod *pa
|
||||||
update_latency(impl);
|
update_latency(impl);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case SPA_PARAM_Tag: {
|
||||||
|
param_tag_changed(impl, param);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue