summaryrefslogtreecommitdiff
path: root/media-video
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-01-17 06:41:55 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-01-17 06:41:55 +0000
commit6d730aa8064fbab6cc54447b6ed0e60b99c13256 (patch)
tree8c303cb48dc49dd218b79708ca71904653c5f831 /media-video
parentcb2f73d10494730ba590096a1f24ebc6d0d61a9f (diff)
gentoo auto-resync : 17:01:2025 - 06:41:55
Diffstat (limited to 'media-video')
-rw-r--r--media-video/Manifest.gzbin23215 -> 23221 bytes
-rw-r--r--media-video/ffmpeg-chromium/Manifest2
-rw-r--r--media-video/ffmpeg-chromium/ffmpeg-chromium-132.ebuild4
-rw-r--r--media-video/mkvtoolnix/Manifest2
-rw-r--r--media-video/mkvtoolnix/mkvtoolnix-88.0.ebuild2
-rw-r--r--media-video/obs-studio/Manifest2
-rw-r--r--media-video/obs-studio/obs-studio-9999.ebuild14
-rw-r--r--media-video/pipewire/Manifest11
-rw-r--r--media-video/pipewire/files/1.2.7/0001-spa-alsa-Fix-key-name-suggestion-in-log-message.patch28
-rw-r--r--media-video/pipewire/files/1.2.7/0002-spa-alsa-Don-t-assume-all-PCMs-have-a-card.patch128
-rw-r--r--media-video/pipewire/files/1.2.7/0003-gst-mark-the-pipewiresink-as-EARLY_PROCESS.patch29
-rw-r--r--media-video/pipewire/files/1.2.7/0004-gst-add-rate-control-to-the-sink.patch234
-rw-r--r--media-video/pipewire/files/1.2.7/0005-gst-add-slave-method-property.patch259
-rw-r--r--media-video/pipewire/files/1.2.7/0006-spa-fix-some-param-type-info.patch51
-rw-r--r--media-video/pipewire/files/1.2.7/0007-filter-chain-handle-0-length-IR.patch305
-rw-r--r--media-video/pipewire/files/1.2.7/0008-spa-initialize-all-fields-explicitly.patch47
-rw-r--r--media-video/pipewire/pipewire-1.2.7-r1.ebuild527
-rw-r--r--media-video/pipewire/pipewire-1.2.7.ebuild2
18 files changed, 1635 insertions, 12 deletions
diff --git a/media-video/Manifest.gz b/media-video/Manifest.gz
index e5dc03996e19..0c86b6c3f1ae 100644
--- a/media-video/Manifest.gz
+++ b/media-video/Manifest.gz
Binary files differ
diff --git a/media-video/ffmpeg-chromium/Manifest b/media-video/ffmpeg-chromium/Manifest
index daa1e9d745f1..4fed44c28efe 100644
--- a/media-video/ffmpeg-chromium/Manifest
+++ b/media-video/ffmpeg-chromium/Manifest
@@ -16,6 +16,6 @@ EBUILD ffmpeg-chromium-128.ebuild 6479 BLAKE2B 9b7d9a1d995d0a925979ba122a51821d9
EBUILD ffmpeg-chromium-129.ebuild 6479 BLAKE2B 291953066345a7e3018ba56e1cd7ebb12c5f14220c19030b78197381764fb5fe5ff48fad423786ef0dbd335ba917886ab2d71765ef7cae43eed324a0cd08eb88 SHA512 e59e8ec78bcdd939b100ba681488d3c212539ee79a441be0dd6d894689b8a37b2b0e7fbf6d18a9cbf3673daec0be9055dc455c1b0d38fb5afb34594319e63206
EBUILD ffmpeg-chromium-130.ebuild 6479 BLAKE2B 1f58dc1d9b2dcafc3376f6d5048257e35d6bd8b0a0e1eb282de9ea0f710a4500cef8f17653dd41b2e099d02ec5674e01b08bb06ab96e7ef941dcb1254880d80f SHA512 5a7388287e60aed2a0542343805ca1a49a887d97bb9d6e4b2a4d1730a1898c4b953106479a12444ac856099ac7376e22df5484366a0246e86910284c6d3b55a6
EBUILD ffmpeg-chromium-131.ebuild 6479 BLAKE2B 7eb290e9d70180370f3cf2cd0ed93ecdfea60e08df4586730533709650dccd461b43f5f1f2fdc69aa751894d3aefd550ea47fb0aa03adf3c123c1896f167eff6 SHA512 d978f8a08f1f67db72cf6b9af488b71fa57752ef94b40adc42dbddf8cfbb57b2c7654cb09fcc524cf8b533dc6f8580eccdc75cbb236a46e1f1d2737e4d75f92c
-EBUILD ffmpeg-chromium-132.ebuild 6454 BLAKE2B c5593622c2c275f72d7bea6cf1636fb284e6993f93f178ce662a40db66f9a8b11f4bfee2a5b65ff8265e84614f263177027db45c8bce30c31a6b5a9fc5bdf863 SHA512 082e172e83a2b30cbdfbd27d95abc79879b7143128b84b59c9a4ffe16cff343a164049bbd8568651658f48c9d9d189e5c4495edc17be69ea79b87f305c7dd21a
+EBUILD ffmpeg-chromium-132.ebuild 6452 BLAKE2B a743e4c5d771088ee19cc996ebf5743bc7e828bfca4cbff9928840a57b3658ce3bfd9fca5352c391843989b649c4d5961f1eb64c394ca543ef8e72eef3455c97 SHA512 fdd9cff14fb47a28cf5391508da080298447f049b1282651357c9faa4e3b7824c101df0af48c4221b6219e5c5e567db18992448c9e9c3a19c5c23ad2c6304357
EBUILD ffmpeg-chromium-133.ebuild 6454 BLAKE2B c5593622c2c275f72d7bea6cf1636fb284e6993f93f178ce662a40db66f9a8b11f4bfee2a5b65ff8265e84614f263177027db45c8bce30c31a6b5a9fc5bdf863 SHA512 082e172e83a2b30cbdfbd27d95abc79879b7143128b84b59c9a4ffe16cff343a164049bbd8568651658f48c9d9d189e5c4495edc17be69ea79b87f305c7dd21a
MISC metadata.xml 695 BLAKE2B 84fa4967572665812d4da8bb1a86a8b28a749892570cb1fca5c0515f860fbe8c472a91240f1d3b7b3109ccdbd32cf8da941c438cd9f332b763f2824e0e193ac8 SHA512 0069bcf32d2aa083c66e13579295e8ef96b9ac72b02f1436620000c71c4d1e335391838f9a9e56f7768bd13dbe13ce6f3f3674a303cf90cc658360825867c3f9
diff --git a/media-video/ffmpeg-chromium/ffmpeg-chromium-132.ebuild b/media-video/ffmpeg-chromium/ffmpeg-chromium-132.ebuild
index 649b2d94ea08..cfbddc764afd 100644
--- a/media-video/ffmpeg-chromium/ffmpeg-chromium-132.ebuild
+++ b/media-video/ffmpeg-chromium/ffmpeg-chromium-132.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -16,7 +16,7 @@ LICENSE="
"
SLOT="${PV}"
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64"
+KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64"
# Options to use as use_enable in the foo[:bar] form.
# This will feed configure with $(use_enable foo bar)
diff --git a/media-video/mkvtoolnix/Manifest b/media-video/mkvtoolnix/Manifest
index 395f36211bb1..4860e97c68fb 100644
--- a/media-video/mkvtoolnix/Manifest
+++ b/media-video/mkvtoolnix/Manifest
@@ -8,6 +8,6 @@ DIST mkvtoolnix-88.0.tar.xz 11241552 BLAKE2B 01edcfe995e75fa7cde1916eb37a5f75d97
DIST mkvtoolnix-88.0.tar.xz.sig 833 BLAKE2B b0acd58dbc4c937ec50477e2695c4df1e67d6b40e985d676be38eaaff513a4eed17b19c612892c39c613e3736f516074febd12f76087ade3078d1183b0a3bce1 SHA512 f8175019b12f5a7bf36cc69f806d3dfc18431945f50bd1c4be5e5c1422ea9e53ca8ca93a08a417cae97da163b622ed09e7490a80255fccece6a5cbd32efbfe96
EBUILD mkvtoolnix-83.0-r1.ebuild 3232 BLAKE2B f260b944cba90951c0db5b83bacb2ebbbd3f466dd14f0e4ba69460430783c334d232ec80c19aacb2dc926f4f1271966ee7444ad5d74d03ab77fbc729ebb65139 SHA512 3620d4f073e157e60e6f67b4f9fff494295cf7bb4df6b7140135902ed1d000fe6a4f712f10132f64adecc23673097f4e21a1ea83c522ee9e462b84575deee284
EBUILD mkvtoolnix-86.0.ebuild 3182 BLAKE2B a081872ad23073066638aebc67ceac238e2200f7e6ebd431706b3dd21f1b3424ba8d361353a5550bf94d0ba696be8e973bfddf98caf57724c137f75c5f48e6e6 SHA512 97f41c0614f8e2cf9e95eaf750671ca913415a6ee88965cad4c7fc3e0dc15fbcfb22bdf756227a171747710ad81f36f84d98228c081fb1a359baef0794836463
-EBUILD mkvtoolnix-88.0.ebuild 3121 BLAKE2B 85cad1152e3e2c2fc379a50f76aed0cf30c51c2c488e69d05c6a8b1bebf06d4c540884dbcadb112aabab5e58c712c2ea1ed5a7db96784ca457cec82c4cb03013 SHA512 cb6b467e50d685ad08374761e140b56ee6f4ddcb93529e7bb36f7081b688dd42dfd5aacb590eec251a9b1537ad40b8d81fbf629164772e509f30d00168bca936
+EBUILD mkvtoolnix-88.0.ebuild 3120 BLAKE2B fdf0be85c372e14b5c33062003fe794545db690780bfecd2fce699e56301ac9ff0875d5f4fe5319cdf018fd5a7566bc769708249bd887a36430290443105dd5e SHA512 b315d0c1fd8c08dbc45c11a932c1585fd8b139d35541793f4ee864fa20a375cd8996d0295978cc33d5e3c5a7e70e27356a79edb4fa9eedaf17c853e44bd0225e
EBUILD mkvtoolnix-9999.ebuild 3122 BLAKE2B 08bd971c6a8eac6d5c328e864692176097b8c10fe00da64d2985626b2fa5eab4dc239f7042ebe152a8c566e047b217924935e2ec0d31a8ac3f6fe60beacd0649 SHA512 3adf6b36985c95a0112274021bb80419ac51a652aa6a6004e46357488bf34e3367849bc35e7ead16e78012b36632d4cfc6aaa0daff7456451628cc72f04fa68c
MISC metadata.xml 343 BLAKE2B b13d9c252a7ad2f27c772c43d3476eee87d9a173c8fcc04a3be28ca9cfb826e6f1de6eade1211b4ff5f4a379b20a0961667fc99eee91495589e0632ad94b4c0a SHA512 cb7fd77f65779de841da03890fd1d0031cea8a95153f116f01f1be7d8ef5b87bb760933fc74f64a1d49ce94bc897cde94fdd4f6b45c016c3c20b842097692dc0
diff --git a/media-video/mkvtoolnix/mkvtoolnix-88.0.ebuild b/media-video/mkvtoolnix/mkvtoolnix-88.0.ebuild
index 5d290960fe07..11168efe0a43 100644
--- a/media-video/mkvtoolnix/mkvtoolnix-88.0.ebuild
+++ b/media-video/mkvtoolnix/mkvtoolnix-88.0.ebuild
@@ -17,7 +17,7 @@ else
https://mkvtoolnix.download/sources/${P}.tar.xz
verify-sig? ( https://mkvtoolnix.download/sources/${P}.tar.xz.sig )
"
- KEYWORDS="~amd64 ~ppc ppc64 ~x86"
+ KEYWORDS="amd64 ~ppc ppc64 ~x86"
VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/mkvtoolnix.asc"
fi
diff --git a/media-video/obs-studio/Manifest b/media-video/obs-studio/Manifest
index 0416be273f50..ef7b7e525420 100644
--- a/media-video/obs-studio/Manifest
+++ b/media-video/obs-studio/Manifest
@@ -10,5 +10,5 @@ DIST obs-websocket-0548c7798a323fe5296c150e13b898a5ee62fc1e.tar.gz 250611 BLAKE2
DIST obs-websocket-eed8a49933786383d11f4868a4e5604a9ee303c6.tar.gz 250566 BLAKE2B 138041a2bdd5d7eb6b5c2636c17fe6ae8a30986ec55548556ce4a1762b2bcc3fee6e039840220d9d60d3314527647334bf7a408dc63e0ab3f0cc45f0e0e65a47 SHA512 21ff4a58465bcb8917f2e213b430dbcbfd56a1647e80c351f18479d7dd3ff2b4c64292132ca26b40054f2b994db9dd8d0a2cb97f32498cb5d59f2812272a6ec5
EBUILD obs-studio-30.2.3-r1.ebuild 6867 BLAKE2B a7c337e57b14866d9939ecb12a66da289184fb686121593a4be35c5d24672a4e1b57e0858e9bb74d9ab6b3dd9095894ffecb830c9070ec7ad6ceb28cfa9db56c SHA512 0f9f310475c45042517bedcca8269373f5cdcaa0fec83a927c6b45b01db536c0e1b63e1c14579747511c47fd3247f375e674e1296f4481f880125bc3f0f3047b
EBUILD obs-studio-31.0.0-r3.ebuild 6850 BLAKE2B e99f19fe1b1bf3ceeff2de30bcbcee8565196c7ddd961bfd50090b593b1e86a434393b1806503d3edd92b977c5a454fd6bb42dec76ddceadaacb0e912487a179 SHA512 fc02fabcf74a51ed78be9829cf15f475df9022af86786577fc3138396b589d480e9afeef7791a802761e746601bc0b21bc6868ab2ec7a3ac89521b4bd01eaf2b
-EBUILD obs-studio-9999.ebuild 6802 BLAKE2B 1e7598abdf1197e9c65c191a53d07fc9f9416ae46def24b39acb86a5ea9b73e93d30bbe23716712c86d94446b77b41b846e9613c48779bb9da3c4f9c0d4e91db SHA512 6d8c366af91dd7817cfd00a753a9bffa3db8bd82c89db7217d1d2755cbfbf4e8b6dddf695ad30fb8fe346080a51750e30381a18cd4861a3d54651845bfdafa21
+EBUILD obs-studio-9999.ebuild 6830 BLAKE2B 4bbd83fbece645b01fd994240ab8288f651a9641cc9e951d109708fc64c0703ce327b4780add3577830eec8f3de04fda46fabefc3c4c7e6e3afc87a8e19cb8f4 SHA512 5b9c9fdad85afcf551acc765554521c4908630fe12895ad1dfd6f64c497e02cc36a813a8b0fa39e48bae5ef63705bb696183e399fdca207c5acb655d326dd4b7
MISC metadata.xml 1533 BLAKE2B 7bc778d152d6854330f821d0712da81b54397a35118baf4ba61b3ce4eb7aff5a292d4e4c74c01992761c3cae15b367dcf85450080e920d35ffeb2ee06c74483b SHA512 3dbc5096e3203ec8350e75db78519a061270d52d441e159ab297147a729bda21016a26e15b5c0447dc4a835da59ee822da99265e4f8c3bea3a1e173b134c739c
diff --git a/media-video/obs-studio/obs-studio-9999.ebuild b/media-video/obs-studio/obs-studio-9999.ebuild
index f190a7c6135c..b215ca637d54 100644
--- a/media-video/obs-studio/obs-studio-9999.ebuild
+++ b/media-video/obs-studio/obs-studio-9999.ebuild
@@ -141,8 +141,14 @@ DEPEND="
dev-libs/qr-code-generator
)
"
-RDEPEND="${DEPEND}
- qsv? ( media-libs/intel-mediasdk )
+RDEPEND="
+ ${DEPEND}
+ qsv? (
+ || (
+ media-libs/intel-mediasdk
+ media-libs/vpl-gpu-rt
+ )
+ )
"
QA_PREBUILT="
@@ -249,8 +255,8 @@ src_install() {
cmake_src_install
# external plugins may need some things not installed by default, install them here
- insinto /usr/include/obs/UI/obs-frontend-api
- doins UI/obs-frontend-api/obs-frontend-api.h
+ insinto /usr/include/obs/frontend/api
+ doins frontend/api/obs-frontend-api.h
}
pkg_postinst() {
diff --git a/media-video/pipewire/Manifest b/media-video/pipewire/Manifest
index b692847e2a1b..2c46249d5c6d 100644
--- a/media-video/pipewire/Manifest
+++ b/media-video/pipewire/Manifest
@@ -1,3 +1,11 @@
+AUX 1.2.7/0001-spa-alsa-Fix-key-name-suggestion-in-log-message.patch 1037 BLAKE2B 61f718d04de6e9a2239480933e6d0bee747862090963e6860ac3b99902931fb733eb336efb9c9cafa20132c5e1858b5310fcf863d83eb1a0fb0be86dead5f4d7 SHA512 3457542d03fed9cc0e9f7d72b9876201fcfd1d127289f532d04ce0d5d2c970c9275fe97228ea81e253d30fac19b4762133353df2a8d27beea3f22826d6214a55
+AUX 1.2.7/0002-spa-alsa-Don-t-assume-all-PCMs-have-a-card.patch 4675 BLAKE2B 2ef4a024cf0f457e1e1a24cd5addeba5ce597bd73bb3ce4e917a82bc250cce718a7e5501992541c83a0be5ad10361b959f2f9df3b24605125bb4629a26353db7 SHA512 44420aff1700535582f6e6d2a27df6c4909deb509e03a2ba003cbaa42906d88ba5e751a5741441f76911527012438f8e3c897a88b5740592fc913962f0c010e8
+AUX 1.2.7/0003-gst-mark-the-pipewiresink-as-EARLY_PROCESS.patch 1139 BLAKE2B bf4b148aaa7f97a6baf0f730740b852635510f714391641f31b6bbfdb2a03bb79437cdd57c0b0a6f3bb6733181be4c7b724d961ad01a297ee124a5ab0e9eacca SHA512 5bdff0ca4868fabab09144cce9577bf631d6ddd8879257167fc9860c3ee92cc3211c797b2cd53f6dbb17553c570773445545009c78489f8174e2d16c668e569a
+AUX 1.2.7/0004-gst-add-rate-control-to-the-sink.patch 7549 BLAKE2B e278a6f0c298e40903753ec1c1c05a77680ffcf1ecb027b15fbbcb53533227446e2fac11f95724c0e6df95bfa08b7a77c6d68582d3737d81bee743089b2ccef3 SHA512 425b13f167334076a6f053f804c9aafd22fb9362e9990376236d5896fd24e432b76b9c4b9dadfd22c5df62f01c336b4e14bbe582643b8d50caceb4f973c1890e
+AUX 1.2.7/0005-gst-add-slave-method-property.patch 8627 BLAKE2B eb75ab858fda648a2aa23054a512ed4ba160bd1fe38c7512375ad50659ed50c01e81b6e8c3d34d41f2f62b061126ca524d69c7fed925e11735111ae4de23cc51 SHA512 637aae5164851d7ef5ad54a09b372f80b9b28a21866636c19fde5124cb2052d0f14285cf9ed6ac9dc6df9de59f037a9eca3fdf7c083b860bbbf0a7b0f4ece1d9
+AUX 1.2.7/0006-spa-fix-some-param-type-info.patch 2681 BLAKE2B 5e838cd145241a3fed0f00294f9beb537eea10f01b3e1ede6afe5e6695b79ed045e82453ca03e24a63b87e1397ef8f5270a046c3adeda94a62a062981bb8ed3f SHA512 185dcbb63b40c69cd61ab15e32e6476a25a2992da72704fefd66fd563eb48b2441e1282a7e6ce7cfec5fa18d866ef62ac506f69a3d0e477eb2108fb654600715
+AUX 1.2.7/0007-filter-chain-handle-0-length-IR.patch 12253 BLAKE2B f7e54d3ff5786752b3e3f2cb5d3544e22920c08c765d07e0488515ad4b37232efc000ca5c04949e021e62b3f6866a3880a86cad77bc1c6be867e8876afd98ca7 SHA512 a3c2031c62f0df218be4d573162bb45f50b81da27e37a111946c2310785beb2446d837e0816434404b2e05ba0b0c2c3f72d40e15b34f8b821d709d4eab3fbe85
+AUX 1.2.7/0008-spa-initialize-all-fields-explicitly.patch 1898 BLAKE2B 96dc79e4b3f48c58b5e5fda7ca4b90fc9686fb4c8f48a31e76723090d98e8e23b659d60cffc271ea3cb4c4710ceb3cdfb1c30935ef4c6a45986c9c8f63ac0e32 SHA512 21d593e6165a969fb21412de4dd0f0b5255f240244e789a3606d610976ff01bdb4e1d8879f698a2751a449b7e64f258dcf8f0565cf0b9401a8fc12f94f596c5a
AUX 99-pipewire-default-hook.conf 540 BLAKE2B cec76e78db9db290054bf766774c284d7a7a1374c453802eb1bdc19db9289856ec7b8643acbab916a39ca859d543deca111e3b0f110d1904343221c1573ffc17 SHA512 ef891e38c6f40fce2904e240307147a58c48d780e8470dac8e28044cfb86ddeb163885a2362687791779379ad814f58ad5649b75ac4e82931c5bdd3f37a6ed01
AUX gentoo-pipewire-launcher.1 1633 BLAKE2B 36c8888693bd0389dc9b1e49d0501d2679956d88f6b7ac42f0347c3fe2259775dd7082cb0bbdeb54a232fcc8902faa8086203e0fe2437c0eea5f1927ba2d0de4 SHA512 8085c9a989f21ee7f2528d56d5b104c0d14024df06f5cb6cd2aa8168b58469c71b91c788706b11021d9dbddb647a2203175603f4f8aa7b33a63a7b7cf8b59d1f
AUX gentoo-pipewire-launcher.in-r3 2848 BLAKE2B 5e6b8ca2df88cef240ca1ff4de28cc8ed3590fabd29b903b37880baf9cf52c35ca01be25b031898d4ee06f4600a5f0c61025a244778577a562f4a4bfa14e2aca SHA512 43cf3e07058e86bf6651106f7f192022c05c5640ba8e101b88e98a83efcc5614f9474107b6d0daf3d5234a51ebcc0a3a7ae5b359d9ba36b648c125813f4e1334
@@ -8,6 +16,7 @@ DIST pipewire-1.2.0-docs.tar.xz 58528 BLAKE2B b7abdfecd46239050ab80695c8f3d1a4e6
DIST pipewire-1.2.6.tar.bz2 1818268 BLAKE2B 8b70af60a77436ed14119d0e57eef663b98e7e18841b61302b76e31befabaf9a63b4d01b9d5d3d582f598adb1d92f9c5e3aa3fdc9bec26f6aa1d0916fbdc6cf9 SHA512 6bb2e0a89fbbb1fc23cad18c2f34cf539a8414626a80174512833545a28493f9aaad96db8db8715dcf2f036cbd5133680d01188a38f58a8bd01af8deb4c343e0
DIST pipewire-1.2.7.tar.bz2 1823442 BLAKE2B e81a897d4ee23e0048a8b7fbac8b397f74b8f68add71e228e9bbfffffda1a71d0dc7ebbb3a4878fab27c57ec392840fed2fdf9e677c313ea0c0cab3166d6f2d3 SHA512 f353761e612f5703fe2a55000af958c663f0648331242297f9c18d5ab6cadc5468e92b663bf811c37c4736e6564aa4e2466903593c4d621ea0686a966e30d63d
EBUILD pipewire-1.2.6.ebuild 19871 BLAKE2B dfae536c24cf9a489a08b33b08298027cbb31e90b0e06d59d1045e2b2406c6a23152a36de5abc0d90f0f9bb76d5e9f2f38e05e21dea751b6c3cb925cd347b628 SHA512 696652eee3c8ab6227f44160f29e163250368c883843c9e62188f88d1843c189ffa09efe573af3f96c046a3b089077756e4b89ce08e7588d005f10e9d586a362
-EBUILD pipewire-1.2.7.ebuild 19871 BLAKE2B 8288e9263f0397d16550004f9af73fa2b77290e7ddfc42e955560eb669270214c89af551ef87724d3b45318462acaadf549a62a6483eb978ab547208709948b5 SHA512 353eb77858fbbc63f64a5ffcb1426786577d5b241b1d1a0b86966016a9ea327a0fc961145e12d1cfc5144b31e6e77eae2425b4aff75ab4ba993cc573394c5c84
+EBUILD pipewire-1.2.7-r1.ebuild 19877 BLAKE2B dd3794d4d7eb4cb20156ea2c2827360ef378f06b52e91e3a78128c17a1f4d80642887be9f3b4f55de5ee9633173abfca9e8356d3e5a4615a08c3cda52fb93bc6 SHA512 eef8f4fe96534380d2b53b055882c2ebfef2c1935f5be0e38367bacd1eea59a88d65d227ba6deb9c1e8487cc9bcbd0631ebc77ad4fea79483505b33ce827d0fb
+EBUILD pipewire-1.2.7.ebuild 19872 BLAKE2B 8315b853895fb553d4ea0cb64a77f5c5712ddc1f08c0000305553c15a5f520eb60c6c073a2fe72970eb42779ba215e86b21f53d28e94ca4ef428b7eb9735a4ec SHA512 c0368d6fd4d359ccec15016f9fc13a0fea9d284860189babeee688f0a4170f4cd304c7c173b09a827b443ac6c3c3effcbdc142bb4e01961985c6e232f2d2f1fc
EBUILD pipewire-9999.ebuild 19866 BLAKE2B e178f8dc8254d7d77191e71b7a13d2d6225586c65f25fd969dfff45a40d7ed1f2c8b0139a13b3e4691c2acaa24e07f89d152cf5061e64c4b3c8ba356ff3da36f SHA512 ccdf5dfbafedac96b7c248a186249cbd0e19dc85d16431f54d98894f890b05d9bfdc4cf5cf7dd27911898fefbe94e39e3943ac3d842689724024c7e9ec196d43
MISC metadata.xml 2156 BLAKE2B 974459115e0f3cf4e4c3ac15159740b42e01a093da37d8a27f80e122c9ab2a3fe9194443eaf08f9b66d613db90a14465abbe1b76816bce90e11a46c8409c7513 SHA512 cfe0fdb86c993f167507e22635878d6d7d5dcd48f4c23323231263551ceff986fc454700428ecb7d2ee2abe82093c35d8e7bd491020fd6dd3f3889c09e9020bb
diff --git a/media-video/pipewire/files/1.2.7/0001-spa-alsa-Fix-key-name-suggestion-in-log-message.patch b/media-video/pipewire/files/1.2.7/0001-spa-alsa-Fix-key-name-suggestion-in-log-message.patch
new file mode 100644
index 000000000000..a9348553e15b
--- /dev/null
+++ b/media-video/pipewire/files/1.2.7/0001-spa-alsa-Fix-key-name-suggestion-in-log-message.patch
@@ -0,0 +1,28 @@
+From 1993383ddf67e296334c7916d6afc699ee6300c7 Mon Sep 17 00:00:00 2001
+Message-ID: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+From: Arun Raghavan <arun@asymptotic.io>
+Date: Fri, 29 Nov 2024 10:54:18 -0500
+Subject: [PATCH 1/8] spa: alsa: Fix key name suggestion in log message
+
+We use api.alsa.pcm.card to look up the PCM's card if we don't know it
+by other means.
+---
+ spa/plugins/alsa/alsa-pcm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c
+index b07897935..9244b66aa 100644
+--- a/spa/plugins/alsa/alsa-pcm.c
++++ b/spa/plugins/alsa/alsa-pcm.c
+@@ -939,7 +939,7 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
+ sscanf(state->props.device, "%*[^:]:%u", &state->card_index);
+ if (state->card_index == SPA_ID_INVALID) {
+ spa_log_error(state->log, "Could not determine card index, maybe set %s",
+- SPA_KEY_API_ALSA_CARD);
++ SPA_KEY_API_ALSA_PCM_CARD);
+ return -EINVAL;
+ }
+ }
+--
+2.48.0
+
diff --git a/media-video/pipewire/files/1.2.7/0002-spa-alsa-Don-t-assume-all-PCMs-have-a-card.patch b/media-video/pipewire/files/1.2.7/0002-spa-alsa-Don-t-assume-all-PCMs-have-a-card.patch
new file mode 100644
index 000000000000..efb13f667b9a
--- /dev/null
+++ b/media-video/pipewire/files/1.2.7/0002-spa-alsa-Don-t-assume-all-PCMs-have-a-card.patch
@@ -0,0 +1,128 @@
+From a6019e6dd73e686c69db5967fc3e852a8fe43ecb Mon Sep 17 00:00:00 2001
+Message-ID: <a6019e6dd73e686c69db5967fc3e852a8fe43ecb.1737052666.git.sam@gentoo.org>
+In-Reply-To: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+References: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+From: Arun Raghavan <arun@asymptotic.io>
+Date: Fri, 29 Nov 2024 10:42:58 -0500
+Subject: [PATCH 2/8] spa: alsa: Don't assume all PCMs have a card
+
+dmix/dsnoop devices, for example, don't have an associated card, so all
+the card-related checks don't make sense. Let's explicitly deal with
+this case.
+
+Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4432
+---
+ spa/plugins/alsa/alsa-pcm.c | 31 +++++++++++++++++--------------
+ 1 file changed, 17 insertions(+), 14 deletions(-)
+
+diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c
+index 9244b66aa..b8728bfe1 100644
+--- a/spa/plugins/alsa/alsa-pcm.c
++++ b/spa/plugins/alsa/alsa-pcm.c
+@@ -40,6 +40,9 @@ static struct card *ensure_card(uint32_t index, bool ucm)
+ const char *alibpref = NULL;
+ int err;
+
++ if (index == SPA_ID_INVALID)
++ return NULL;
++
+ if ((c = find_card(index)) != NULL)
+ return c;
+
+@@ -78,6 +81,9 @@ error:
+
+ static void release_card(struct card *c)
+ {
++ if (!c)
++ return;
++
+ spa_assert(c->ref > 0);
+
+ if (--c->ref > 0)
+@@ -657,7 +663,7 @@ static void silence_error_handler(const char *file, int line,
+ static void fill_device_name(struct state *state, const char *params, char device_name[], size_t len)
+ {
+ spa_scnprintf(device_name, len, "%s%s%s",
+- state->card->ucm_prefix ? state->card->ucm_prefix : "",
++ state->card && state->card->ucm_prefix ? state->card->ucm_prefix : "",
+ state->props.device, params ? params : "");
+ }
+
+@@ -938,13 +944,12 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
+ /* If we don't have a card index, see if we have a *:<idx> string */
+ sscanf(state->props.device, "%*[^:]:%u", &state->card_index);
+ if (state->card_index == SPA_ID_INVALID) {
+- spa_log_error(state->log, "Could not determine card index, maybe set %s",
+- SPA_KEY_API_ALSA_PCM_CARD);
+- return -EINVAL;
++ spa_log_info(state->log, "Could not determine card index. %s and/or clock.name "
++ "may need to be configured manually", SPA_KEY_API_ALSA_PCM_CARD);
+ }
+ }
+
+- if (state->clock_name[0] == '\0')
++ if (state->clock_name[0] == '\0' && state->card_index != SPA_ID_INVALID)
+ snprintf(state->clock_name, sizeof(state->clock_name),
+ "api.alsa.%s-%u",
+ state->stream == SND_PCM_STREAM_PLAYBACK ? "p" : "c",
+@@ -957,10 +962,7 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
+ }
+
+ state->card = ensure_card(state->card_index, state->open_ucm);
+- if (state->card == NULL) {
+- spa_log_error(state->log, "can't create card %u", state->card_index);
+- return -errno;
+- }
++
+ state->log_file = fopencookie(state, "w", io_funcs);
+ if (state->log_file == NULL) {
+ spa_log_error(state->log, "can't create log file");
+@@ -1203,7 +1205,7 @@ int spa_alsa_close(struct state *state)
+ else
+ state->n_fds = 0;
+
+- if (state->have_format)
++ if (state->have_format && state->card)
+ state->card->format_ref--;
+
+ state->have_format = false;
+@@ -1423,7 +1425,7 @@ static int add_rate(struct state *state, uint32_t scale, uint32_t interleave, bo
+ if (max < min)
+ return 0;
+
+- if (!state->multi_rate && state->card->format_ref > 0)
++ if (!state->multi_rate && state->card && state->card->format_ref > 0)
+ rate = state->card->rate;
+ else
+ rate = state->default_rate;
+@@ -1439,8 +1441,8 @@ static int add_rate(struct state *state, uint32_t scale, uint32_t interleave, bo
+
+ rate = SPA_CLAMP(rate, min, max);
+
+- spa_log_debug(state->log, "rate:%u multi:%d card:%d def:%d",
+- rate, state->multi_rate, state->card->rate, state->default_rate);
++ spa_log_debug(state->log, "rate:%u multi:%d card:%u def:%d",
++ rate, state->multi_rate, state->card ? state->card->rate : 0, state->default_rate);
+
+ spa_pod_builder_prop(b, SPA_FORMAT_AUDIO_rate, 0);
+
+@@ -2172,6 +2174,7 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
+ }
+
+ if (!state->multi_rate &&
++ state->card &&
+ state->card->format_ref > 0 &&
+ state->card->rate != rrate) {
+ spa_log_error(state->log, "%p: card already opened at rate:%i",
+@@ -2217,7 +2220,7 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
+ state->driver_rate.denom = 0;
+
+ state->have_format = true;
+- if (state->card->format_ref++ == 0)
++ if (state->card && state->card->format_ref++ == 0)
+ state->card->rate = rrate;
+
+ dir = 0;
+--
+2.48.0
+
diff --git a/media-video/pipewire/files/1.2.7/0003-gst-mark-the-pipewiresink-as-EARLY_PROCESS.patch b/media-video/pipewire/files/1.2.7/0003-gst-mark-the-pipewiresink-as-EARLY_PROCESS.patch
new file mode 100644
index 000000000000..54f020f9379e
--- /dev/null
+++ b/media-video/pipewire/files/1.2.7/0003-gst-mark-the-pipewiresink-as-EARLY_PROCESS.patch
@@ -0,0 +1,29 @@
+From 938283aee4a1c120bf1c9285090ea196a5b5c89b Mon Sep 17 00:00:00 2001
+Message-ID: <938283aee4a1c120bf1c9285090ea196a5b5c89b.1737052666.git.sam@gentoo.org>
+In-Reply-To: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+References: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Tue, 26 Nov 2024 16:57:14 +0100
+Subject: [PATCH 3/8] gst: mark the pipewiresink as EARLY_PROCESS
+
+We want to receive process callbacks as soon as a buffer is ready for
+reuse because we dequeue it for use in our buffer pool.
+---
+ src/gst/gstpipewiresink.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c
+index b39a335d8..d79ceaa66 100644
+--- a/src/gst/gstpipewiresink.c
++++ b/src/gst/gstpipewiresink.c
+@@ -633,6 +633,7 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
+ char buf[64];
+
+ flags = PW_STREAM_FLAG_ASYNC;
++ flags |= PW_STREAM_FLAG_EARLY_PROCESS;
+ if (pwsink->mode != GST_PIPEWIRE_SINK_MODE_PROVIDE)
+ flags |= PW_STREAM_FLAG_AUTOCONNECT;
+ else
+--
+2.48.0
+
diff --git a/media-video/pipewire/files/1.2.7/0004-gst-add-rate-control-to-the-sink.patch b/media-video/pipewire/files/1.2.7/0004-gst-add-rate-control-to-the-sink.patch
new file mode 100644
index 000000000000..1fdd40244948
--- /dev/null
+++ b/media-video/pipewire/files/1.2.7/0004-gst-add-rate-control-to-the-sink.patch
@@ -0,0 +1,234 @@
+From 1e2b7f7c00fbded9e9ebb83b10ce302155ba444f Mon Sep 17 00:00:00 2001
+Message-ID: <1e2b7f7c00fbded9e9ebb83b10ce302155ba444f.1737052666.git.sam@gentoo.org>
+In-Reply-To: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+References: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Tue, 26 Nov 2024 17:45:41 +0100
+Subject: [PATCH 4/8] gst: add rate control to the sink
+
+Track the elapsed time between buffers and try to keep the buffer fill
+level constant by changing the rate of the stream.
+
+See #4374
+---
+ src/gst/gstpipewiresink.c | 76 ++++++++++++++++++++++++++++++++++---
+ src/gst/gstpipewiresink.h | 4 ++
+ src/gst/gstpipewirestream.c | 1 +
+ src/gst/gstpipewirestream.h | 8 ++++
+ src/gst/meson.build | 2 +-
+ 5 files changed, 84 insertions(+), 7 deletions(-)
+
+diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c
+index d79ceaa66..33f2322e9 100644
+--- a/src/gst/gstpipewiresink.c
++++ b/src/gst/gstpipewiresink.c
+@@ -26,6 +26,7 @@
+
+ #include <spa/pod/builder.h>
+ #include <spa/utils/result.h>
++#include <spa/utils/dll.h>
+
+ #include <gst/video/video.h>
+
+@@ -481,14 +482,13 @@ static void
+ do_send_buffer (GstPipeWireSink *pwsink, GstBuffer *buffer)
+ {
+ GstPipeWirePoolData *data;
++ GstPipeWireStream *stream = pwsink->stream;
+ gboolean res;
+ guint i;
+ struct spa_buffer *b;
+
+ data = gst_pipewire_pool_get_data(buffer);
+
+- GST_LOG_OBJECT (pwsink, "queue buffer %p, pw_buffer %p", buffer, data->b);
+-
+ b = data->b->buffer;
+
+ if (data->header) {
+@@ -508,12 +508,15 @@ do_send_buffer (GstPipeWireSink *pwsink, GstBuffer *buffer)
+ data->crop->region.size.height = meta->width;
+ }
+ }
++ data->b->size = 0;
+ for (i = 0; i < b->n_datas; i++) {
+ struct spa_data *d = &b->datas[i];
+ GstMemory *mem = gst_buffer_peek_memory (buffer, i);
+ d->chunk->offset = mem->offset;
+ d->chunk->size = mem->size;
+- d->chunk->stride = pwsink->stream->pool->video_info.stride[i];
++ d->chunk->stride = stream->pool->video_info.stride[i];
++
++ data->b->size += mem->size / 4;
+ }
+
+ GstVideoMeta *meta = gst_buffer_get_video_meta (buffer);
+@@ -532,9 +535,50 @@ do_send_buffer (GstPipeWireSink *pwsink, GstBuffer *buffer)
+ }
+ }
+
+- if ((res = pw_stream_queue_buffer (pwsink->stream->pwstream, data->b)) < 0) {
++ if ((res = pw_stream_queue_buffer (stream->pwstream, data->b)) < 0) {
+ g_warning ("can't send buffer %s", spa_strerror(res));
+ }
++
++ if (pwsink->rate_match) {
++ double err, corr;
++ struct pw_time ts;
++ guint64 queued, now, elapsed, target;
++
++ pw_stream_get_time_n(stream->pwstream, &ts, sizeof(ts));
++ now = pw_stream_get_nsec(stream->pwstream);
++ if (ts.now != 0)
++ elapsed = gst_util_uint64_scale_int (now - ts.now, ts.rate.denom, GST_SECOND * ts.rate.num);
++ else
++ elapsed = 0;
++
++ queued = ts.queued - ts.size;
++ target = 2 * elapsed;
++ err = ((gint64)queued - ((gint64)target));
++
++ corr = spa_dll_update(&stream->dll, SPA_CLAMPD(err, -128.0, 128.0));
++
++ stream->err_wdw = (double)ts.rate.denom/ts.size;
++
++ double avg = (stream->err_avg * stream->err_wdw + (err - stream->err_avg)) / (stream->err_wdw + 1.0);
++ stream->err_var = (stream->err_var * stream->err_wdw +
++ (err - stream->err_avg) * (err - avg)) / (stream->err_wdw + 1.0);
++ stream->err_avg = avg;
++
++ if (stream->last_ts == 0 || stream->last_ts + SPA_NSEC_PER_SEC < now) {
++ stream->last_ts = now;
++ spa_dll_set_bw(&stream->dll, SPA_CLAMPD(fabs(stream->err_avg) / sqrt(fabs(stream->err_var)), 0.001, SPA_DLL_BW_MAX),
++ ts.size, ts.rate.denom);
++ GST_INFO_OBJECT (pwsink, "queue buffer %p, pw_buffer %p q:%"PRIi64"/%"PRIi64" e:%"PRIu64
++ " err:%+03f corr:%f %f %f %f",
++ buffer, data->b, ts.queued, ts.size, elapsed, err, corr,
++ stream->err_avg, stream->err_var, stream->dll.bw);
++ }
++
++ if (pwsink->match) {
++ pwsink->match->rate = corr;
++ SPA_FLAG_UPDATE(pwsink->match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE, true);
++ }
++ }
+ }
+
+
+@@ -576,6 +620,18 @@ on_state_changed (void *data, enum pw_stream_state old, enum pw_stream_state sta
+ pw_thread_loop_signal (pwsink->stream->core->loop, FALSE);
+ }
+
++static void
++on_io_changed (void *obj, uint32_t id, void *data, uint32_t size)
++{
++ GstPipeWireSink *pwsink = obj;
++
++ switch (id) {
++ case SPA_IO_RateMatch:
++ pwsink->match = data;
++ break;
++ }
++}
++
+ static void
+ on_param_changed (void *data, uint32_t id, const struct spa_pod *param)
+ {
+@@ -613,9 +669,16 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
+ pwsink = GST_PIPEWIRE_SINK (bsink);
+
+ s = gst_caps_get_structure (caps, 0);
+- rate = 0;
+- if (gst_structure_has_name (s, "audio/x-raw"))
++ if (gst_structure_has_name (s, "audio/x-raw")) {
+ gst_structure_get_int (s, "rate", &rate);
++ pwsink->rate = rate;
++ pwsink->rate_match = true;
++ } else {
++ pwsink->rate = rate = 0;
++ pwsink->rate_match = false;
++ }
++
++ spa_dll_set_bw(&pwsink->stream->dll, SPA_DLL_BW_MIN, 4096, rate);
+
+ possible = gst_caps_to_format_all (caps);
+
+@@ -791,6 +854,7 @@ not_negotiated:
+ static const struct pw_stream_events stream_events = {
+ PW_VERSION_STREAM_EVENTS,
+ .state_changed = on_state_changed,
++ .io_changed = on_io_changed,
+ .param_changed = on_param_changed,
+ .add_buffer = on_add_buffer,
+ .remove_buffer = on_remove_buffer,
+diff --git a/src/gst/gstpipewiresink.h b/src/gst/gstpipewiresink.h
+index 74e6667e6..33d7b5b4f 100644
+--- a/src/gst/gstpipewiresink.h
++++ b/src/gst/gstpipewiresink.h
+@@ -50,8 +50,12 @@ struct _GstPipeWireSink {
+
+ /* video state */
+ gboolean negotiated;
++ gboolean rate_match;
++ gint rate;
+
+ GstPipeWireSinkMode mode;
++
++ struct spa_io_rate_match *match;
+ };
+
+ GType gst_pipewire_sink_mode_get_type (void);
+diff --git a/src/gst/gstpipewirestream.c b/src/gst/gstpipewirestream.c
+index bf7641548..68cb9be21 100644
+--- a/src/gst/gstpipewirestream.c
++++ b/src/gst/gstpipewirestream.c
+@@ -19,6 +19,7 @@ gst_pipewire_stream_init (GstPipeWireStream * self)
+ self->fd = -1;
+ self->client_name = g_strdup (pw_get_client_name());
+ self->pool = gst_pipewire_pool_new (self);
++ spa_dll_init(&self->dll);
+ }
+
+ static void
+diff --git a/src/gst/gstpipewirestream.h b/src/gst/gstpipewirestream.h
+index ff8c8e2e6..a301375c7 100644
+--- a/src/gst/gstpipewirestream.h
++++ b/src/gst/gstpipewirestream.h
+@@ -11,6 +11,7 @@
+ #include "gstpipewirecore.h"
+
+ #include <gst/gst.h>
++#include <spa/utils/dll.h>
+ #include <pipewire/pipewire.h>
+
+ G_BEGIN_DECLS
+@@ -29,6 +30,13 @@ struct _GstPipeWireStream {
+ GstPipeWirePool *pool;
+ GstClock *clock;
+
++ guint64 position;
++ struct spa_dll dll;
++ double err_avg, err_var, err_wdw;
++ guint64 last_ts;
++ guint64 base_buffer_ts;
++ guint64 base_ts;
++
+ /* the actual pw stream */
+ struct pw_stream *pwstream;
+ struct spa_hook pwstream_listener;
+diff --git a/src/gst/meson.build b/src/gst/meson.build
+index ba1f6d558..1e39bcf89 100644
+--- a/src/gst/meson.build
++++ b/src/gst/meson.build
+@@ -27,7 +27,7 @@ pipewire_gst_headers = [
+ pipewire_gst = shared_library('gstpipewire',
+ pipewire_gst_sources,
+ include_directories : [ configinc ],
+- dependencies : [ spa_dep, gst_dep, pipewire_dep ],
++ dependencies : [ spa_dep, gst_dep, pipewire_dep, mathlib ],
+ install : true,
+ install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),
+ )
+--
+2.48.0
+
diff --git a/media-video/pipewire/files/1.2.7/0005-gst-add-slave-method-property.patch b/media-video/pipewire/files/1.2.7/0005-gst-add-slave-method-property.patch
new file mode 100644
index 000000000000..74df92bbdfcf
--- /dev/null
+++ b/media-video/pipewire/files/1.2.7/0005-gst-add-slave-method-property.patch
@@ -0,0 +1,259 @@
+From 91e26d6011bd194deffb5765f9b3306fb92738d9 Mon Sep 17 00:00:00 2001
+Message-ID: <91e26d6011bd194deffb5765f9b3306fb92738d9.1737052666.git.sam@gentoo.org>
+In-Reply-To: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+References: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Tue, 3 Dec 2024 11:54:52 +0100
+Subject: [PATCH 5/8] gst: add slave-method property
+
+Set the slave-method to none by default to disable the resampler.
+
+Fixes #4374
+---
+ src/gst/gstpipewiresink.c | 141 +++++++++++++++++++++++++++-----------
+ src/gst/gstpipewiresink.h | 21 +++++-
+ 2 files changed, 120 insertions(+), 42 deletions(-)
+
+diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c
+index 33f2322e9..bf1b427f0 100644
+--- a/src/gst/gstpipewiresink.c
++++ b/src/gst/gstpipewiresink.c
+@@ -37,6 +37,7 @@ GST_DEBUG_CATEGORY_STATIC (pipewire_sink_debug);
+ #define GST_CAT_DEFAULT pipewire_sink_debug
+
+ #define DEFAULT_PROP_MODE GST_PIPEWIRE_SINK_MODE_DEFAULT
++#define DEFAULT_PROP_SLAVE_METHOD GST_PIPEWIRE_SINK_SLAVE_METHOD_NONE
+
+ #define MIN_BUFFERS 8u
+
+@@ -49,7 +50,8 @@ enum
+ PROP_CLIENT_PROPERTIES,
+ PROP_STREAM_PROPERTIES,
+ PROP_MODE,
+- PROP_FD
++ PROP_FD,
++ PROP_SLAVE_METHOD
+ };
+
+ GType
+@@ -72,6 +74,26 @@ gst_pipewire_sink_mode_get_type (void)
+ return (GType) mode_type;
+ }
+
++GType
++gst_pipewire_sink_slave_method_get_type (void)
++{
++ static gsize method_type = 0;
++ static const GEnumValue method[] = {
++ {GST_PIPEWIRE_SINK_SLAVE_METHOD_NONE, "GST_PIPEWIRE_SINK_SLAVE_METHOD_NONE", "none"},
++ {GST_PIPEWIRE_SINK_SLAVE_METHOD_RESAMPLE, "GST_PIPEWIRE_SINK_SLAVE_METHOD_RESAMPLE", "resample"},
++ {0, NULL, NULL},
++ };
++
++ if (g_once_init_enter (&method_type)) {
++ GType tmp =
++ g_enum_register_static ("GstPipeWireSinkSlaveMethod", method);
++ g_once_init_leave (&method_type, tmp);
++ }
++
++ return (GType) method_type;
++}
++
++
+
+ static GstStaticPadTemplate gst_pipewire_sink_template =
+ GST_STATIC_PAD_TEMPLATE ("sink",
+@@ -225,6 +247,17 @@ gst_pipewire_sink_class_init (GstPipeWireSinkClass * klass)
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
++ g_object_class_install_property (gobject_class,
++ PROP_SLAVE_METHOD,
++ g_param_spec_enum ("slave-method",
++ "Slave Method",
++ "Algorithm used to match the rate of the masterclock",
++ GST_TYPE_PIPEWIRE_SINK_SLAVE_METHOD,
++ DEFAULT_PROP_SLAVE_METHOD,
++ G_PARAM_READWRITE |
++ G_PARAM_STATIC_STRINGS));
++
++
+ gstelement_class->provide_clock = gst_pipewire_sink_provide_clock;
+ gstelement_class->change_state = gst_pipewire_sink_change_state;
+
+@@ -408,6 +441,10 @@ gst_pipewire_sink_set_property (GObject * object, guint prop_id,
+ pwsink->stream->fd = g_value_get_int (value);
+ break;
+
++ case PROP_SLAVE_METHOD:
++ pwsink->slave_method = g_value_get_enum (value);
++ break;
++
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+@@ -449,12 +486,69 @@ gst_pipewire_sink_get_property (GObject * object, guint prop_id,
+ g_value_set_int (value, pwsink->stream->fd);
+ break;
+
++ case PROP_SLAVE_METHOD:
++ g_value_set_enum (value, pwsink->slave_method);
++ break;
++
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+ }
+
++static void rate_match_resample(GstPipeWireSink *pwsink)
++{
++ GstPipeWireStream *stream = pwsink->stream;
++ double err, corr;
++ struct pw_time ts;
++ guint64 queued, now, elapsed, target;
++
++ if (!pwsink->rate_match)
++ return;
++
++ pw_stream_get_time_n(stream->pwstream, &ts, sizeof(ts));
++ now = pw_stream_get_nsec(stream->pwstream);
++ if (ts.now != 0)
++ elapsed = gst_util_uint64_scale_int (now - ts.now, ts.rate.denom, GST_SECOND * ts.rate.num);
++ else
++ elapsed = 0;
++
++ queued = ts.queued - ts.size;
++ target = elapsed;
++ err = ((gint64)queued - ((gint64)target));
++
++ corr = spa_dll_update(&stream->dll, SPA_CLAMPD(err, -128.0, 128.0));
++
++ stream->err_wdw = (double)ts.rate.denom/ts.size;
++
++ double avg = (stream->err_avg * stream->err_wdw + (err - stream->err_avg)) / (stream->err_wdw + 1.0);
++ stream->err_var = (stream->err_var * stream->err_wdw +
++ (err - stream->err_avg) * (err - avg)) / (stream->err_wdw + 1.0);
++ stream->err_avg = avg;
++
++ if (stream->last_ts == 0 || stream->last_ts + SPA_NSEC_PER_SEC < now) {
++ double bw;
++
++ stream->last_ts = now;
++
++ if (stream->err_var == 0.0)
++ bw = 0.0;
++ else
++ bw = fabs(stream->err_avg) / sqrt(fabs(stream->err_var));
++
++ spa_dll_set_bw(&stream->dll, SPA_CLAMPD(bw, 0.001, SPA_DLL_BW_MAX), ts.size, ts.rate.denom);
++
++ GST_INFO_OBJECT (pwsink, "q:%"PRIi64"/%"PRIi64" e:%"PRIu64" err:%+03f corr:%f %f %f %f",
++ ts.queued, ts.size, elapsed, err, corr,
++ stream->err_avg, stream->err_var, stream->dll.bw);
++ }
++
++ if (pwsink->match) {
++ pwsink->match->rate = corr;
++ SPA_FLAG_UPDATE(pwsink->match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE, true);
++ }
++}
++
+ static void
+ on_add_buffer (void *_data, struct pw_buffer *b)
+ {
+@@ -539,45 +633,12 @@ do_send_buffer (GstPipeWireSink *pwsink, GstBuffer *buffer)
+ g_warning ("can't send buffer %s", spa_strerror(res));
+ }
+
+- if (pwsink->rate_match) {
+- double err, corr;
+- struct pw_time ts;
+- guint64 queued, now, elapsed, target;
+-
+- pw_stream_get_time_n(stream->pwstream, &ts, sizeof(ts));
+- now = pw_stream_get_nsec(stream->pwstream);
+- if (ts.now != 0)
+- elapsed = gst_util_uint64_scale_int (now - ts.now, ts.rate.denom, GST_SECOND * ts.rate.num);
+- else
+- elapsed = 0;
+-
+- queued = ts.queued - ts.size;
+- target = 2 * elapsed;
+- err = ((gint64)queued - ((gint64)target));
+-
+- corr = spa_dll_update(&stream->dll, SPA_CLAMPD(err, -128.0, 128.0));
+-
+- stream->err_wdw = (double)ts.rate.denom/ts.size;
+-
+- double avg = (stream->err_avg * stream->err_wdw + (err - stream->err_avg)) / (stream->err_wdw + 1.0);
+- stream->err_var = (stream->err_var * stream->err_wdw +
+- (err - stream->err_avg) * (err - avg)) / (stream->err_wdw + 1.0);
+- stream->err_avg = avg;
+-
+- if (stream->last_ts == 0 || stream->last_ts + SPA_NSEC_PER_SEC < now) {
+- stream->last_ts = now;
+- spa_dll_set_bw(&stream->dll, SPA_CLAMPD(fabs(stream->err_avg) / sqrt(fabs(stream->err_var)), 0.001, SPA_DLL_BW_MAX),
+- ts.size, ts.rate.denom);
+- GST_INFO_OBJECT (pwsink, "queue buffer %p, pw_buffer %p q:%"PRIi64"/%"PRIi64" e:%"PRIu64
+- " err:%+03f corr:%f %f %f %f",
+- buffer, data->b, ts.queued, ts.size, elapsed, err, corr,
+- stream->err_avg, stream->err_var, stream->dll.bw);
+- }
+-
+- if (pwsink->match) {
+- pwsink->match->rate = corr;
+- SPA_FLAG_UPDATE(pwsink->match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE, true);
+- }
++ switch (pwsink->slave_method) {
++ case GST_PIPEWIRE_SINK_SLAVE_METHOD_NONE:
++ break;
++ case GST_PIPEWIRE_SINK_SLAVE_METHOD_RESAMPLE:
++ rate_match_resample(pwsink);
++ break;
+ }
+ }
+
+diff --git a/src/gst/gstpipewiresink.h b/src/gst/gstpipewiresink.h
+index 33d7b5b4f..306297d0e 100644
+--- a/src/gst/gstpipewiresink.h
++++ b/src/gst/gstpipewiresink.h
+@@ -37,6 +37,22 @@ typedef enum
+
+ #define GST_TYPE_PIPEWIRE_SINK_MODE (gst_pipewire_sink_mode_get_type ())
+
++
++/**
++ * GstPipeWireSinkSlaveMethod:
++ * @GST_PIPEWIRE_SINK_SLAVE_METHOD_NONE: no clock and timestamp slaving
++ * @GST_PIPEWIRE_SINK_SLAVE_METHOD_RESAMPLE: resample audio
++ *
++ * Different clock slaving methods
++ */
++typedef enum
++{
++ GST_PIPEWIRE_SINK_SLAVE_METHOD_NONE,
++ GST_PIPEWIRE_SINK_SLAVE_METHOD_RESAMPLE,
++} GstPipeWireSinkSlaveMethod;
++
++#define GST_TYPE_PIPEWIRE_SINK_SLAVE_METHOD (gst_pipewire_sink_slave_method_get_type ())
++
+ /**
+ * GstPipeWireSink:
+ *
+@@ -53,9 +69,10 @@ struct _GstPipeWireSink {
+ gboolean rate_match;
+ gint rate;
+
+- GstPipeWireSinkMode mode;
+-
+ struct spa_io_rate_match *match;
++
++ GstPipeWireSinkMode mode;
++ GstPipeWireSinkSlaveMethod slave_method;
+ };
+
+ GType gst_pipewire_sink_mode_get_type (void);
+--
+2.48.0
+
diff --git a/media-video/pipewire/files/1.2.7/0006-spa-fix-some-param-type-info.patch b/media-video/pipewire/files/1.2.7/0006-spa-fix-some-param-type-info.patch
new file mode 100644
index 000000000000..c91ada71cf5a
--- /dev/null
+++ b/media-video/pipewire/files/1.2.7/0006-spa-fix-some-param-type-info.patch
@@ -0,0 +1,51 @@
+From e42de413e89249dca22b78f3c3d5a5c2e2e8b2f3 Mon Sep 17 00:00:00 2001
+Message-ID: <e42de413e89249dca22b78f3c3d5a5c2e2e8b2f3.1737052666.git.sam@gentoo.org>
+In-Reply-To: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+References: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Tue, 3 Dec 2024 12:41:07 +0100
+Subject: [PATCH 6/8] spa: fix some param type info
+
+Add an int array type and use this in the route properties.
+
+Fixes #4441
+---
+ spa/include/spa/param/param-types.h | 5 +++++
+ spa/include/spa/param/route-types.h | 4 ++--
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/spa/include/spa/param/param-types.h b/spa/include/spa/param/param-types.h
+index 4bed3651d..ebb8d988b 100644
+--- a/spa/include/spa/param/param-types.h
++++ b/spa/include/spa/param/param-types.h
+@@ -55,6 +55,11 @@ static const struct spa_type_info spa_type_prop_float_array[] = {
+ { 0, 0, NULL, NULL },
+ };
+
++static const struct spa_type_info spa_type_prop_int_array[] = {
++ { SPA_PROP_START, SPA_TYPE_Int, SPA_TYPE_INFO_BASE "intArray", NULL, },
++ { 0, 0, NULL, NULL },
++};
++
+ static const struct spa_type_info spa_type_prop_channel_map[] = {
+ { SPA_PROP_START, SPA_TYPE_Id, SPA_TYPE_INFO_BASE "channelMap", spa_type_audio_channel, },
+ { 0, 0, NULL, NULL },
+diff --git a/spa/include/spa/param/route-types.h b/spa/include/spa/param/route-types.h
+index 619a9e2e8..78ced495e 100644
+--- a/spa/include/spa/param/route-types.h
++++ b/spa/include/spa/param/route-types.h
+@@ -32,9 +32,9 @@ static const struct spa_type_info spa_type_param_route[] = {
+ { SPA_PARAM_ROUTE_priority, SPA_TYPE_Int, SPA_TYPE_INFO_PARAM_ROUTE_BASE "priority", NULL, },
+ { SPA_PARAM_ROUTE_available, SPA_TYPE_Id, SPA_TYPE_INFO_PARAM_ROUTE_BASE "available", spa_type_param_availability, },
+ { SPA_PARAM_ROUTE_info, SPA_TYPE_Struct, SPA_TYPE_INFO_PARAM_ROUTE_BASE "info", NULL, },
+- { SPA_PARAM_ROUTE_profiles, SPA_TYPE_Int, SPA_TYPE_INFO_PARAM_ROUTE_BASE "profiles", NULL, },
++ { SPA_PARAM_ROUTE_profiles, SPA_TYPE_Array, SPA_TYPE_INFO_PARAM_ROUTE_BASE "profiles", spa_type_prop_int_array, },
+ { SPA_PARAM_ROUTE_props, SPA_TYPE_OBJECT_Props, SPA_TYPE_INFO_PARAM_ROUTE_BASE "props", NULL, },
+- { SPA_PARAM_ROUTE_devices, SPA_TYPE_Int, SPA_TYPE_INFO_PARAM_ROUTE_BASE "devices", NULL, },
++ { SPA_PARAM_ROUTE_devices, SPA_TYPE_Array, SPA_TYPE_INFO_PARAM_ROUTE_BASE "devices", spa_type_prop_int_array, },
+ { SPA_PARAM_ROUTE_profile, SPA_TYPE_Int, SPA_TYPE_INFO_PARAM_ROUTE_BASE "profile", NULL, },
+ { SPA_PARAM_ROUTE_save, SPA_TYPE_Bool, SPA_TYPE_INFO_PARAM_ROUTE_BASE "save", NULL, },
+ { 0, 0, NULL, NULL },
+--
+2.48.0
+
diff --git a/media-video/pipewire/files/1.2.7/0007-filter-chain-handle-0-length-IR.patch b/media-video/pipewire/files/1.2.7/0007-filter-chain-handle-0-length-IR.patch
new file mode 100644
index 000000000000..4a1c25871d4c
--- /dev/null
+++ b/media-video/pipewire/files/1.2.7/0007-filter-chain-handle-0-length-IR.patch
@@ -0,0 +1,305 @@
+From 8d9269374ddd7fc1628d9bf05c0880e82a76015d Mon Sep 17 00:00:00 2001
+Message-ID: <8d9269374ddd7fc1628d9bf05c0880e82a76015d.1737052666.git.sam@gentoo.org>
+In-Reply-To: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+References: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Tue, 3 Dec 2024 15:43:56 +0100
+Subject: [PATCH 7/8] filter-chain: handle 0 length IR
+
+Make sure we copy the DSP functions in the convolver before leaving the
+function because we need them to clear memory.
+
+Don't store the DSP functions in the head and tail convolvers but pass
+them from the main convolver because the convolvers might be NULL but we
+still need the DSP functions to clear memory.
+
+Fixes #4433
+---
+ src/modules/module-filter-chain/convolver.c | 96 +++++++++++----------
+ 1 file changed, 49 insertions(+), 47 deletions(-)
+
+diff --git a/src/modules/module-filter-chain/convolver.c b/src/modules/module-filter-chain/convolver.c
+index 3aa7230c0..4251c4025 100644
+--- a/src/modules/module-filter-chain/convolver.c
++++ b/src/modules/module-filter-chain/convolver.c
+@@ -11,8 +11,6 @@
+ #include <math.h>
+
+ struct convolver1 {
+- struct dsp_ops *dsp;
+-
+ int blockSize;
+ int segSize;
+ int segCount;
+@@ -76,15 +74,15 @@ static int next_power_of_two(int val)
+ return r;
+ }
+
+-static void convolver1_reset(struct convolver1 *conv)
++static void convolver1_reset(struct dsp_ops *dsp, struct convolver1 *conv)
+ {
+ int i;
+ for (i = 0; i < conv->segCount; i++)
+- fft_cpx_clear(conv->dsp, conv->segments[i], conv->fftComplexSize);
+- dsp_ops_clear(conv->dsp, conv->overlap, conv->blockSize);
+- dsp_ops_clear(conv->dsp, conv->inputBuffer, conv->segSize);
+- fft_cpx_clear(conv->dsp, conv->pre_mult, conv->fftComplexSize);
+- fft_cpx_clear(conv->dsp, conv->conv, conv->fftComplexSize);
++ fft_cpx_clear(dsp, conv->segments[i], conv->fftComplexSize);
++ dsp_ops_clear(dsp, conv->overlap, conv->blockSize);
++ dsp_ops_clear(dsp, conv->inputBuffer, conv->segSize);
++ fft_cpx_clear(dsp, conv->pre_mult, conv->fftComplexSize);
++ fft_cpx_clear(dsp, conv->conv, conv->fftComplexSize);
+ conv->inputBufferFill = 0;
+ conv->current = 0;
+ }
+@@ -107,16 +105,15 @@ static struct convolver1 *convolver1_new(struct dsp_ops *dsp, int block, const f
+ if (irlen == 0)
+ return conv;
+
+- conv->dsp = dsp;
+ conv->blockSize = next_power_of_two(block);
+ conv->segSize = 2 * conv->blockSize;
+ conv->segCount = (irlen + conv->blockSize-1) / conv->blockSize;
+ conv->fftComplexSize = (conv->segSize / 2) + 1;
+
+- conv->fft = dsp_ops_fft_new(conv->dsp, conv->segSize, true);
++ conv->fft = dsp_ops_fft_new(dsp, conv->segSize, true);
+ if (conv->fft == NULL)
+ goto error;
+- conv->ifft = dsp_ops_fft_new(conv->dsp, conv->segSize, true);
++ conv->ifft = dsp_ops_fft_new(dsp, conv->segSize, true);
+ if (conv->ifft == NULL)
+ goto error;
+
+@@ -134,18 +131,18 @@ static struct convolver1 *convolver1_new(struct dsp_ops *dsp, int block, const f
+ conv->segments[i] = fft_cpx_alloc(conv->fftComplexSize);
+ conv->segmentsIr[i] = fft_cpx_alloc(conv->fftComplexSize);
+
+- dsp_ops_copy(conv->dsp, conv->fft_buffer, &ir[i * conv->blockSize], copy);
++ dsp_ops_copy(dsp, conv->fft_buffer, &ir[i * conv->blockSize], copy);
+ if (copy < conv->segSize)
+- dsp_ops_clear(conv->dsp, conv->fft_buffer + copy, conv->segSize - copy);
++ dsp_ops_clear(dsp, conv->fft_buffer + copy, conv->segSize - copy);
+
+- dsp_ops_fft_run(conv->dsp, conv->fft, 1, conv->fft_buffer, conv->segmentsIr[i]);
++ dsp_ops_fft_run(dsp, conv->fft, 1, conv->fft_buffer, conv->segmentsIr[i]);
+ }
+ conv->pre_mult = fft_cpx_alloc(conv->fftComplexSize);
+ conv->conv = fft_cpx_alloc(conv->fftComplexSize);
+ conv->overlap = fft_alloc(conv->blockSize);
+ conv->inputBuffer = fft_alloc(conv->segSize);
+ conv->scale = 1.0f / conv->segSize;
+- convolver1_reset(conv);
++ convolver1_reset(dsp, conv);
+
+ return conv;
+ error:
+@@ -159,7 +156,7 @@ error:
+ return NULL;
+ }
+
+-static void convolver1_free(struct convolver1 *conv)
++static void convolver1_free(struct dsp_ops *dsp, struct convolver1 *conv)
+ {
+ int i;
+ for (i = 0; i < conv->segCount; i++) {
+@@ -167,9 +164,9 @@ static void convolver1_free(struct convolver1 *conv)
+ fft_cpx_free(conv->segmentsIr[i]);
+ }
+ if (conv->fft)
+- dsp_ops_fft_free(conv->dsp, conv->fft);
++ dsp_ops_fft_free(dsp, conv->fft);
+ if (conv->ifft)
+- dsp_ops_fft_free(conv->dsp, conv->ifft);
++ dsp_ops_fft_free(dsp, conv->ifft);
+ if (conv->fft_buffer)
+ fft_free(conv->fft_buffer);
+ free(conv->segments);
+@@ -181,12 +178,12 @@ static void convolver1_free(struct convolver1 *conv)
+ free(conv);
+ }
+
+-static int convolver1_run(struct convolver1 *conv, const float *input, float *output, int len)
++static int convolver1_run(struct dsp_ops *dsp, struct convolver1 *conv, const float *input, float *output, int len)
+ {
+ int i, processed = 0;
+
+ if (conv == NULL || conv->segCount == 0) {
+- dsp_ops_clear(conv->dsp, output, len);
++ dsp_ops_clear(dsp, output, len);
+ return len;
+ }
+
+@@ -194,17 +191,17 @@ static int convolver1_run(struct convolver1 *conv, const float *input, float *ou
+ const int processing = SPA_MIN(len - processed, conv->blockSize - conv->inputBufferFill);
+ const int inputBufferPos = conv->inputBufferFill;
+
+- dsp_ops_copy(conv->dsp, conv->inputBuffer + inputBufferPos, input + processed, processing);
++ dsp_ops_copy(dsp, conv->inputBuffer + inputBufferPos, input + processed, processing);
+ if (inputBufferPos == 0 && processing < conv->blockSize)
+- dsp_ops_clear(conv->dsp, conv->inputBuffer + processing, conv->blockSize - processing);
++ dsp_ops_clear(dsp, conv->inputBuffer + processing, conv->blockSize - processing);
+
+- dsp_ops_fft_run(conv->dsp, conv->fft, 1, conv->inputBuffer, conv->segments[conv->current]);
++ dsp_ops_fft_run(dsp, conv->fft, 1, conv->inputBuffer, conv->segments[conv->current]);
+
+ if (conv->segCount > 1) {
+ if (conv->inputBufferFill == 0) {
+ int indexAudio = (conv->current + 1) % conv->segCount;
+
+- dsp_ops_fft_cmul(conv->dsp, conv->fft, conv->pre_mult,
++ dsp_ops_fft_cmul(dsp, conv->fft, conv->pre_mult,
+ conv->segmentsIr[1],
+ conv->segments[indexAudio],
+ conv->fftComplexSize, conv->scale);
+@@ -212,7 +209,7 @@ static int convolver1_run(struct convolver1 *conv, const float *input, float *ou
+ for (i = 2; i < conv->segCount; i++) {
+ indexAudio = (conv->current + i) % conv->segCount;
+
+- dsp_ops_fft_cmuladd(conv->dsp, conv->fft,
++ dsp_ops_fft_cmuladd(dsp, conv->fft,
+ conv->pre_mult,
+ conv->pre_mult,
+ conv->segmentsIr[i],
+@@ -220,30 +217,30 @@ static int convolver1_run(struct convolver1 *conv, const float *input, float *ou
+ conv->fftComplexSize, conv->scale);
+ }
+ }
+- dsp_ops_fft_cmuladd(conv->dsp, conv->fft,
++ dsp_ops_fft_cmuladd(dsp, conv->fft,
+ conv->conv,
+ conv->pre_mult,
+ conv->segments[conv->current],
+ conv->segmentsIr[0],
+ conv->fftComplexSize, conv->scale);
+ } else {
+- dsp_ops_fft_cmul(conv->dsp, conv->fft,
++ dsp_ops_fft_cmul(dsp, conv->fft,
+ conv->conv,
+ conv->segments[conv->current],
+ conv->segmentsIr[0],
+ conv->fftComplexSize, conv->scale);
+ }
+
+- dsp_ops_fft_run(conv->dsp, conv->ifft, -1, conv->conv, conv->fft_buffer);
++ dsp_ops_fft_run(dsp, conv->ifft, -1, conv->conv, conv->fft_buffer);
+
+- dsp_ops_sum(conv->dsp, output + processed, conv->fft_buffer + inputBufferPos,
++ dsp_ops_sum(dsp, output + processed, conv->fft_buffer + inputBufferPos,
+ conv->overlap + inputBufferPos, processing);
+
+ conv->inputBufferFill += processing;
+ if (conv->inputBufferFill == conv->blockSize) {
+ conv->inputBufferFill = 0;
+
+- dsp_ops_copy(conv->dsp, conv->overlap, conv->fft_buffer + conv->blockSize, conv->blockSize);
++ dsp_ops_copy(dsp, conv->overlap, conv->fft_buffer + conv->blockSize, conv->blockSize);
+
+ conv->current = (conv->current > 0) ? (conv->current - 1) : (conv->segCount - 1);
+ }
+@@ -272,17 +269,18 @@ struct convolver
+
+ void convolver_reset(struct convolver *conv)
+ {
++ struct dsp_ops *dsp = conv->dsp;
+ if (conv->headConvolver)
+- convolver1_reset(conv->headConvolver);
++ convolver1_reset(dsp, conv->headConvolver);
+ if (conv->tailConvolver0) {
+- convolver1_reset(conv->tailConvolver0);
+- dsp_ops_clear(conv->dsp, conv->tailOutput0, conv->tailBlockSize);
+- dsp_ops_clear(conv->dsp, conv->tailPrecalculated0, conv->tailBlockSize);
++ convolver1_reset(dsp, conv->tailConvolver0);
++ dsp_ops_clear(dsp, conv->tailOutput0, conv->tailBlockSize);
++ dsp_ops_clear(dsp, conv->tailPrecalculated0, conv->tailBlockSize);
+ }
+ if (conv->tailConvolver) {
+- convolver1_reset(conv->tailConvolver);
+- dsp_ops_clear(conv->dsp, conv->tailOutput, conv->tailBlockSize);
+- dsp_ops_clear(conv->dsp, conv->tailPrecalculated, conv->tailBlockSize);
++ convolver1_reset(dsp, conv->tailConvolver);
++ dsp_ops_clear(dsp, conv->tailOutput, conv->tailBlockSize);
++ dsp_ops_clear(dsp, conv->tailPrecalculated, conv->tailBlockSize);
+ }
+ conv->tailInputFill = 0;
+ conv->precalculatedPos = 0;
+@@ -307,10 +305,11 @@ struct convolver *convolver_new(struct dsp_ops *dsp_ops, int head_block, int tai
+ if (conv == NULL)
+ return NULL;
+
++ conv->dsp = dsp_ops;
++
+ if (irlen == 0)
+ return conv;
+
+- conv->dsp = dsp_ops;
+ conv->headBlockSize = next_power_of_two(head_block);
+ conv->tailBlockSize = next_power_of_two(tail_block);
+
+@@ -341,12 +340,13 @@ struct convolver *convolver_new(struct dsp_ops *dsp_ops, int head_block, int tai
+
+ void convolver_free(struct convolver *conv)
+ {
++ struct dsp_ops *dsp = conv->dsp;
+ if (conv->headConvolver)
+- convolver1_free(conv->headConvolver);
++ convolver1_free(dsp, conv->headConvolver);
+ if (conv->tailConvolver0)
+- convolver1_free(conv->tailConvolver0);
++ convolver1_free(dsp, conv->tailConvolver0);
+ if (conv->tailConvolver)
+- convolver1_free(conv->tailConvolver);
++ convolver1_free(dsp, conv->tailConvolver);
+ fft_free(conv->tailOutput0);
+ fft_free(conv->tailPrecalculated0);
+ fft_free(conv->tailOutput);
+@@ -357,7 +357,9 @@ void convolver_free(struct convolver *conv)
+
+ int convolver_run(struct convolver *conv, const float *input, float *output, int length)
+ {
+- convolver1_run(conv->headConvolver, input, output, length);
++ struct dsp_ops *dsp = conv->dsp;
++
++ convolver1_run(dsp, conv->headConvolver, input, output, length);
+
+ if (conv->tailInput) {
+ int processed = 0;
+@@ -367,21 +369,21 @@ int convolver_run(struct convolver *conv, const float *input, float *output, int
+ int processing = SPA_MIN(remaining, conv->headBlockSize - (conv->tailInputFill % conv->headBlockSize));
+
+ if (conv->tailPrecalculated0)
+- dsp_ops_sum(conv->dsp, &output[processed], &output[processed],
++ dsp_ops_sum(dsp, &output[processed], &output[processed],
+ &conv->tailPrecalculated0[conv->precalculatedPos],
+ processing);
+ if (conv->tailPrecalculated)
+- dsp_ops_sum(conv->dsp, &output[processed], &output[processed],
++ dsp_ops_sum(dsp, &output[processed], &output[processed],
+ &conv->tailPrecalculated[conv->precalculatedPos],
+ processing);
+ conv->precalculatedPos += processing;
+
+- dsp_ops_copy(conv->dsp, conv->tailInput + conv->tailInputFill, input + processed, processing);
++ dsp_ops_copy(dsp, conv->tailInput + conv->tailInputFill, input + processed, processing);
+ conv->tailInputFill += processing;
+
+ if (conv->tailPrecalculated0 && (conv->tailInputFill % conv->headBlockSize == 0)) {
+ int blockOffset = conv->tailInputFill - conv->headBlockSize;
+- convolver1_run(conv->tailConvolver0,
++ convolver1_run(dsp, conv->tailConvolver0,
+ conv->tailInput + blockOffset,
+ conv->tailOutput0 + blockOffset,
+ conv->headBlockSize);
+@@ -392,7 +394,7 @@ int convolver_run(struct convolver *conv, const float *input, float *output, int
+ if (conv->tailPrecalculated &&
+ conv->tailInputFill == conv->tailBlockSize) {
+ SPA_SWAP(conv->tailPrecalculated, conv->tailOutput);
+- convolver1_run(conv->tailConvolver, conv->tailInput,
++ convolver1_run(dsp, conv->tailConvolver, conv->tailInput,
+ conv->tailOutput, conv->tailBlockSize);
+ }
+ if (conv->tailInputFill == conv->tailBlockSize) {
+--
+2.48.0
+
diff --git a/media-video/pipewire/files/1.2.7/0008-spa-initialize-all-fields-explicitly.patch b/media-video/pipewire/files/1.2.7/0008-spa-initialize-all-fields-explicitly.patch
new file mode 100644
index 000000000000..24b99891cee2
--- /dev/null
+++ b/media-video/pipewire/files/1.2.7/0008-spa-initialize-all-fields-explicitly.patch
@@ -0,0 +1,47 @@
+From 223569dc4a5778bf74f6d072b10e71912f8b5418 Mon Sep 17 00:00:00 2001
+Message-ID: <223569dc4a5778bf74f6d072b10e71912f8b5418.1737052666.git.sam@gentoo.org>
+In-Reply-To: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+References: <1993383ddf67e296334c7916d6afc699ee6300c7.1737052666.git.sam@gentoo.org>
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Mon, 30 Sep 2024 10:06:30 +0200
+Subject: [PATCH 8/8] spa: initialize all fields explicitly
+
+Patch by Petar Popovic
+
+Fixes #4325
+
+(cherry picked from commit 0ca64277b317b4836beccaa3248ab9055526811c)
+---
+ spa/include/spa/pod/builder.h | 2 +-
+ spa/include/spa/pod/parser.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/spa/include/spa/pod/builder.h b/spa/include/spa/pod/builder.h
+index 0564d94ea..6d3e9d54a 100644
+--- a/spa/include/spa/pod/builder.h
++++ b/spa/include/spa/pod/builder.h
+@@ -49,7 +49,7 @@ struct spa_pod_builder {
+ struct spa_callbacks callbacks;
+ };
+
+-#define SPA_POD_BUILDER_INIT(buffer,size) ((struct spa_pod_builder){ (buffer), (size), 0, {0}, {0} })
++#define SPA_POD_BUILDER_INIT(buffer,size) ((struct spa_pod_builder){ (buffer), (size), 0, {0,0,NULL},{NULL,NULL}})
+
+ static inline void
+ spa_pod_builder_get_state(struct spa_pod_builder *builder, struct spa_pod_builder_state *state)
+diff --git a/spa/include/spa/pod/parser.h b/spa/include/spa/pod/parser.h
+index 083f91171..4c1e72acc 100644
+--- a/spa/include/spa/pod/parser.h
++++ b/spa/include/spa/pod/parser.h
+@@ -33,7 +33,7 @@ struct spa_pod_parser {
+ struct spa_pod_parser_state state;
+ };
+
+-#define SPA_POD_PARSER_INIT(buffer,size) ((struct spa_pod_parser){ (buffer), (size), 0, {0} })
++#define SPA_POD_PARSER_INIT(buffer,size) ((struct spa_pod_parser){ (buffer), (size), 0, {0,0,NULL}})
+
+ static inline void spa_pod_parser_init(struct spa_pod_parser *parser,
+ const void *data, uint32_t size)
+--
+2.48.0
+
diff --git a/media-video/pipewire/pipewire-1.2.7-r1.ebuild b/media-video/pipewire/pipewire-1.2.7-r1.ebuild
new file mode 100644
index 000000000000..36f4674429fd
--- /dev/null
+++ b/media-video/pipewire/pipewire-1.2.7-r1.ebuild
@@ -0,0 +1,527 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# 1. Please regularly check (even at the point of bumping) Fedora's packaging
+# for needed backports at https://src.fedoraproject.org/rpms/pipewire/tree/rawhide.
+#
+# 2. Upstream also sometimes amend release notes for the previous release to mention
+# needed patches, e.g. https://gitlab.freedesktop.org/pipewire/pipewire/-/tags/0.3.55#distros
+#
+# 3. Keep an eye on git master (for both PipeWire and WirePlumber) as things
+# continue to move quickly. It's not uncommon for fixes to be made shortly
+# after releases.
+
+# TODO: Maybe get upstream to produce `meson dist` tarballs:
+# - https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3663
+# - https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1788
+#
+# Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-pipewire-docs
+# Set to 1 if prebuilt, 0 if not
+# (the construct below is to allow overriding from env for script)
+: ${PIPEWIRE_DOCS_PREBUILT:=1}
+
+PIPEWIRE_DOCS_PREBUILT_DEV=sam
+PIPEWIRE_DOCS_VERSION="$(ver_cut 1-2).0"
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+PIPEWIRE_DOCS_USEFLAG="+man"
+PYTHON_COMPAT=( python3_{10..13} )
+inherit meson-multilib optfeature prefix python-any-r1 systemd tmpfiles udev
+
+if [[ ${PV} == 9999 ]]; then
+ PIPEWIRE_DOCS_PREBUILT=0
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
+ inherit git-r3
+else
+ if [[ ${PV} == *_p* ]] ; then
+ MY_COMMIT=""
+ SRC_URI="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${MY_COMMIT}/pipewire-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2"
+ S="${WORKDIR}"/${PN}-${MY_COMMIT}
+ else
+ SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.bz2"
+ fi
+
+ if [[ ${PIPEWIRE_DOCS_PREBUILT} == 1 ]] ; then
+ SRC_URI+=" !man? ( https://dev.gentoo.org/~${PIPEWIRE_DOCS_PREBUILT_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${PIPEWIRE_DOCS_VERSION}-docs.tar.xz )"
+ PIPEWIRE_DOCS_USEFLAG="man"
+ fi
+
+ KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+fi
+
+DESCRIPTION="Multimedia processing graphs"
+HOMEPAGE="https://pipewire.org/"
+
+LICENSE="MIT LGPL-2.1+ GPL-2"
+# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
+SLOT="0/0.4"
+IUSE="${PIPEWIRE_DOCS_USEFLAG} bluetooth elogind dbus doc echo-cancel extra ffmpeg flatpak gstreamer gsettings ieee1394 jack-client jack-sdk liblc3 lv2"
+IUSE+=" modemmanager pipewire-alsa readline roc selinux sound-server ssl system-service systemd test v4l X zeroconf"
+
+# Once replacing system JACK libraries is possible, it's likely that
+# jack-client IUSE will need blocking to avoid users accidentally
+# configuring their systems to send PW sink output to the emulated
+# JACK's sink - doing so is likely to yield no audio, cause a CPU
+# cycles consuming loop (and may even cause GUI crashes)!
+
+# - TODO: There should be "sound-server? ( || ( alsa bluetooth ) )" here, but ALSA is always enabled
+# - TODO: Pulseaudio alsa plugin performs runtime check that pulseaudio server connection will work
+# which provides adequate guarantee that alsa-lib will be able to provide audio services.
+# If that works, pulseaudio defaults are loaded into alsa-lib runtime replacing default PCM and CTL.
+# When pipewire-alsa will be able to perform similar check, pipewire-alsa can be enabled unconditionally.
+# - ffmpeg is only used for pw-cat. We don't build the spa plugin which receives barely any activity.
+REQUIRED_USE="
+ ffmpeg? ( extra )
+ bluetooth? ( dbus )
+ jack-sdk? ( !jack-client )
+ modemmanager? ( bluetooth )
+ system-service? ( systemd )
+ !sound-server? ( !pipewire-alsa )
+ jack-client? ( dbus )
+"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ >=dev-build/meson-0.59
+ virtual/pkgconfig
+ dbus? ( dev-util/gdbus-codegen )
+ doc? (
+ ${PYTHON_DEPS}
+ >=app-text/doxygen-1.9.8
+ media-gfx/graphviz
+ )
+ man? (
+ ${PYTHON_DEPS}
+ >=app-text/doxygen-1.9.8
+ )
+"
+# * While udev could technically be optional, it's needed for a number of options,
+# and not really worth it, bug #877769.
+#
+# * Supports both legacy webrtc-audio-processing:0 and new webrtc-audio-processing:1.
+# We depend on :1 as it prefers that, it's not legacy, and to avoid automagic.
+#
+# * Older Doxygen (<1.9.8) may work but inferior output is created:
+# - https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1778
+# - https://github.com/doxygen/doxygen/issues/9254
+RDEPEND="
+ acct-group/audio
+ acct-group/pipewire
+ media-libs/alsa-lib[${MULTILIB_USEDEP}]
+ sys-libs/ncurses:=[unicode(+)]
+ virtual/libintl[${MULTILIB_USEDEP}]
+ virtual/libudev[${MULTILIB_USEDEP}]
+ bluetooth? (
+ dev-libs/glib
+ media-libs/fdk-aac
+ media-libs/libldac
+ media-libs/libfreeaptx
+ media-libs/opus
+ media-libs/sbc
+ >=net-wireless/bluez-4.101:=
+ virtual/libusb:1
+ )
+ elogind? ( sys-auth/elogind )
+ dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ echo-cancel? ( >=media-libs/webrtc-audio-processing-1.2:1 )
+ extra? ( >=media-libs/libsndfile-1.0.20 )
+ ffmpeg? ( media-video/ffmpeg:= )
+ flatpak? ( dev-libs/glib )
+ gstreamer? (
+ >=dev-libs/glib-2.32.0:2
+ >=media-libs/gstreamer-1.10.0:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ gsettings? ( >=dev-libs/glib-2.26.0:2 )
+ ieee1394? ( media-libs/libffado[${MULTILIB_USEDEP}] )
+ jack-client? ( >=media-sound/jack2-1.9.10:2[dbus] )
+ jack-sdk? (
+ !media-sound/jack-audio-connection-kit
+ !media-sound/jack2
+ )
+ liblc3? ( media-sound/liblc3 )
+ lv2? ( media-libs/lilv )
+ modemmanager? ( >=net-misc/modemmanager-1.10.0 )
+ pipewire-alsa? ( >=media-libs/alsa-lib-1.1.7[${MULTILIB_USEDEP}] )
+ sound-server? ( !media-sound/pulseaudio-daemon )
+ roc? ( >=media-libs/roc-toolkit-0.3.0:= )
+ readline? ( sys-libs/readline:= )
+ selinux? ( sys-libs/libselinux )
+ ssl? ( dev-libs/openssl:= )
+ systemd? ( sys-apps/systemd )
+ system-service? ( acct-user/pipewire )
+ v4l? ( media-libs/libv4l )
+ X? (
+ media-libs/libcanberra
+ x11-libs/libX11
+ x11-libs/libXfixes
+ )
+ zeroconf? ( net-dns/avahi )
+"
+
+DEPEND="${RDEPEND}"
+
+PDEPEND=">=media-video/wireplumber-0.5.2"
+
+# Present RDEPEND that are currently always disabled due to the PW
+# code using them being required to be disabled by Gentoo guidelines
+# (i.e. developer binaries not meant for users) and unready code
+# media-libs/libsdl2
+# >=media-libs/vulkan-loader-1.1.69
+#
+# Ditto for DEPEND
+# >=dev-util/vulkan-headers-1.1.69
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.3.25-enable-failed-mlock-warning.patch
+)
+
+pkg_setup() {
+ if use doc || use man ; then
+ python-any-r1_pkg_setup
+ fi
+}
+
+src_prepare() {
+ default
+
+ # Used for upstream backports
+ [[ -d "${FILESDIR}"/${PV} ]] && eapply "${FILESDIR}"/${PV}
+}
+
+multilib_src_configure() {
+ local logind=disabled
+ if multilib_is_native_abi ; then
+ if use systemd ; then
+ logind=enabled
+ elif use elogind ; then
+ logind=enabled
+ fi
+ fi
+
+ local emesonargs=(
+ -Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
+
+ $(meson_feature dbus)
+ $(meson_native_use_feature zeroconf avahi)
+ $(meson_native_use_feature doc docs)
+ $(meson_native_use_feature man)
+ $(meson_native_enabled examples) # TODO: Figure out if this is still important now that media-session gone
+ $(meson_feature test tests)
+ -Dinstalled_tests=disabled # Matches upstream; Gentoo never installs tests
+ $(meson_feature ieee1394 libffado)
+ $(meson_native_use_feature gstreamer)
+ $(meson_native_use_feature gstreamer gstreamer-device-provider)
+ $(meson_native_use_feature gsettings)
+ $(meson_native_use_feature systemd)
+ -Dlogind=${logind}
+ -Dlogind-provider=$(usex systemd 'libsystemd' 'libelogind')
+
+ $(meson_native_use_feature system-service systemd-system-service)
+ -Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)"
+ -Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
+
+ $(meson_native_use_feature systemd systemd-user-service)
+ $(meson_feature pipewire-alsa) # Allows integrating ALSA apps into PW graph
+ $(meson_feature selinux)
+ -Dspa-plugins=enabled
+ -Dalsa=enabled # Allows using kernel ALSA for sound I/O (NOTE: media-session is gone so IUSE=alsa/spa_alsa/alsa-backend might be possible)
+ -Dcompress-offload=disabled # TODO: tinycompress unpackaged
+ -Daudiomixer=enabled # Matches upstream
+ -Daudioconvert=enabled # Matches upstream
+ $(meson_native_use_feature bluetooth bluez5)
+ $(meson_native_use_feature bluetooth bluez5-backend-hsp-native)
+ $(meson_native_use_feature bluetooth bluez5-backend-hfp-native)
+ # https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1379
+ $(meson_native_use_feature modemmanager bluez5-backend-native-mm)
+ $(meson_native_use_feature bluetooth bluez5-backend-ofono)
+ $(meson_native_use_feature bluetooth bluez5-backend-hsphfpd)
+ $(meson_native_use_feature bluetooth bluez5-codec-aac)
+ $(meson_native_use_feature bluetooth bluez5-codec-aptx)
+ $(meson_native_use_feature bluetooth bluez5-codec-ldac)
+ $(meson_native_use_feature bluetooth opus)
+ $(meson_native_use_feature bluetooth bluez5-codec-opus)
+ $(meson_native_use_feature bluetooth libusb) # At least for now only used by bluez5 native (quirk detection of adapters)
+ $(meson_native_use_feature echo-cancel echo-cancel-webrtc) #807889
+ -Dcontrol=enabled # Matches upstream
+ -Daudiotestsrc=enabled # Matches upstream
+ -Dffmpeg=disabled # Disabled by upstream and no major developments to spa/plugins/ffmpeg/ since May 2020
+ $(meson_native_use_feature ffmpeg pw-cat-ffmpeg)
+ $(meson_native_use_feature flatpak)
+ -Dpipewire-jack=enabled # Allows integrating JACK apps into PW graph
+ $(meson_native_use_feature jack-client jack) # Allows PW to act as a JACK client
+ $(meson_use jack-sdk jack-devel)
+ $(usex jack-sdk "-Dlibjack-path=${EPREFIX}/usr/$(get_libdir)" '')
+ -Dsupport=enabled # Miscellaneous/common plugins, such as null sink
+ -Devl=disabled # Matches upstream
+ -Dtest=disabled # fakesink and fakesource plugins
+ -Dbluez5-codec-lc3plus=disabled # unpackaged
+ $(meson_native_use_feature liblc3 bluez5-codec-lc3)
+ $(meson_native_use_feature lv2)
+ $(meson_native_use_feature v4l v4l2)
+ -Dlibcamera=disabled # libcamera is not in Portage tree
+ $(meson_native_use_feature roc)
+ $(meson_native_use_feature readline)
+ $(meson_native_use_feature ssl raop)
+ -Dvideoconvert=enabled # Matches upstream
+ -Dvideotestsrc=enabled # Matches upstream
+ -Dvolume=enabled # Matches upstream
+ -Dvulkan=disabled # Uses pre-compiled Vulkan compute shader to provide a CGI video source (dev thing; disabled by upstream)
+ $(meson_native_use_feature extra pw-cat)
+ -Dudev=enabled
+ -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
+ -Dsdl2=disabled # Controls SDL2 dependent code (currently only examples when -Dinstalled_tests=enabled which we never install)
+ -Dlibmysofa=disabled # libmysofa is unpackaged
+ $(meson_native_use_feature extra sndfile) # Enables libsndfile dependent code (currently only pw-cat)
+ -Dsession-managers="[]" # All available session managers are now their own projects, so there's nothing to build
+
+ # We still have <5.16 kernels packaged in Gentoo and 6.1 (LTS) only
+ # just became stable, with 5.15 being the previous LTS. Many people
+ # are still on it.
+ -Dpam-defaults-install=true
+
+ # Just for bell sounds in X11 right now.
+ $(meson_native_use_feature X x11)
+ $(meson_native_use_feature X x11-xfixes)
+ $(meson_native_use_feature X libcanberra)
+
+ # TODO
+ -Dsnap=disabled
+ )
+
+ # This installs the schema file for pulseaudio-daemon, iff we are replacing
+ # the official sound-server
+ if use !sound-server; then
+ emesonargs+=( '-Dgsettings-pulse-schema=disabled' )
+ else
+ emesonargs+=(
+ $(meson_native_use_feature gsettings gsettings-pulse-schema)
+ )
+ fi
+
+ meson_src_configure
+}
+
+multilib_src_test() {
+ meson_src_test --timeout-multiplier 10
+}
+
+multilib_src_install() {
+ # Our custom DOCS do not exist in multilib source directory
+ DOCS= meson_src_install
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ if ! use man && [[ ${PIPEWIRE_DOCS_PREBUILT} == 1 ]] ; then
+ doman "${WORKDIR}"/${PN}-${PIPEWIRE_DOCS_VERSION}-docs/man/*/*.[0-8]
+ fi
+
+ if use pipewire-alsa; then
+ dodir /etc/alsa/conf.d
+
+ # Install pipewire conf loader hook
+ insinto /usr/share/alsa/alsa.conf.d
+ doins "${FILESDIR}"/99-pipewire-default-hook.conf
+ eprefixify "${ED}"/usr/share/alsa/alsa.conf.d/99-pipewire-default-hook.conf
+
+ # These will break if someone has /etc that is a symbolic link to a subfolder! See #724222
+ # And the current dosym8 -r implementation is likely affected by the same issue, too.
+ dosym ../../../usr/share/alsa/alsa.conf.d/50-pipewire.conf /etc/alsa/conf.d/50-pipewire.conf
+ dosym ../../../usr/share/alsa/alsa.conf.d/99-pipewire-default-hook.conf /etc/alsa/conf.d/99-pipewire-default-hook.conf
+ fi
+
+ # Enable required wireplumber alsa and bluez monitors
+ if use sound-server; then
+ # Install sound-server enabler for wireplumber 0.5.0+ conf syntax
+ insinto /etc/wireplumber/wireplumber.conf.d
+ doins "${FILESDIR}"/gentoo-sound-server-enable-audio-bluetooth.conf
+ fi
+
+ if use system-service; then
+ newtmpfiles - pipewire.conf <<-EOF || die
+ d /run/pipewire 0755 pipewire pipewire - -
+ EOF
+ fi
+
+ if ! use systemd; then
+ insinto /etc/xdg/autostart
+ newins "${FILESDIR}"/pipewire.desktop-r2 pipewire.desktop
+
+ exeinto /usr/bin
+ newexe "${FILESDIR}"/gentoo-pipewire-launcher.in-r3 gentoo-pipewire-launcher
+
+ doman "${FILESDIR}"/gentoo-pipewire-launcher.1
+
+ # Disable pipewire-pulse if sound-server is disabled.
+ if ! use sound-server ; then
+ sed -i -s '/pipewire -c pipewire-pulse.conf/s/^/#/' "${ED}"/usr/bin/gentoo-pipewire-launcher || die
+ fi
+
+ eprefixify "${ED}"/usr/bin/gentoo-pipewire-launcher
+ fi
+}
+
+pkg_postrm() {
+ udev_reload
+}
+
+pkg_preinst() {
+ HAD_SOUND_SERVER=0
+ HAD_SYSTEM_SERVICE=0
+
+ if has_version "media-video/pipewire[sound-server(-)]" ; then
+ HAD_SOUND_SERVER=1
+ fi
+
+ if has_version "media-video/pipewire[system-service(-)]" ; then
+ HAD_SYSTEM_SERVICE=1
+ fi
+}
+
+pkg_postinst() {
+ udev_reload
+
+ use system-service && tmpfiles_process pipewire.conf
+
+ local ver
+ for ver in ${REPLACING_VERSIONS} ; do
+ if has_version kde-plasma/kwin[screencast] || has_version x11-wm/mutter[screencast] ; then
+ # https://bugs.gentoo.org/908490
+ # https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3243
+ ewarn "Please restart KWin/Mutter after upgrading PipeWire."
+ ewarn "Screencasting may not work until you do."
+ fi
+
+ if ver_test ${ver} -le 0.3.66-r1 ; then
+ elog ">=pipewire-0.3.66 uses the 'pipewire' group to manage permissions"
+ elog "and limits needed to function smoothly:"
+ elog
+ elog "1. Please make sure your user is in the 'pipewire' group for"
+ elog "the best experience with realtime scheduling (PAM limits behavior)!"
+ elog "You can add your account with:"
+ elog " usermod -aG pipewire <youruser>"
+ elog
+ elog "2. For the best experience with fast user switching, it is recommended"
+ elog "that you remove your user from the 'audio' group unless you rely on the"
+ elog "audio group for device access control or ACLs.:"
+ elog " usermod -rG audio <youruser>"
+ elog
+
+ if ! use jack-sdk ; then
+ elog
+ elog "JACK emulation is incomplete and not all programs will work. PipeWire's"
+ elog "alternative libraries have been installed to a non-default location."
+ elog "To use them, put pw-jack <application> before every JACK application."
+ elog "When using pw-jack, do not run jackd/jackdbus. However, a virtual/jack"
+ elog "provider is still needed to compile the JACK applications themselves."
+ elog
+ fi
+
+ if use systemd ; then
+ ewarn
+ ewarn "PipeWire daemon startup has been moved to a launcher script!"
+ ewarn "Make sure that ${EROOT}/etc/pipewire/pipewire.conf either does not exist or no"
+ ewarn "longer is set to start a session manager or PulseAudio compatibility daemon (all"
+ ewarn "lines similar to '{ path = /usr/bin/pipewire*' should be commented out)"
+ ewarn
+ ewarn "Those manually starting /usr/bin/pipewire via .xinitrc or similar _must_ from"
+ ewarn "now on start ${EROOT}/usr/bin/gentoo-pipewire-launcher instead! It is highly"
+ ewarn "advised that a D-Bus user session is set up before starting the script."
+ ewarn
+ fi
+
+ if use sound-server && ( has_version 'media-sound/pulseaudio[daemon]' || has_version 'media-sound/pulseaudio-daemon' ) ; then
+ elog
+ elog "This ebuild auto-enables PulseAudio replacement. Because of that, users"
+ elog "are recommended to edit pulseaudio client configuration files:"
+ elog "${EROOT}/etc/pulse/client.conf and ${EROOT}/etc/pulse/client.conf.d/enable-autospawn.conf"
+ elog "if it exists, and disable autospawning of the original daemon by setting:"
+ elog
+ elog " autospawn = no"
+ elog
+ elog "Please note that the semicolon (;) must _NOT_ be at the beginning of the line!"
+ elog
+ elog "Alternatively, if replacing PulseAudio daemon is not desired, edit"
+ elog "${EROOT}/usr/bin/gentoo-pipewire-launcher by commenting out the relevant"
+ elog "command:"
+ elog
+ elog "#${EROOT}/usr/bin/pipewire -c pipewire-pulse.conf &"
+ elog
+ fi
+
+ if has_version 'net-misc/ofono' ; then
+ ewarn "Native backend has become default. Please disable oFono via:"
+ if systemd_is_booted ; then
+ ewarn "systemctl disable ofono"
+ else
+ ewarn "rc-update delete ofono"
+ fi
+ fi
+ fi
+ done
+
+ if [[ ${HAD_SOUND_SERVER} -eq 0 || -z ${REPLACING_VERSIONS} ]] ; then
+ # TODO: We could drop most of this if we set up systemd presets?
+ # They're worth looking into because right now, the out-of-the-box experience
+ # is automatic on OpenRC, while it needs manual intervention on systemd.
+ if use sound-server && use systemd ; then
+ elog
+ elog "When switching from PulseAudio, you may need to disable PulseAudio:"
+ elog
+ elog " systemctl --user disable pulseaudio.service pulseaudio.socket"
+ elog
+ elog "To use PipeWire, the user units must be manually enabled"
+ elog "by running this command as each user you use for desktop activities:"
+ elog
+ elog " systemctl --user enable pipewire.socket pipewire-pulse.socket"
+ elog
+ elog "A reboot is recommended to avoid interferences from still running"
+ elog "PulseAudio daemon."
+ elog
+ elog "Both new users and those upgrading need to enable WirePlumber"
+ elog "for relevant users:"
+ elog
+ elog " systemctl --user disable pipewire-media-session.service"
+ elog " systemctl --user --force enable wireplumber.service"
+ elog
+ elog "Root user may replace --user with --global to change system default"
+ elog "configuration for all of the above commands."
+ elog
+ fi
+
+ if ! use sound-server ; then
+ ewarn
+ ewarn "USE=sound-server is disabled! If you want PipeWire to provide"
+ ewarn "your sound, please enable it. See the wiki at"
+ ewarn "https://wiki.gentoo.org/wiki/PipeWire#Replacing_PulseAudio"
+ ewarn "for more details."
+ ewarn
+ fi
+ fi
+
+ if use system-service && [[ ${HAD_SYSTEM_SERVICE} -eq 0 || -z ${REPLACING_VERSIONS} ]] ; then
+ ewarn
+ ewarn "You have enabled the system-service USE flag, which installs"
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system"
+ ewarn "service. This is more than likely NOT what you want. You are strongly"
+ ewarn "advised not to enable this mode and instead stick with systemd user"
+ ewarn "units. The default configuration files will likely not work out of the"
+ ewarn "box, and you are on your own with configuration."
+ ewarn
+ fi
+
+ elog "For latest tips and tricks, troubleshooting information, and documentation"
+ elog "in general, please refer to https://wiki.gentoo.org/wiki/PipeWire"
+ elog
+
+ optfeature_header "The following can be installed for optional runtime features:"
+ optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
+
+ if use sound-server && ! use pipewire-alsa; then
+ optfeature "ALSA plugin to use PulseAudio interface for output" "media-plugins/alsa-plugins[pulseaudio]"
+ fi
+}
diff --git a/media-video/pipewire/pipewire-1.2.7.ebuild b/media-video/pipewire/pipewire-1.2.7.ebuild
index 63b0b609e159..bcfeeafff3df 100644
--- a/media-video/pipewire/pipewire-1.2.7.ebuild
+++ b/media-video/pipewire/pipewire-1.2.7.ebuild
@@ -188,7 +188,7 @@ src_prepare() {
default
# Used for upstream backports
- [[ -d "${FILESDIR}"/${PV} ]] && eapply "${FILESDIR}"/${PV}
+ #[[ -d "${FILESDIR}"/${PV} ]] && eapply "${FILESDIR}"/${PV}
}
multilib_src_configure() {