mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
Multimedia processing graphs
This patch is fixing random crashes when vlc player connects rtsp.
we have two places to do link_activate, one is in node_activate(1),
the other one happens on link_paused(2).
The order of (1) and (2) can vary for each different connection.
Sometimes, (1) comes before (2); Sometimes, (1) comes after (2).
This will cause one crash in about five connections from vlc to
rtsp.
If link_paused(2) is earlier than node_activate, it will do set_io
and make activated=true, then when node_activate(1) comes, nothing
will happen:
int pw_link_activate(struct pw_link *this)
{
struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
int res;
pw_log_debug(NAME" %p: activate %d %d", this, impl->activated, this->info.state);
if (impl->activated)
return 0;
...
}
In this case, everything works well.
If node_activate(1) is earlier than (2), it will do port_set_io, but
"activated" will still be false after port_set_io since the link state
can be not PW_LINK_STATE_PAUSED:
int pw_link_activate(struct pw_link *this)
{
struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
int res;
pw_log_debug(NAME" %p: activate %d %d", this, impl->activated, this->info.state);
if (impl->activated)
return 0;
pw_link_prepare(this);
... // port_set_io
if (this->info.state == PW_LINK_STATE_PAUSED) {
pw_loop_invoke(this->output->node->data_loop,
do_activate_link, SPA_ID_INVALID, NULL, 0, false, this);
impl->activated = true;
}
return 0;
}
Then when link_paused(2) happens after (1), port_set_io will be done
again.
This will lead to random crash of pipewire.
Signed-off-by: Barry Song
Fixes #186
|
||
|---|---|---|
| doc | ||
| man | ||
| pipewire-alsa@dddaaf4db4 | ||
| pipewire-jack@274d616fa6 | ||
| pipewire-pulseaudio@f269cb9e51 | ||
| po | ||
| spa | ||
| src | ||
| .editorconfig | ||
| .gitignore | ||
| .gitmodules | ||
| .travis.yml | ||
| _config.yml | ||
| autogen.sh | ||
| check_missing_headers.sh | ||
| config.h.meson | ||
| COPYING | ||
| LICENSE | ||
| Makefile.in | ||
| meson.build | ||
| meson_options.txt | ||
| NEWS | ||
| PROTOCOL | ||
| pw-uninstalled.sh | ||
| README | ||
PipeWire
--------
PipeWire is a server and user space API to deal with multimedia
pipelines. This includes:
- Making available sources of video (such as from a capture devices or
application provided streams) and multiplexing this with
clients.
- Accessing sources of video for consumption.
- Generating graphs for audio and video processing.
Nodes in the graph can be implemented as separate processes,
communicating with sockets and exchanging multimedia content using fd
passing.
Building
--------
Pipewire uses the Meson and Ninja build system to compile. If you're not
familiar with these tools, the included "autogen.sh" script will
automatically run the correct meson/ninja commands, and output a Makefile.
It follows that there are two methods to build Pipewire, however both rely
on Meson and Ninja to actually perform the compilation:
$ ./autogen.sh
$ make
or the Meson/Ninja native method:
$ meson build
$ cd build
$ ninja
You can see the available meson options in meson_options.txt file.