Pipewireパッケージ(ちょっと変更)
Revisão | 0278695e7dcdfc0f7728e1837ffb48186643d21e (tree) |
---|---|
Hora | 2023-11-15 21:02:08 |
Autor | Wim Taymans <wtaymans@redh...> |
Commiter | Wim Taymans |
modules: add tunnel.may-pause option for pipe-tunnel
To override the default may-pause behaviour of streams.
@@ -40,6 +40,7 @@ | ||
40 | 40 | * ## Module Options |
41 | 41 | * |
42 | 42 | * - `tunnel.mode`: the desired tunnel to create. (Default `playback`) |
43 | + * - `tunnel.may-pause`: if the tunnel stream is allowed to pause on xrun | |
43 | 44 | * - `pipe.filename`: the filename of the pipe. |
44 | 45 | * - `stream.props`: Extra properties for the local stream. |
45 | 46 | * |
@@ -55,6 +56,12 @@ | ||
55 | 56 | * When `tunnel.mode` is `source`, a source node is created. Samples read from |
56 | 57 | * the the pipe will be made available on the source. |
57 | 58 | * |
59 | + * `tunnel.may-pause` allows the tunnel stream to become inactive (paused) when | |
60 | + * there is no data in the fifo or when the fifo is full. For `capture` and | |
61 | + * `playback` `tunnel.mode` this is by default true. For `source` and `sink` | |
62 | + * `tunnel.mode`, this is by default false. A paused stream will consume no | |
63 | + * CPU and will resume when the fifo becomes readable or writable again. | |
64 | + * | |
58 | 65 | * When `pipe.filename` is not given, a default fifo in `/tmp/fifo_input` or |
59 | 66 | * `/tmp/fifo_output` will be created that can be written and read respectively, |
60 | 67 | * depending on the selected `tunnel.mode`. |
@@ -86,6 +93,7 @@ | ||
86 | 93 | * { name = libpipewire-module-pipe-tunnel |
87 | 94 | * args = { |
88 | 95 | * tunnel.mode = playback |
96 | + * #tunnel.may-pause = true | |
89 | 97 | * # Set the pipe name to tunnel to |
90 | 98 | * pipe.filename = "/tmp/fifo_output" |
91 | 99 | * #audio.format=<sample format> |
@@ -128,6 +136,7 @@ PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME); | ||
128 | 136 | "( audio.channels=<number of channels> ) " \ |
129 | 137 | "( audio.position=<channel map> ) " \ |
130 | 138 | "( tunnel.mode=capture|playback|sink|source )" \ |
139 | + "( tunnel.may-pause=<bool, if the stream can pause> )" \ | |
131 | 140 | "( pipe.filename=<filename> )" \ |
132 | 141 | "( stream.props=<properties> ) " |
133 | 142 |
@@ -898,6 +907,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) | ||
898 | 907 | res = -EINVAL; |
899 | 908 | goto error; |
900 | 909 | } |
910 | + if ((str = pw_properties_get(props, "tunnel.may-pause")) != NULL) | |
911 | + impl->may_pause = spa_atob(str); | |
901 | 912 | |
902 | 913 | if (pw_properties_get(props, PW_KEY_NODE_VIRTUAL) == NULL) |
903 | 914 | pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true"); |