diff options
Diffstat (limited to 'media-video/pipewire')
7 files changed, 410 insertions, 0 deletions
diff --git a/media-video/pipewire/Manifest b/media-video/pipewire/Manifest new file mode 100644 index 000000000000..a9f613d3ec2d --- /dev/null +++ b/media-video/pipewire/Manifest @@ -0,0 +1,7 @@ +AUX pipewire-0.2.6-alsa-lib-1.1.9.patch 1909 BLAKE2B 4e6c1143dff1b48cd415068369d0a9f99b37002b1ecd083bcf39c7d060cd59b211f7ed585cafd6a8a980897ffa24fa68366346f3ff62cdc1ddddd2b327343633 SHA512 27aabf39e6615925ef21f2a1b4c2914204d4dd9f2de674912a76e049a30f685c036a78f4243e8005c1739acb9d698129f4e59ef78576acd5287a31dab22aca3c +AUX pipewire-0.2.6-fix-probing-without-starting.patch 2119 BLAKE2B f7180ad95f0f285a633059e8e1d0dee9f3d42ac04237ed47931da16813af2fc4f766720e2ee73442af102f856938caa1243b4c65584e9a79e5b5772718393727 SHA512 101762a2b468c280ee3f8010d3a8603f4a026b77659f34056821d9ba164bb4255a6c83a3fe30721c2092727bfed00f637bfe3d726f67a71eaf6e51050d928e04 +AUX pipewire-0.2.6-reuse-fd-in-pipewiresrc.patch 5684 BLAKE2B 9ce85e2f15b18ef458d21a44b10c875b0cb456972a61dd1ff127ad62510604d35ea6dd70daa0191181a34d2fea613ac254ffd6fa4f0fa3bb6114191e3a62996e SHA512 ba194a678b1130a29b17f1831c1a94c24db6cb05ae1d2a0e825fd1099aa2a300200d7cbfd5e5b592c54aea33893c68e554edd4bdfd1ca6cc84739b12e33058f6 +AUX pipewire-0.2.6-revert-combine-all-perms.patch 1039 BLAKE2B 5fd1d82c92680b6097ac70367eb5f7fc8190d0589d4bb228dc93c6f673763a65a7c18a5fd3b242686ba86773d90078cc50a5d7c2277dc90edcdb341d5ecb9f23 SHA512 c9bab5e79b4a88f240d34702dfe5de2df4ab7c5158d5b95228647018cb5bb69ec124fb47405074aef91480d25d388df7cdbb7fa94396d228b6f573697b2f8333 +DIST pipewire-0.2.6.tar.gz 421137 BLAKE2B 155667d14fe5380e21f0b70accea72dc4478085916a9126185136f6d33bd7729d91b790c171dcf7b6aea2c52894462d16516f8821229ca0bf9f6cde15df524d9 SHA512 3d1db41f5beb42a0ee15ae7bc8afb89b54a37c3a6a414e88b5e33ceaf98ec6dda0d9a2d03ac47a8dfce48e9637e647291919e6670bb70589b0d1951fbcbd3ff8 +EBUILD pipewire-0.2.6.ebuild 1831 BLAKE2B 53426ccce169bb1d4ac89251afa82deefb9ed416fc764fc12bc0a7193295ac6a771d0e16ccf90b6fc489302b47b04af36d7bae8bc4c9d1a70061332e2d72d31d SHA512 88d98a80a6f04d16b6ea1ce8a9e7758a42e406314e7174abf96bfd0d90e36e101a1ec81625e98efa4902e627252cef7545f1b94314ddff146a8fae51cc52a4e3 +MISC metadata.xml 449 BLAKE2B c580fa69fbecd1046123d51f0a556bf54e7dd76a7ced768ae31289969a3fcb0c03f301a214da222201bad2cd0bcf68674807e28efcdee27edd9fa6d913cdc146 SHA512 73c4b73b417e92d1bdf802ce38939afdff2ba42bc638e0c6ba42593894755ce6f197678e8676f763bd66bb0b2bb9175c1369c173be3ab64e7323795d3b00bf0c diff --git a/media-video/pipewire/files/pipewire-0.2.6-alsa-lib-1.1.9.patch b/media-video/pipewire/files/pipewire-0.2.6-alsa-lib-1.1.9.patch new file mode 100644 index 000000000000..7b2b4c894da3 --- /dev/null +++ b/media-video/pipewire/files/pipewire-0.2.6-alsa-lib-1.1.9.patch @@ -0,0 +1,66 @@ +From 37613b67ba52b5ad4e81d7ea38adc04027d9f9e5 Mon Sep 17 00:00:00 2001 +From: Wim Taymans <wtaymans@redhat.com> +Date: Thu, 23 May 2019 09:25:51 +0200 +Subject: [PATCH] alsa: handle alsa-lib 1.1.9 + +alsa-lib 1.1.9 removed /usr/include/alsa from the include path, we +must include <alsa/asoundlib.h> +--- + spa/plugins/alsa/alsa-monitor.c | 2 +- + spa/plugins/alsa/alsa-sink.c | 2 +- + spa/plugins/alsa/alsa-source.c | 2 +- + spa/plugins/alsa/alsa-utils.h | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/spa/plugins/alsa/alsa-monitor.c b/spa/plugins/alsa/alsa-monitor.c +index d8935cd7..16a01302 100644 +--- a/spa/plugins/alsa/alsa-monitor.c ++++ b/spa/plugins/alsa/alsa-monitor.c +@@ -25,7 +25,7 @@ + #include <poll.h> + + #include <libudev.h> +-#include <asoundlib.h> ++#include <alsa/asoundlib.h> + + #include <spa/support/log.h> + #include <spa/support/type-map.h> +diff --git a/spa/plugins/alsa/alsa-sink.c b/spa/plugins/alsa/alsa-sink.c +index c31fe3e2..3c252fab 100644 +--- a/spa/plugins/alsa/alsa-sink.c ++++ b/spa/plugins/alsa/alsa-sink.c +@@ -19,7 +19,7 @@ + + #include <stddef.h> + +-#include <asoundlib.h> ++#include <alsa/asoundlib.h> + + #include <spa/node/node.h> + #include <spa/param/audio/format.h> +diff --git a/spa/plugins/alsa/alsa-source.c b/spa/plugins/alsa/alsa-source.c +index 74bbb3c0..8efc8fde 100644 +--- a/spa/plugins/alsa/alsa-source.c ++++ b/spa/plugins/alsa/alsa-source.c +@@ -19,7 +19,7 @@ + + #include <stddef.h> + +-#include <asoundlib.h> ++#include <alsa/asoundlib.h> + + #include <spa/node/node.h> + #include <spa/utils/list.h> +diff --git a/spa/plugins/alsa/alsa-utils.h b/spa/plugins/alsa/alsa-utils.h +index 5ba57bc5..3b590007 100644 +--- a/spa/plugins/alsa/alsa-utils.h ++++ b/spa/plugins/alsa/alsa-utils.h +@@ -26,7 +26,7 @@ extern "C" { + + #include <stddef.h> + +-#include <asoundlib.h> ++#include <alsa/asoundlib.h> + + #include <spa/support/type-map.h> + #include <spa/support/loop.h> diff --git a/media-video/pipewire/files/pipewire-0.2.6-fix-probing-without-starting.patch b/media-video/pipewire/files/pipewire-0.2.6-fix-probing-without-starting.patch new file mode 100644 index 000000000000..9b3aed33b961 --- /dev/null +++ b/media-video/pipewire/files/pipewire-0.2.6-fix-probing-without-starting.patch @@ -0,0 +1,63 @@ +From 37e66c9e55f556558088d9f6b2200d4341a37f04 Mon Sep 17 00:00:00 2001 +From: Michael Olbrich <m.olbrich@pengutronix.de> +Date: Tue, 18 Jun 2019 09:53:12 +0200 +Subject: [PATCH] deviceprovider: fix probing without starting + +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> +--- + src/gst/gstpipewiredeviceprovider.c | 8 ++++++-- + src/gst/gstpipewiredeviceprovider.h | 2 +- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/gst/gstpipewiredeviceprovider.c b/src/gst/gstpipewiredeviceprovider.c +index b6472d96..02b38c2e 100644 +--- a/src/gst/gstpipewiredeviceprovider.c ++++ b/src/gst/gstpipewiredeviceprovider.c +@@ -265,7 +265,7 @@ static void do_add_node(void *data) + nd->dev = new_node (self, nd); + if (nd->dev) { + if(self->list_only) +- *self->devices = g_list_prepend (*self->devices, gst_object_ref_sink (nd->dev)); ++ self->devices = g_list_prepend (self->devices, gst_object_ref_sink (nd->dev)); + else + gst_device_provider_device_add (GST_DEVICE_PROVIDER (self), nd->dev); + } +@@ -555,6 +555,8 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider) + + t = pw_core_get_type(c); + ++ self->type = pw_core_get_type (c); ++ + if (!(r = pw_remote_new (c, NULL, sizeof(*data)))) + goto failed; + +@@ -612,7 +614,9 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider) + pw_core_destroy (c); + pw_loop_destroy (l); + +- return *self->devices; ++ self->type = NULL; ++ ++ return self->devices; + + failed: + pw_loop_destroy (l); +diff --git a/src/gst/gstpipewiredeviceprovider.h b/src/gst/gstpipewiredeviceprovider.h +index 81622605..3cf2d41b 100644 +--- a/src/gst/gstpipewiredeviceprovider.h ++++ b/src/gst/gstpipewiredeviceprovider.h +@@ -98,7 +98,7 @@ struct _GstPipeWireDeviceProvider { + + gboolean end; + gboolean list_only; +- GList **devices; ++ GList *devices; + }; + + struct _GstPipeWireDeviceProviderClass { diff --git a/media-video/pipewire/files/pipewire-0.2.6-reuse-fd-in-pipewiresrc.patch b/media-video/pipewire/files/pipewire-0.2.6-reuse-fd-in-pipewiresrc.patch new file mode 100644 index 000000000000..a1176d3e1b30 --- /dev/null +++ b/media-video/pipewire/files/pipewire-0.2.6-reuse-fd-in-pipewiresrc.patch @@ -0,0 +1,137 @@ +From 151b2b266e1dae3679584f38b954e4357cf1e5cc Mon Sep 17 00:00:00 2001 +From: Wim Taymans <wtaymans@redhat.com> +Date: Wed, 19 Jun 2019 10:49:28 +0200 +Subject: [PATCH] connection: add do_close flag to connect_fd + +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 +--- + src/modules/module-protocol-native.c | 7 ++++--- + src/modules/module-protocol-native/local-socket.c | 2 +- + src/pipewire/protocol.h | 4 ++-- + src/pipewire/remote.c | 8 ++++---- + src/pipewire/remote.h | 3 ++- + 5 files changed, 13 insertions(+), 11 deletions(-) + +diff --git a/src/modules/module-protocol-native.c b/src/modules/module-protocol-native.c +index 131657f6..0e7b7e27 100644 +--- a/src/modules/module-protocol-native.c ++++ b/src/modules/module-protocol-native.c +@@ -619,7 +619,7 @@ static const struct pw_protocol_native_connection_events conn_events = { + .need_flush = on_need_flush, + }; + +-static int impl_connect_fd(struct pw_protocol_client *client, int fd) ++static int impl_connect_fd(struct pw_protocol_client *client, int fd, bool do_close) + { + struct client *impl = SPA_CONTAINER_OF(client, struct client, this); + struct pw_remote *remote = client->remote; +@@ -638,14 +638,15 @@ static int impl_connect_fd(struct pw_protocol_client *client, int fd) + impl->source = pw_loop_add_io(remote->core->main_loop, + fd, + SPA_IO_IN | SPA_IO_HUP | SPA_IO_ERR, +- true, on_remote_data, impl); ++ do_close, on_remote_data, impl); + if (impl->source == NULL) + goto error_close; + + return 0; + + error_close: +- close(fd); ++ if (do_close) ++ close(fd); + return -ENOMEM; + } + +diff --git a/src/modules/module-protocol-native/local-socket.c b/src/modules/module-protocol-native/local-socket.c +index 5ab5a210..0e68eea9 100644 +--- a/src/modules/module-protocol-native/local-socket.c ++++ b/src/modules/module-protocol-native/local-socket.c +@@ -84,7 +84,7 @@ int pw_protocol_native_connect_local_socket(struct pw_protocol_client *client, + goto error_close; + } + +- res = pw_protocol_client_connect_fd(client, fd); ++ res = pw_protocol_client_connect_fd(client, fd, true); + + done_callback(data, res); + +diff --git a/src/pipewire/protocol.h b/src/pipewire/protocol.h +index 2b6592d1..4a0845fb 100644 +--- a/src/pipewire/protocol.h ++++ b/src/pipewire/protocol.h +@@ -44,14 +44,14 @@ struct pw_protocol_client { + int (*connect) (struct pw_protocol_client *client, + void (*done_callback) (void *data, int result), + void *data); +- int (*connect_fd) (struct pw_protocol_client *client, int fd); ++ int (*connect_fd) (struct pw_protocol_client *client, int fd, bool close); + int (*steal_fd) (struct pw_protocol_client *client); + void (*disconnect) (struct pw_protocol_client *client); + void (*destroy) (struct pw_protocol_client *client); + }; + + #define pw_protocol_client_connect(c,cb,d) ((c)->connect(c,cb,d)) +-#define pw_protocol_client_connect_fd(c,fd) ((c)->connect_fd(c,fd)) ++#define pw_protocol_client_connect_fd(c,fd,cl) ((c)->connect_fd(c,fd,cl)) + #define pw_protocol_client_steal_fd(c) ((c)->steal_fd(c)) + #define pw_protocol_client_disconnect(c) ((c)->disconnect(c)) + #define pw_protocol_client_destroy(c) ((c)->destroy(c)) +diff --git a/src/pipewire/remote.c b/src/pipewire/remote.c +index f63a973a..472b2684 100644 +--- a/src/pipewire/remote.c ++++ b/src/pipewire/remote.c +@@ -305,7 +305,7 @@ void pw_remote_destroy(struct pw_remote *remote) + spa_list_consume(stream, &remote->stream_list, link) + pw_stream_destroy(stream); + +- pw_protocol_client_destroy (remote->conn); ++ pw_protocol_client_destroy(remote->conn); + + spa_list_remove(&remote->link); + +@@ -413,7 +413,7 @@ int pw_remote_connect(struct pw_remote *remote) + + pw_remote_update_state(remote, PW_REMOTE_STATE_CONNECTING, NULL); + +- if ((res = pw_protocol_client_connect (remote->conn, done_connect, remote)) < 0) { ++ if ((res = pw_protocol_client_connect(remote->conn, done_connect, remote)) < 0) { + pw_remote_update_state(remote, PW_REMOTE_STATE_ERROR, + "connect failed %s", spa_strerror(res)); + return res; +@@ -428,7 +428,7 @@ int pw_remote_connect_fd(struct pw_remote *remote, int fd) + + pw_remote_update_state(remote, PW_REMOTE_STATE_CONNECTING, NULL); + +- if ((res = pw_protocol_client_connect_fd (remote->conn, fd)) < 0) { ++ if ((res = pw_protocol_client_connect_fd(remote->conn, fd, false)) < 0) { + pw_remote_update_state(remote, PW_REMOTE_STATE_ERROR, + "connect_fd failed %s", spa_strerror(res)); + return res; +@@ -462,7 +462,7 @@ int pw_remote_disconnect(struct pw_remote *remote) + pw_proxy_destroy(proxy); + remote->core_proxy = NULL; + +- pw_protocol_client_disconnect (remote->conn); ++ pw_protocol_client_disconnect(remote->conn); + + pw_map_clear(&remote->objects); + pw_map_clear(&remote->types); +diff --git a/src/pipewire/remote.h b/src/pipewire/remote.h +index df0c496c..2974a04a 100644 +--- a/src/pipewire/remote.h ++++ b/src/pipewire/remote.h +@@ -177,7 +177,8 @@ void pw_remote_add_listener(struct pw_remote *remote, + int pw_remote_connect(struct pw_remote *remote); + + /** Connect to a remote PipeWire on the given socket \memberof pw_remote +- * \param fd the connected socket to use ++ * \param fd the connected socket to use, the socket will not be closed ++ * automatically on disconnect or error. + * \return 0 on success, < 0 on error */ + int pw_remote_connect_fd(struct pw_remote *remote, int fd); + diff --git a/media-video/pipewire/files/pipewire-0.2.6-revert-combine-all-perms.patch b/media-video/pipewire/files/pipewire-0.2.6-revert-combine-all-perms.patch new file mode 100644 index 000000000000..57ada7d5fb47 --- /dev/null +++ b/media-video/pipewire/files/pipewire-0.2.6-revert-combine-all-perms.patch @@ -0,0 +1,34 @@ +From 4350bd624f165de81de10293a8ec5a59e8b7ce64 Mon Sep 17 00:00:00 2001 +From: Wim Taymans <wtaymans@redhat.com> +Date: Fri, 28 Jun 2019 12:22:33 +0200 +Subject: [PATCH] Revert "global: combine all permissions of the object tree" + +This reverts commit 83bc033837f7525d898f1de91119f669f9bf97f5. + +This needs some more work. +--- + src/pipewire/global.c | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/src/pipewire/global.c b/src/pipewire/global.c +index c963965e..00258ff8 100644 +--- a/src/pipewire/global.c ++++ b/src/pipewire/global.c +@@ -38,15 +38,9 @@ uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *c + { + uint32_t perms = PW_PERM_RWX; + +- if (client->permission_func == NULL) +- return perms; +- +- perms = client->permission_func(global, client, client->permission_data); +- +- while (global != global->parent) { +- global = global->parent; ++ if (client->permission_func != NULL) + perms &= client->permission_func(global, client, client->permission_data); +- } ++ + return perms; + } + diff --git a/media-video/pipewire/metadata.xml b/media-video/pipewire/metadata.xml new file mode 100644 index 000000000000..a5d6bb1343ab --- /dev/null +++ b/media-video/pipewire/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>gnome@gentoo.org</email> + <name>Gentoo GNOME Desktop</name> + </maintainer> + <maintainer type="person"> + <email>asturm@gentoo.org</email> + <name>Andreas Sturmlechner</name> + </maintainer> + <upstream> + <remote-id type="github">PipeWire/pipewire</remote-id> + </upstream> +</pkgmetadata> diff --git a/media-video/pipewire/pipewire-0.2.6.ebuild b/media-video/pipewire/pipewire-0.2.6.ebuild new file mode 100644 index 000000000000..53944bcd82fd --- /dev/null +++ b/media-video/pipewire/pipewire-0.2.6.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit meson + +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="https://github.com/PipeWire/pipewire.git" + inherit git-r3 +else + SRC_URI="https://github.com/PipeWire/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi + +DESCRIPTION="Multimedia processing graphs" +HOMEPAGE="https://pipewire.org/" + +LICENSE="LGPL-2.1" +SLOT="0" +IUSE="bluetooth doc ffmpeg libav gstreamer sdl systemd vaapi X" + +BDEPEND=" + app-doc/xmltoman + doc? ( + app-doc/doxygen + media-gfx/graphviz + ) +" +DEPEND=" + media-libs/alsa-lib + sys-apps/dbus + virtual/libudev + bluetooth? ( media-libs/sbc ) + ffmpeg? ( + !libav? ( media-video/ffmpeg:= ) + libav? ( media-video/libav:= ) + ) + gstreamer? ( + media-libs/gstreamer:1.0 + media-libs/gst-plugins-base:1.0 + ) + sdl? ( media-libs/libsdl2 ) + systemd? ( sys-apps/systemd ) + vaapi? ( x11-libs/libva ) + X? ( x11-libs/libX11 ) +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-alsa-lib-1.1.9.patch + "${FILESDIR}"/${P}-reuse-fd-in-pipewiresrc.patch + "${FILESDIR}"/${P}-fix-probing-without-starting.patch + "${FILESDIR}"/${P}-revert-combine-all-perms.patch +) + +src_prepare() { + spa_use() { + if ! use ${1}; then + sed -e "/.*dependency.*'${2-$1}'/s/'${2-$1}'/'${2-$1}-disabled-by-USE-no-${1}'/" \ + -i spa/meson.build || die + fi + } + + default + spa_use bluetooth sbc + spa_use ffmpeg libavcodec + spa_use ffmpeg libavformat + spa_use ffmpeg libavfilter + spa_use vaapi libva + spa_use sdl sdl2 + spa_use X x11 +} + +src_configure() { + local emesonargs=( + -Dman=true + $(meson_use doc docs) + $(meson_feature gstreamer) + $(meson_use systemd) + ) + meson_src_configure +} + +pkg_postinst() { + elog "Package has optional sys-auth/rtkit RUNTIME support that may be" + elog "disabled by setting DISABLE_RTKIT env var." +} |