output/pipewire: add config option "remote"
This commit is contained in:
		| @@ -1084,6 +1084,9 @@ Connect to a `PipeWire <https://pipewire.org/>`_ server.  Requires | |||||||
|      - Link to the given target.  If not specified, let the PipeWire |      - Link to the given target.  If not specified, let the PipeWire | ||||||
|        manager select a target.  To get a list of available targets, |        manager select a target.  To get a list of available targets, | ||||||
|        type ``pw-cli dump short Node`` |        type ``pw-cli dump short Node`` | ||||||
|  |    * - **remote NAME** | ||||||
|  |      - The name of the remote to connect to.  The default is | ||||||
|  |        ``pipewire-0``. | ||||||
|  |  | ||||||
| .. _pulse_plugin: | .. _pulse_plugin: | ||||||
|  |  | ||||||
|   | |||||||
| @@ -54,6 +54,7 @@ static constexpr Domain pipewire_output_domain("pipewire_output"); | |||||||
| class PipeWireOutput final : AudioOutput { | class PipeWireOutput final : AudioOutput { | ||||||
| 	const char *const name; | 	const char *const name; | ||||||
|  |  | ||||||
|  | 	const char *const remote; | ||||||
| 	const char *const target; | 	const char *const target; | ||||||
|  |  | ||||||
| 	struct pw_thread_loop *thread_loop = nullptr; | 	struct pw_thread_loop *thread_loop = nullptr; | ||||||
| @@ -185,6 +186,7 @@ inline | |||||||
| PipeWireOutput::PipeWireOutput(const ConfigBlock &block) | PipeWireOutput::PipeWireOutput(const ConfigBlock &block) | ||||||
| 	:AudioOutput(FLAG_ENABLE_DISABLE), | 	:AudioOutput(FLAG_ENABLE_DISABLE), | ||||||
| 	 name(block.GetBlockValue("name", "pipewire")), | 	 name(block.GetBlockValue("name", "pipewire")), | ||||||
|  | 	 remote(block.GetBlockValue("remote", nullptr)), | ||||||
| 	 target(block.GetBlockValue("target", nullptr)) | 	 target(block.GetBlockValue("target", nullptr)) | ||||||
| { | { | ||||||
| 	if (target != nullptr) { | 	if (target != nullptr) { | ||||||
| @@ -366,6 +368,10 @@ PipeWireOutput::Open(AudioFormat &audio_format) | |||||||
| 				       PW_KEY_APP_NAME, "Music Player Daemon", | 				       PW_KEY_APP_NAME, "Music Player Daemon", | ||||||
| 				       PW_KEY_NODE_NAME, "mpd", | 				       PW_KEY_NODE_NAME, "mpd", | ||||||
| 				       nullptr); | 				       nullptr); | ||||||
|  |  | ||||||
|  | 	if (remote != nullptr && target_id == PW_ID_ANY) | ||||||
|  | 		pw_properties_setf(props, PW_KEY_REMOTE_NAME, "%s", remote); | ||||||
|  |  | ||||||
| 	if (target != nullptr && target_id == PW_ID_ANY) | 	if (target != nullptr && target_id == PW_ID_ANY) | ||||||
| 		pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", target); | 		pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", target); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann