After we grab the lockfile we should remove the socket when it
exists so that we can bind again. This should solve startup
problems after a crash, which left the socket around and caused
bind failures.
Not closing the fd causes leaks in existing apps. It's probably better
to always close it and let apps deal with that by using dup or similar.
Make gst sink and source dup the fd before connect_fd().
Fixes#181
spa_pod_builder_add() is a va_args function that is terminated by a NULL
argument. The last argument must be a pointer type, because otherwise
checking for a NULL pointer can fail.
The __attribute__((__sentinel__)) prints a compiler warning, if the last
argument of a call to spa_pod_builder_add() is not a pointer type.
Fix all sentinel warnings by replacing all integer type 0 with pointer
type NULL in calls to spa_pod_builder_add().
self->type is needed in registry_event_global() so it must be set in
gst_pipewire_device_provider_probe() as well.
self->devices is initialized as NULL when probing is started. So it should
be just a simple GList* pointer.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Make pw_remote_connect_fd() not automatically close the provided
fd but let the caller take care of that. This allows us to reuse
the fd in pipewiresrc.
Fixes#155
This is necessary for 'do-timestamp' to work if the source provides no
timestamps. Without this, the timestamp from the first use will remain,
because the basesrc only overwrites timestamps that are
GST_CLOCK_TIME_NONE.
The build scripts assumed ptrdiff_t to just be around by default. But POSIX
specifies ptrdiff_t to be defined in <stddef.h>, which is now included from
the test.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
If a command fails, there's no point in continuing with configuring
the project. Exit immediately.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
According to the meson man page, arguments go directly after the command's
name. Rearrange the call accordingly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
The autogen.sh script creates a symbolic link to the build/Makfile. If
the link already exists, a warning is printed and the old link persists.
Now replace it with the correct target.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Introduce spa_hook_list_call_simple_safe() as a new helper that uses
spa_list_for_each_safe() and use it for pw_node_events_* This way multiple
threads can iterate at the same time and, if only one thread is active, the
current list entry can be safely removed (e.g. in
pw_node_events_destroy()).
Without this the node listener_list may be corrupted when the main and data
loop iterate over the list at the same time (See #143).
pw_core_find_format() is currently broken when one of the ports is already
active: The format of the active port is used and the other port is
completely ignored.
As a result, the autolink module may try to link a new port to the first
already active port even if the formats do not match.
To fix this, use the format of the active port as a filter and enumerate
the formats of the other port.
Detect what clients were started by the portal, and use the permission
store to determine permissions of existing and future nodes.
Clients are detected whether they are from the portal or not by
comparing the PID of the client with the PID of the owner of the
portal D-Bus name.
It is assumed that the portal will set an appropriate app_id, and a
comma seperated list of media roles (e.g. "Camera"), that should be
queried. If app_id is an empty string, it's assumed to be a
non-sandboxed client, and permissions are assumed to be allowing.
Add a permissions_changed event when the permissions change for a
global for a client.
Recheck if a link is still allowed when node permissions changed
and destroy the link if not.
To get the permissions of an object, combine the permissions
of the object and all the parent nodes up to the root.
This is necessary to enforce that a client can never see and
object id (in this case the parent id) it is not allowed to see.
Don't pass the ucred to the client construct, just set the properties
in the protocol.
Use the client properties to get ucred.
Add the security label to the client properties (from SO_PEERSEC)
Destroy all resources (except the core) for a client when it
does a hello. This typically needs to be done after passing the
connection fd from one client to another.
Properties that start with "pipewire." can only be set once. This
prevents a client from overwriting the ucred or any of the other
protected properties once they are set by the core or a module.
Allow disabling real time thread, this is useful to run inside
valgrind without being killed.
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Depending on the compiler configuration 'char' may be an unsigned type
which will not work as expected.
Signed-off-by: Matthias Fend <matthias.fend@wolfvision.net>
An unquoted $@ will break for arguments with spaces in their names. Unquoted $@ will work until it doesn't, and then it can be tricky to track down exactly what went wrong. Using "$@" will save someone some headache in the future.