pulse-server: use TARGET_OBJECT

The pulse API uses either the node.name or object.serials so pass this
along in the TARGET_OBJECT instead of the NODE_TARGET now that
wireplumber handles this.
This commit is contained in:
Wim Taymans 2023-01-10 16:05:55 +01:00
parent 624e265fd6
commit ff69454eb4
14 changed files with 16 additions and 44 deletions

View file

@ -1569,7 +1569,6 @@ static void log_format_info(struct impl *impl, enum spa_log_level level, struct
static int do_create_playback_stream(struct client *client, uint32_t command, uint32_t tag, struct message *m)
{
struct impl *impl = client->impl;
struct pw_manager *manager = client->manager;
const char *name = NULL;
int res;
struct sample_spec ss;
@ -1780,14 +1779,9 @@ static int do_create_playback_stream(struct client *client, uint32_t command, ui
flags |= PW_STREAM_FLAG_DONT_RECONNECT;
if (sink_name != NULL) {
pw_properties_set(props,
PW_KEY_NODE_TARGET, sink_name);
pw_properties_set(props,
PW_KEY_TARGET_OBJECT, sink_name);
} else if (sink_index != SPA_ID_INVALID && sink_index != 0) {
pw_properties_setf(props,
PW_KEY_NODE_TARGET, "%u",
index_to_id(manager, sink_index));
pw_properties_setf(props,
PW_KEY_TARGET_OBJECT, "%u", sink_index);
}
@ -1837,7 +1831,6 @@ error:
static int do_create_record_stream(struct client *client, uint32_t command, uint32_t tag, struct message *m)
{
struct impl *impl = client->impl;
struct pw_manager *manager = client->manager;
const char *name = NULL;
int res;
struct sample_spec ss;
@ -2051,24 +2044,16 @@ static int do_create_record_stream(struct client *client, uint32_t command, uint
source_index = id;
}
if (source_index != SPA_ID_INVALID && source_index != 0) {
pw_properties_setf(props,
PW_KEY_NODE_TARGET, "%u",
index_to_id(manager, source_index));
pw_properties_setf(props,
PW_KEY_TARGET_OBJECT, "%u", source_index);
} else if (source_name != NULL) {
if (spa_strendswith(source_name, ".monitor")) {
pw_properties_setf(props,
PW_KEY_NODE_TARGET,
"%.*s", (int)strlen(source_name)-8, source_name);
pw_properties_setf(props,
PW_KEY_TARGET_OBJECT,
"%.*s", (int)strlen(source_name)-8, source_name);
pw_properties_set(props,
PW_KEY_STREAM_CAPTURE_SINK, "true");
} else {
pw_properties_set(props,
PW_KEY_NODE_TARGET, source_name);
pw_properties_set(props,
PW_KEY_TARGET_OBJECT, source_name);
}
@ -2628,7 +2613,6 @@ static int do_play_sample(struct client *client, uint32_t command, uint32_t tag,
if (sample == NULL)
goto error_noent;
pw_properties_setf(props, PW_KEY_NODE_TARGET, "%u", o->id);
pw_properties_setf(props, PW_KEY_TARGET_OBJECT, "%"PRIu64, o->serial);
play = sample_play_new(client->core, sample, props, sizeof(struct pending_sample));