mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
pulse-server: set also metadata target.object when moving streams
Set also metadata target.object when moving streams, in case the session manager supports that.
This commit is contained in:
parent
daf85f1cd6
commit
fb04074335
2 changed files with 10 additions and 0 deletions
|
|
@ -260,5 +260,6 @@ static inline uint32_t port_type_value(const char *port_type)
|
|||
#define METADATA_CONFIG_DEFAULT_SINK "default.configured.audio.sink"
|
||||
#define METADATA_CONFIG_DEFAULT_SOURCE "default.configured.audio.source"
|
||||
#define METADATA_TARGET_NODE "target.node"
|
||||
#define METADATA_TARGET_OBJECT "target.object"
|
||||
|
||||
#endif /* PULSE_SERVER_DEFS_H */
|
||||
|
|
|
|||
|
|
@ -4628,6 +4628,7 @@ static int do_move_stream(struct client *client, uint32_t command, uint32_t tag,
|
|||
struct pw_manager_object *o, *dev, *dev_default;
|
||||
uint32_t index, index_device;
|
||||
int target_id;
|
||||
int64_t target_serial;
|
||||
const char *name_device;
|
||||
struct pw_node_info *info;
|
||||
struct selector sel;
|
||||
|
|
@ -4673,8 +4674,10 @@ static int do_move_stream(struct client *client, uint32_t command, uint32_t tag,
|
|||
* forgetting target.node. Follow that behavior here.
|
||||
*/
|
||||
target_id = -1;
|
||||
target_serial = -1;
|
||||
} else {
|
||||
target_id = dev->id;
|
||||
target_serial = dev->serial;
|
||||
}
|
||||
|
||||
if ((res = pw_manager_set_metadata(manager, client->metadata_default,
|
||||
|
|
@ -4683,6 +4686,12 @@ static int do_move_stream(struct client *client, uint32_t command, uint32_t tag,
|
|||
SPA_TYPE_INFO_BASE"Id", "%d", target_id)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = pw_manager_set_metadata(manager, client->metadata_default,
|
||||
o->id,
|
||||
METADATA_TARGET_OBJECT,
|
||||
SPA_TYPE_INFO_BASE"Id", "%"PRIi64, target_serial)) < 0)
|
||||
return res;
|
||||
|
||||
return reply_simple_ack(client, tag);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue