浏览代码

project: Migrate PipeWire capture into linux-pipewire

The capture ids are preserved, so that it's compatible with the
previous code. No code changes were necessary whatsoever.
Georges Basile Stavracas Neto 4 年之前
父节点
当前提交
a147315f33
共有 52 个文件被更改,包括 47 次插入271 次删除
  1. 0 35
      plugins/linux-capture/CMakeLists.txt
  2. 0 5
      plugins/linux-capture/data/locale/ar-SA.ini
  3. 0 5
      plugins/linux-capture/data/locale/bn-BD.ini
  4. 0 5
      plugins/linux-capture/data/locale/ca-ES.ini
  5. 0 5
      plugins/linux-capture/data/locale/cs-CZ.ini
  6. 0 5
      plugins/linux-capture/data/locale/da-DK.ini
  7. 0 5
      plugins/linux-capture/data/locale/de-DE.ini
  8. 0 5
      plugins/linux-capture/data/locale/el-GR.ini
  9. 0 5
      plugins/linux-capture/data/locale/en-US.ini
  10. 0 5
      plugins/linux-capture/data/locale/es-ES.ini
  11. 0 3
      plugins/linux-capture/data/locale/eu-ES.ini
  12. 0 5
      plugins/linux-capture/data/locale/fa-IR.ini
  13. 0 5
      plugins/linux-capture/data/locale/fi-FI.ini
  14. 0 5
      plugins/linux-capture/data/locale/fil-PH.ini
  15. 0 5
      plugins/linux-capture/data/locale/fr-FR.ini
  16. 0 5
      plugins/linux-capture/data/locale/gd-GB.ini
  17. 0 5
      plugins/linux-capture/data/locale/he-IL.ini
  18. 0 5
      plugins/linux-capture/data/locale/hi-IN.ini
  19. 0 5
      plugins/linux-capture/data/locale/hu-HU.ini
  20. 0 5
      plugins/linux-capture/data/locale/id-ID.ini
  21. 0 5
      plugins/linux-capture/data/locale/it-IT.ini
  22. 0 5
      plugins/linux-capture/data/locale/ja-JP.ini
  23. 0 5
      plugins/linux-capture/data/locale/ka-GE.ini
  24. 0 5
      plugins/linux-capture/data/locale/kmr-TR.ini
  25. 0 5
      plugins/linux-capture/data/locale/ko-KR.ini
  26. 0 5
      plugins/linux-capture/data/locale/ms-MY.ini
  27. 0 5
      plugins/linux-capture/data/locale/nb-NO.ini
  28. 0 5
      plugins/linux-capture/data/locale/nl-NL.ini
  29. 0 5
      plugins/linux-capture/data/locale/pl-PL.ini
  30. 0 5
      plugins/linux-capture/data/locale/pt-BR.ini
  31. 0 5
      plugins/linux-capture/data/locale/pt-PT.ini
  32. 0 5
      plugins/linux-capture/data/locale/ro-RO.ini
  33. 0 5
      plugins/linux-capture/data/locale/ru-RU.ini
  34. 0 5
      plugins/linux-capture/data/locale/sk-SK.ini
  35. 0 5
      plugins/linux-capture/data/locale/sl-SI.ini
  36. 0 5
      plugins/linux-capture/data/locale/sv-SE.ini
  37. 0 5
      plugins/linux-capture/data/locale/szl-PL.ini
  38. 0 5
      plugins/linux-capture/data/locale/tr-TR.ini
  39. 0 5
      plugins/linux-capture/data/locale/uk-UA.ini
  40. 0 4
      plugins/linux-capture/data/locale/vi-VN.ini
  41. 0 5
      plugins/linux-capture/data/locale/zh-CN.ini
  42. 0 5
      plugins/linux-capture/data/locale/zh-TW.ini
  43. 1 20
      plugins/linux-capture/linux-capture.c
  44. 27 4
      plugins/linux-pipewire/CMakeLists.txt
  45. 5 0
      plugins/linux-pipewire/data/locale/en-US.ini
  46. 14 0
      plugins/linux-pipewire/linux-pipewire.c
  47. 0 9
      plugins/linux-pipewire/pipewire-capture.c
  48. 0 1
      plugins/linux-pipewire/pipewire-capture.h
  49. 0 0
      plugins/linux-pipewire/pipewire.c
  50. 0 0
      plugins/linux-pipewire/pipewire.h
  51. 0 0
      plugins/linux-pipewire/portal.c
  52. 0 0
      plugins/linux-pipewire/portal.h

+ 0 - 35
plugins/linux-capture/CMakeLists.txt

@@ -1,10 +1,5 @@
 project(linux-capture)
 
-option(ENABLE_PIPEWIRE "Enable PipeWire support" ON)
-if(NOT ENABLE_PIPEWIRE)
-  message(STATUS "OBS:    -        PipeWire support disabled")
-endif()
-
 find_package(X11 REQUIRED)
 if(NOT TARGET X11::Xcomposite)
   message(
@@ -46,34 +41,4 @@ target_link_libraries(
 
 set_target_properties(linux-capture PROPERTIES FOLDER "plugins")
 
-if(ENABLE_PIPEWIRE)
-  find_package(PipeWire 0.3.32 QUIET)
-  find_package(Gio QUIET)
-  find_package(Libdrm QUIET)
-
-  if(NOT TARGET PipeWire::PipeWire)
-    message(
-      FATAL_ERROR
-        "OBS:    -        PipeWire library not found! Please install PipeWire or set ENABLE_PIPEWIRE=OFF"
-    )
-  elseif(NOT TARGET GIO::GIO)
-    message(
-      FATAL_ERROR
-        "OBS:    -        Gio library not found! Please install GLib2 (or Gio) or set ENABLE_PIPEWIRE=OFF"
-    )
-  elseif(NOT TARGET Libdrm::Libdrm)
-    message(
-      FATAL_ERROR
-        "OBS:    -        libdrm headers not found! Please install libdrm or set ENABLE_PIPEWIRE=OFF"
-    )
-  endif()
-
-  target_sources(linux-capture PRIVATE pipewire.c pipewire.h pipewire-capture.c
-                                       pipewire-capture.h portal.c portal.h)
-
-  target_link_libraries(linux-capture PRIVATE PipeWire::PipeWire GIO::GIO
-                                              Libdrm::Libdrm)
-  target_compile_definitions(linux-capture PRIVATE ENABLE_PIPEWIRE)
-endif()
-
 setup_plugin_target(linux-capture)

+ 0 - 5
plugins/linux-capture/data/locale/ar-SA.ini

@@ -11,8 +11,3 @@ CropBottom="الاقتطاع من الأسفل (بكسل)"
 SwapRedBlue="مبادلة بين الأحمر و الأزرق"
 LockX="قفل السيرفر X عند الالتقاط"
 IncludeXBorder="تضمين حواف X"
-PipeWireDesktopCapture="التقاط الشاشة (PipeWire)"
-PipeWireSelectMonitor="حدد المراقب"
-PipeWireSelectWindow="حدد نافذة"
-PipeWireWindowCapture="التقاط الشاشة (PipeWire)"
-ShowCursor="إظهار المؤشر"

+ 0 - 5
plugins/linux-capture/data/locale/bn-BD.ini

@@ -13,8 +13,3 @@ SwapRedBlue="লাল এবং নীল রঙের অদলবদল ক
 LockX="ক্যাপচার করার সময় এক্স সার্ভার লক করুন"
 IncludeXBorder="এক্স বর্ডার অন্তর্ভুক্ত করুন"
 ExcludeAlpha="আলফা-কম গঠন বিন্যাস (মেসা পরামর্শ) ব্যবহার করুন"
-PipeWireDesktopCapture="স্ক্রিন ক্যাপচার (PipeWire)"
-PipeWireSelectMonitor="মনিটর নির্বাচন করুন"
-PipeWireSelectWindow="উইন্ডো নির্বাচন করুন"
-PipeWireWindowCapture="উইন্ডো ক্যাপচার (PipeWire)"
-ShowCursor="কার্সার দেখান"

+ 0 - 5
plugins/linux-capture/data/locale/ca-ES.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Intercanvia els colors vermell i blau"
 LockX="Bloca el servidor X quan s'estigui capturant"
 IncludeXBorder="Inclou-hi la vora X"
 ExcludeAlpha="Usar format de textura sense alpha (solució de Mesa)"
-PipeWireDesktopCapture="Captura de pantalla (PipeWire)"
-PipeWireSelectMonitor="Seleccioneu el monitor"
-PipeWireSelectWindow="Seleccioneu la finestra"
-PipeWireWindowCapture="Captura de finestres (PipeWire)"
-ShowCursor="Mostra el cursor"

+ 0 - 5
plugins/linux-capture/data/locale/cs-CZ.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Prohodit červenou a modrou"
 LockX="Zamknout server X při záznamu"
 IncludeXBorder="Zahrnout hranice X"
 ExcludeAlpha="Použít formát textury bez alpha kanálu (Mesa workaround)"
-PipeWireDesktopCapture="Záznam obrazovky (PipeWire)"
-PipeWireSelectMonitor="Vybrat monitor"
-PipeWireSelectWindow="Vybrat okno"
-PipeWireWindowCapture="Záznam okna (PipeWire)"
-ShowCursor="Zobrazit kurzor"

+ 0 - 5
plugins/linux-capture/data/locale/da-DK.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Ombyt rød og blå"
 LockX="Lås X server under optagelse"
 IncludeXBorder="Inkludér X-kant"
 ExcludeAlpha="Benyt alpha-fri teksturformat (Mesa løsning)"
-PipeWireDesktopCapture="Skærmoptagelse (PipeWire)"
-PipeWireSelectMonitor="Vælg skærm"
-PipeWireSelectWindow="Vælg vindue"
-PipeWireWindowCapture="Vindueoptagelse (PipeWire)"
-ShowCursor="Vis markør"

+ 0 - 5
plugins/linux-capture/data/locale/de-DE.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Rot und Blau tauschen"
 LockX="X-Server während der Aufnahme fixieren"
 IncludeXBorder="X-Rahmen anzeigen"
 ExcludeAlpha="Alphaloses Texturformat verwenden (Mesa-Problemumgehung)"
-PipeWireDesktopCapture="Bildschirmaufnahme (PipeWire)"
-PipeWireSelectMonitor="Bildschirm auswählen"
-PipeWireSelectWindow="Fenster auswählen"
-PipeWireWindowCapture="Fensteraufname (PipeWire)"
-ShowCursor="Mauszeiger anzeigen"

+ 0 - 5
plugins/linux-capture/data/locale/el-GR.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Ανταλλαγή κόκκινου και μπλέ"
 LockX="Κλείδωμα X server κατά την σύλληψη"
 IncludeXBorder="Περίλαβε το περίγραμμα του X"
 ExcludeAlpha="Χρησιμοποίηση της μορφής υφής χωρίς άλφα (Λύση για Mesa)"
-PipeWireDesktopCapture="Καταγραφή Οθόνης (PipeWire)"
-PipeWireSelectMonitor="Επιλογή Οθόνης"
-PipeWireSelectWindow="Επιλέξτε παράθυρο"
-PipeWireWindowCapture="Καταγραφή Παραθύρου (PipeWire)"
-ShowCursor="Εμφάνιση Δρομέα"

+ 0 - 5
plugins/linux-capture/data/locale/en-US.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Swap red and blue"
 LockX="Lock X server when capturing"
 IncludeXBorder="Include X Border"
 ExcludeAlpha="Use alpha-less texture format (Mesa workaround)"
-PipeWireDesktopCapture="Screen Capture (PipeWire)"
-PipeWireSelectMonitor="Select Monitor"
-PipeWireSelectWindow="Select Window"
-PipeWireWindowCapture="Window Capture (PipeWire)"
-ShowCursor="Show Cursor"

+ 0 - 5
plugins/linux-capture/data/locale/es-ES.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Intercambiar rojo y azúl"
 LockX="Fijar X server mientras se captura"
 IncludeXBorder="Incluir borde de ventana X"
 ExcludeAlpha="Usar formato de textura sin alpha (Arreglo para Mesa)"
-PipeWireDesktopCapture="Captura de pantalla (PipeWire)"
-PipeWireSelectMonitor="Seleccionar monitor"
-PipeWireSelectWindow="Seleccionar ventana"
-PipeWireWindowCapture="Captura de ventana (PipeWire)"
-ShowCursor="Mostrar cursor"

+ 0 - 3
plugins/linux-capture/data/locale/eu-ES.ini

@@ -13,6 +13,3 @@ SwapRedBlue="Aldatu gorria eta urdina"
 LockX="Blokeatu X zerbitzaria kapturatzean"
 IncludeXBorder="Sartu X ertza"
 ExcludeAlpha="Alfarik gabeko testura formatua (Mesarako konponbidea)"
-PipeWireSelectMonitor="Pantalla hautatu"
-PipeWireSelectWindow="Lehioa hautatu"
-ShowCursor="Kurtsorea erakutsi"

+ 0 - 5
plugins/linux-capture/data/locale/fa-IR.ini

@@ -13,8 +13,3 @@ SwapRedBlue="قرمز و آبی را تعویض کنید"
 LockX="سرور اکس قفل هنگام گرفتن"
 IncludeXBorder="شامل X مرز"
 ExcludeAlpha="استفاده از فرمت های بافت آلفا کمتر (مسا حلی)"
-PipeWireDesktopCapture="ضبط صفحه (سیم لوله)"
-PipeWireSelectMonitor="انتخاب نمایشگر"
-PipeWireSelectWindow="انتخاب پنجره"
-PipeWireWindowCapture="ضبط پنجره (PipeWire)"
-ShowCursor="نمایش مکان نما"

+ 0 - 5
plugins/linux-capture/data/locale/fi-FI.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Vaihda punainen ja sininen"
 LockX="Lukitse X Server kaappauksen aikana"
 IncludeXBorder="Sisällytä X-reunus"
 ExcludeAlpha="Käytä tekstuuriformaattia ilman alpha-kanavaa (Mesa-yhteensopiva)"
-PipeWireDesktopCapture="Näytönkaappaus (PipeWire)"
-PipeWireSelectMonitor="Valitse näyttö"
-PipeWireSelectWindow="Valitse ikkuna"
-PipeWireWindowCapture="Ikkunankaappaus (PipeWire)"
-ShowCursor="Näytä kursori"

+ 0 - 5
plugins/linux-capture/data/locale/fil-PH.ini

@@ -9,8 +9,3 @@ SwapRedBlue="Magpalit ng pula at asul"
 LockX="Lock X server kapag nakukuha"
 IncludeXBorder="Isama ang X Border"
 ExcludeAlpha="Gumamit ng alpha-less texture na format (Mesa workaround)"
-PipeWireDesktopCapture="Pagkuha ng Window (PipeWire)"
-PipeWireSelectMonitor="Pumili ng Tabing"
-PipeWireSelectWindow="Pumili ng Window"
-PipeWireWindowCapture="Pagkuha ng Window (PipeWire)"
-ShowCursor="Ipakita ang Cursor"

+ 0 - 5
plugins/linux-capture/data/locale/fr-FR.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Intervertir le rouge et le bleu"
 LockX="Verrouiller le serveur X lors de la capture"
 IncludeXBorder="Inclure la bordure de la fenêtre X"
 ExcludeAlpha="Utiliser un format de texture sans alpha (palliatif pour Mesa)"
-PipeWireDesktopCapture="Capture d'écran (PipeWire)"
-PipeWireSelectMonitor="Sélectionner l'écran"
-PipeWireSelectWindow="Sélectionner la fenêtre"
-PipeWireWindowCapture="Capture de fenêtre (PipeWire)"
-ShowCursor="Afficher le curseur"

+ 0 - 5
plugins/linux-capture/data/locale/gd-GB.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Suaip dearg is gorm"
 LockX="Glais am frithealaiche X rè a’ ghlacaidh"
 IncludeXBorder="Gabh a-steach an t-iomall X"
 ExcludeAlpha="Cleachd fòrmat innich gun alpha (seachnadh buga Mesa)"
-PipeWireDesktopCapture="Glacadh-sgrìn (PipeWire)"
-PipeWireSelectMonitor="Tagh sgrìn"
-PipeWireSelectWindow="Tagh uinneag"
-PipeWireWindowCapture="Glacadh uinneige (PipeWire)"
-ShowCursor="Seall an cùrsair"

+ 0 - 5
plugins/linux-capture/data/locale/he-IL.ini

@@ -13,8 +13,3 @@ SwapRedBlue="החלף אדום וכחול"
 LockX="נעל שרת X בעת לכידה"
 IncludeXBorder="כלול קצה שרת X"
 ExcludeAlpha="השתמש בתבנית מרקם ללא אלפא (עקיפת בעיית Mesa)"
-PipeWireDesktopCapture="לכידת מסך (PipeWire)"
-PipeWireSelectMonitor="בחירת צג"
-PipeWireSelectWindow="בחירת חלון"
-PipeWireWindowCapture="לכידת חלון (PipeWire)"
-ShowCursor="הצגת הסמן"

+ 0 - 5
plugins/linux-capture/data/locale/hi-IN.ini

@@ -13,8 +13,3 @@ SwapRedBlue="लाल व नीला अदला-बदली करें"
 LockX="कैप्चर करते समय X सर्वर को लॉक करें"
 IncludeXBorder="X बॉर्डर शामिल करें"
 ExcludeAlpha="अल्फा-लेस प्रारूप का उपयोग करें (Mesa वर्कअराउंड)"
-PipeWireDesktopCapture="स्क्रीन कैप्चर (PipeWire)"
-PipeWireSelectMonitor="मॉनिटर चुनें"
-PipeWireSelectWindow="विंडो चुनें"
-PipeWireWindowCapture="विंडो कैप्चर (PipeWire)"
-ShowCursor="कर्सर दिखाएं"

+ 0 - 5
plugins/linux-capture/data/locale/hu-HU.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Piros és kék cseréje"
 LockX="X Szerver zárolása rögzítéskor"
 IncludeXBorder="X Kerettel"
 ExcludeAlpha="Alfa-mentesebb textúra formátum használata (Mesa áthidalás)"
-PipeWireDesktopCapture="Képernyőfelvétel (PipeWire)"
-PipeWireSelectMonitor="Monitor kiválasztása"
-PipeWireSelectWindow="Ablak kiválasztása"
-PipeWireWindowCapture="Ablak felvétel (PipeWire)"
-ShowCursor="Kurzor megjelenítése"

+ 0 - 5
plugins/linux-capture/data/locale/id-ID.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Tukar merah dan biru"
 LockX="Kunci X server saat menangkap gambar"
 IncludeXBorder="Sertakan X Border"
 ExcludeAlpha="Gunakan format tekstur alpha-less (Solusi mesa)"
-PipeWireDesktopCapture="Penangkap Layar (PipeWire)"
-PipeWireSelectMonitor="Pilih Monitor"
-PipeWireSelectWindow="Pilih Jendela"
-PipeWireWindowCapture="Penangkap Jendela (PipeWire)"
-ShowCursor="Tampilkan Kursor"

+ 0 - 5
plugins/linux-capture/data/locale/it-IT.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Inverti i colori rosso e blu"
 LockX="Blocca X Server durante la cattura"
 IncludeXBorder="Includi i bordi della finestra X"
 ExcludeAlpha="Utilizza il formato alfa-less per le texture (soluzione di Mesa)"
-PipeWireDesktopCapture="Cattura Schermo (PipeWire)"
-PipeWireSelectMonitor="Seleziona Monitor"
-PipeWireSelectWindow="Seleziona finestra"
-PipeWireWindowCapture="Cattura Finestra (PipeWire)"
-ShowCursor="Mostra Cursore"

+ 0 - 5
plugins/linux-capture/data/locale/ja-JP.ini

@@ -13,8 +13,3 @@ SwapRedBlue="赤と青を入れ替え"
 LockX="キャプチャ時にXサーバーをロック"
 IncludeXBorder="Xウィンドウの境界を含める"
 ExcludeAlpha="アルファなしテクスチャ形式を使用 (Mesaの回避策)"
-PipeWireDesktopCapture="スクリーンキャプチャ (PipeWire)"
-PipeWireSelectMonitor="モニターを選択"
-PipeWireSelectWindow="ウィンドウを選択"
-PipeWireWindowCapture="ウィンドウキャプチャ (PipeWire)"
-ShowCursor="カーソルを表示"

+ 0 - 5
plugins/linux-capture/data/locale/ka-GE.ini

@@ -13,8 +13,3 @@ SwapRedBlue="წითლისა ლურჯის შენაცვლე
 LockX="X სერვერის შეზღუდვა გადაღებისას"
 IncludeXBorder="X ჩარჩოიანად"
 ExcludeAlpha="გაუმჭვირვალე ზედაპირის გამოყენება (Mesa-ს ხარვეზის მოსაგვარებლად)"
-PipeWireDesktopCapture="ეკრანის გადაღება (PipeWire)"
-PipeWireSelectMonitor="მონიტორის არჩევა"
-PipeWireSelectWindow="ფანჯრის არჩევა"
-PipeWireWindowCapture="ფანჯრის გადაღება (PipeWire)"
-ShowCursor="მაჩვენებლის გამოჩენა"

+ 0 - 5
plugins/linux-capture/data/locale/kmr-TR.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Sor û şîn biguherîne"
 LockX="Rejakarê X bigire gava tê girtin"
 IncludeXBorder="Sînorê X têxe nav"
 ExcludeAlpha="Formata tevna alfa-kêm bi kar bîne (çareserkirina mesa)"
-PipeWireDesktopCapture="Giritina diîmenderê (PipeWire)"
-PipeWireSelectMonitor="Dîmenderê hilbijêre"
-PipeWireSelectWindow="Çarçoveyê hilbijêre"
-PipeWireWindowCapture="Girtina çarçoveyê (PipeWire)"
-ShowCursor="Nîşankerê nîşan bide"

+ 0 - 5
plugins/linux-capture/data/locale/ko-KR.ini

@@ -13,8 +13,3 @@ SwapRedBlue="적청 교환"
 LockX="캡쳐 시 X 서버를 잠금"
 IncludeXBorder="X 윈도우 경계를 포함"
 ExcludeAlpha="알파가 없는 텍스쳐 형식 사용 (Mesa 방법)"
-PipeWireDesktopCapture="화면 녹화(PipeWire)"
-PipeWireSelectMonitor="화면 선택"
-PipeWireSelectWindow="창 선택"
-PipeWireWindowCapture="창 녹화(PipeWire)"
-ShowCursor="포인터 표시"

+ 0 - 5
plugins/linux-capture/data/locale/ms-MY.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Silih merah dan biru"
 LockX="Kunci pelayan X ketika menangkap"
 IncludeXBorder="Sertakan Sempadan X"
 ExcludeAlpha="Guna format tektsur kurang-alfa (Penyelesaian Mesa)"
-PipeWireDesktopCapture="Tangkap Skrin (PipeWire)"
-PipeWireSelectMonitor="Pilih Monitor"
-PipeWireSelectWindow="Pilih Tetingkap"
-PipeWireWindowCapture="Tangkap Tetingkap (PipeWire)"
-ShowCursor="Tunjuk Kursor"

+ 0 - 5
plugins/linux-capture/data/locale/nb-NO.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Bytt rød og blå"
 LockX="Lås X-tjener under opptak"
 IncludeXBorder="Inkludér X11-rammen"
 ExcludeAlpha="Bruk teksturformat uten alfakanal (Mesa løsning)"
-PipeWireDesktopCapture="Skjermopptak (PipeWire)"
-PipeWireSelectMonitor="Velg skjerm"
-PipeWireSelectWindow="Velg vindu"
-PipeWireWindowCapture="Vindusopptak (PipeWire)"
-ShowCursor="Vis musepekeren"

+ 0 - 5
plugins/linux-capture/data/locale/nl-NL.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Rood en blauw omwisselen"
 LockX="X server vergrendelen tijdens het opnemen"
 IncludeXBorder="Inclusief X-schermranden"
 ExcludeAlpha="Gebruik textuurformaat zonder alpha (alternatief voor Mesa)"
-PipeWireDesktopCapture="Schermopname (PipeWire)"
-PipeWireSelectMonitor="Beeldscherm selecteren"
-PipeWireSelectWindow="Venster selecteren"
-PipeWireWindowCapture="Vensteropname (PipeWire)"
-ShowCursor="Cursor Weergeven"

+ 0 - 5
plugins/linux-capture/data/locale/pl-PL.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Zamień czerwony i niebieski"
 LockX="Zablokuj serwer X podczas przechwytywania"
 IncludeXBorder="Dołącz ramkę okna"
 ExcludeAlpha="Użyj tekstur bez kanału alpha (obejście problemu Mesa)"
-PipeWireDesktopCapture="Przechwytywanie ekranu (PipeWire)"
-PipeWireSelectMonitor="Wybierz monitor"
-PipeWireSelectWindow="Wybierz okno"
-PipeWireWindowCapture="Przechwytywanie okna (PipeWire)"
-ShowCursor="Pokaż kursor"

+ 0 - 5
plugins/linux-capture/data/locale/pt-BR.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Trocar Vermelho com Azul"
 LockX="Bloquear servidor X durante a captura"
 IncludeXBorder="Incluir X Borda"
 ExcludeAlpha="Utilizar formato de texture sem Alpha (solução para Mesa)"
-PipeWireDesktopCapture="Captura de tela (PipeWire)"
-PipeWireSelectMonitor="Selecionar monitor"
-PipeWireSelectWindow="Selecionar janela"
-PipeWireWindowCapture="Captura de janela (PipeWire)"
-ShowCursor="Mostrar o cursor"

+ 0 - 5
plugins/linux-capture/data/locale/pt-PT.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Trocar vermelho e azul"
 LockX="Bloquear X Server durante a captura"
 IncludeXBorder="Incluir contorno da janela X"
 ExcludeAlpha="Utilizar um formato de textura sem Alfa (solução de Mesa)"
-PipeWireDesktopCapture="Captura de ecrã (PipeWire)"
-PipeWireSelectMonitor="Selecionar monitor"
-PipeWireSelectWindow="Selecionar janela"
-PipeWireWindowCapture="Captura de janela (PipeWire)"
-ShowCursor="Mostrar cursor"

+ 0 - 5
plugins/linux-capture/data/locale/ro-RO.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Schimbă roșu cu albastru"
 LockX="Blochează X server când se capturează"
 IncludeXBorder="Include marginea cu X"
 ExcludeAlpha="Folosește formatul de texturi fără alpha (soluție de evitare pentru Mesa)"
-PipeWireDesktopCapture="Captură de ecran (PipeWire)"
-PipeWireSelectMonitor="Selectează monitorul"
-PipeWireSelectWindow="Selectează fereastra"
-PipeWireWindowCapture="Captură de fereastră (PipeWire)"
-ShowCursor="Afișează cursorul"

+ 0 - 5
plugins/linux-capture/data/locale/ru-RU.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Поменять местами красный и синий"
 LockX="Блокировать X-сервер при захвате"
 IncludeXBorder="Включить захват границы"
 ExcludeAlpha="Использовать формат текстур без прозрачности (обходной путь для Mesa)"
-PipeWireDesktopCapture="Захват экрана (PipeWire)"
-PipeWireSelectMonitor="Выбрать окно"
-PipeWireSelectWindow="Выбрать окно"
-PipeWireWindowCapture="Захват окна (PipeWire)"
-ShowCursor="Показывать курсор"

+ 0 - 5
plugins/linux-capture/data/locale/sk-SK.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Vymeniť červenú a modrú"
 LockX="Zamknúť X server počas snímania"
 IncludeXBorder="Zahŕňajú X okraj"
 ExcludeAlpha="Použiť formát textúry bez alpha kanálu (riešenie pre Mesa problém)"
-PipeWireDesktopCapture="Zachytávanie obrazovky (PipeWire)"
-PipeWireSelectMonitor="Vybrať monitor"
-PipeWireSelectWindow="Vybrať okno"
-PipeWireWindowCapture="Zachytávanie okna (PipeWire)"
-ShowCursor="Zobraziť kurzor"

+ 0 - 5
plugins/linux-capture/data/locale/sl-SI.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Zamenjaj modro in rdečo"
 LockX="Zakleni X sstrežnik med zajemanjem"
 IncludeXBorder="Vključi obrobo X"
 ExcludeAlpha="Uporabi format za teksture, ki je brez alfa kanala (Mesa obvod)"
-PipeWireDesktopCapture="Zajem zaslona (PipeWire)"
-PipeWireSelectMonitor="Izbira zaslona"
-PipeWireSelectWindow="Izbira okna"
-PipeWireWindowCapture="Zajem okna (PipeWire)"
-ShowCursor="Prikaži kurzor"

+ 0 - 5
plugins/linux-capture/data/locale/sv-SE.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Byt röd och blå"
 LockX="Lås X-servern medan källan är aktiv"
 IncludeXBorder="Inkludera X Border"
 ExcludeAlpha="Använd alfalöst texturformat (lösning för Mesa)"
-PipeWireDesktopCapture="Skärmkälla (PipeWire)"
-PipeWireSelectMonitor="Välj bildskärm"
-PipeWireSelectWindow="Välj fönster"
-PipeWireWindowCapture="Fönsterkälla (PipeWire)"
-ShowCursor="Visa muspekare"

+ 0 - 5
plugins/linux-capture/data/locale/szl-PL.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Umiyń czyrwōny i modry"
 LockX="Zaszperuj serwer X w czasie chytanio"
 IncludeXBorder="Dołōncz rōmka ôkna"
 ExcludeAlpha="Użyj tekstur bez kanału alpha (ôbyńście problymu Mesa)"
-PipeWireDesktopCapture="Chytanie ekranu (PipeWire)"
-PipeWireSelectMonitor="Ôbier mōnitōr"
-PipeWireSelectWindow="Ôbier ôkno"
-PipeWireWindowCapture="Chytanie ôkna (PipeWire)"
-ShowCursor="Pokoż kursōr"

+ 0 - 5
plugins/linux-capture/data/locale/tr-TR.ini

@@ -13,8 +13,3 @@ SwapRedBlue="Kırmızı ve maviyi değiştir"
 LockX="Yakalama sırasında X sunucusunu kilitle"
 IncludeXBorder="X Çerçevesini Dahil Et"
 ExcludeAlpha="Alpha kanalı olmayan doku biçimi kullan (Mesa geçici çözüm)"
-PipeWireDesktopCapture="Ekran Yakalama (PipeWire)"
-PipeWireSelectMonitor="Ekran Seç"
-PipeWireSelectWindow="Pencere Seç"
-PipeWireWindowCapture="Pencere Yakalama (PipeWire)"
-ShowCursor="İmleci Göster"

+ 0 - 5
plugins/linux-capture/data/locale/uk-UA.ini

@@ -12,8 +12,3 @@ SwapRedBlue="Поміняти червоний і синій"
 LockX="Блокувати X Server під час захоплення"
 IncludeXBorder="Захоплювати межі вікна"
 ExcludeAlpha="Використовувати формат текстур без альфа-каналу (для Mesa)"
-PipeWireDesktopCapture="Захоплення екрана (PipeWire)"
-PipeWireSelectMonitor="Виберіть монітор"
-PipeWireSelectWindow="Виберіть вікно"
-PipeWireWindowCapture="Захоплення вікна (PipeWire)"
-ShowCursor="Показувати курсор"

+ 0 - 4
plugins/linux-capture/data/locale/vi-VN.ini

@@ -12,7 +12,3 @@ SwapRedBlue="Đổi đỏ và xanh"
 LockX="Khóa X server khi quay"
 IncludeXBorder="Bao gồm X Border"
 ExcludeAlpha="Dùng texture format không có Alpha (Cách giải quyết với Mesa driver)"
-PipeWireDesktopCapture="Quay màn hình (PipeWire)"
-PipeWireSelectMonitor="Chọn màn hình"
-PipeWireSelectWindow="Chọn cửa sổ"
-ShowCursor="Hiển thị con trỏ"

+ 0 - 5
plugins/linux-capture/data/locale/zh-CN.ini

@@ -12,8 +12,3 @@ SwapRedBlue="交换红色和蓝色"
 LockX="当捕获时锁定X server"
 IncludeXBorder="包括 X 边框"
 ExcludeAlpha="使用阿尔法少纹理格式 (Mesa 变通办法)"
-PipeWireDesktopCapture="屏幕采集(PipeWire)"
-PipeWireSelectMonitor="选择显示器"
-PipeWireSelectWindow="选择窗口"
-PipeWireWindowCapture="窗口捕获(PipeWire)"
-ShowCursor="显示鼠标指针"

+ 0 - 5
plugins/linux-capture/data/locale/zh-TW.ini

@@ -13,8 +13,3 @@ SwapRedBlue="交換紅藍顏色"
 LockX="截取時鎖定 X server"
 IncludeXBorder="包含X邊框"
 ExcludeAlpha="使用不帶有alpha值的材質格式 (Mesa暫時解決方案)"
-PipeWireDesktopCapture="畫面擷取 (PipeWire)"
-PipeWireSelectMonitor="選擇顯示器"
-PipeWireSelectWindow="選擇視窗"
-PipeWireWindowCapture="視窗擷取(PipeWire)"
-ShowCursor="顯示游標"

+ 1 - 20
plugins/linux-capture/linux-capture.c

@@ -17,20 +17,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <obs-module.h>
 #include <obs-nix-platform.h>
 
-#ifdef ENABLE_PIPEWIRE
-#include "pipewire-capture.h"
-#endif
-
 OBS_DECLARE_MODULE()
 OBS_MODULE_USE_DEFAULT_LOCALE("linux-xshm", "en-US")
 MODULE_EXPORT const char *obs_module_description(void)
 {
-#ifdef ENABLE_PIPEWIRE
-	if (obs_get_nix_platform() != OBS_NIX_PLATFORM_X11_GLX)
-		return "PipeWire based window/screen capture for X11 and Wayland";
-	else
-#endif
-		return "xcomposite/xshm based window/screen capture for X11";
+	return "xcomposite/xshm based window/screen capture for X11";
 }
 
 extern struct obs_source_info xshm_input;
@@ -50,16 +41,10 @@ bool obs_module_load(void)
 
 	case OBS_NIX_PLATFORM_X11_EGL:
 		obs_register_source(&xshm_input);
-#ifdef ENABLE_PIPEWIRE
-		pipewire_capture_load();
-#endif
 		break;
 
 #ifdef ENABLE_WAYLAND
 	case OBS_NIX_PLATFORM_WAYLAND:
-#ifdef ENABLE_PIPEWIRE
-		pipewire_capture_load();
-#endif
 		break;
 #endif
 	}
@@ -71,8 +56,4 @@ void obs_module_unload(void)
 {
 	if (obs_get_nix_platform() == OBS_NIX_PLATFORM_X11_GLX)
 		xcomposite_unload();
-#ifdef ENABLE_PIPEWIRE
-	else
-		pipewire_capture_unload();
-#endif
 }

+ 27 - 4
plugins/linux-pipewire/CMakeLists.txt

@@ -7,21 +7,44 @@ if(NOT ENABLE_PIPEWIRE)
 endif()
 
 find_package(PipeWire REQUIRED)
+find_package(Gio QUIET)
+find_package(Libdrm QUIET) # we require libdrm/drm_fourcc.h to build
 
 if(NOT TARGET PipeWire::PipeWire)
   message(
     FATAL_ERROR
       "OBS:    -        PipeWire library not found! Please install PipeWire or set ENABLE_PIPEWIRE=OFF"
   )
+elseif(NOT TARGET GIO::GIO)
+  message(
+    FATAL_ERROR
+      "OBS:    -        Gio library not found! Please install GLib2 (or Gio) or set ENABLE_PIPEWIRE=OFF"
+  )
+elseif(NOT TARGET Libdrm::Libdrm)
+  message(
+    FATAL_ERROR
+      "OBS:    -        libdrm headers not found! Please install libdrm or set ENABLE_PIPEWIRE=OFF"
+  )
 endif()
 
 add_library(linux-pipewire MODULE)
 add_library(OBS::pipewire ALIAS linux-pipewire)
 
-target_sources(linux-pipewire PRIVATE linux-pipewire.c pipewire-common.c
-                                      pipewire-common.h)
-
-target_link_libraries(linux-pipewire PRIVATE OBS::libobs PipeWire::PipeWire)
+target_sources(
+  linux-pipewire
+  PRIVATE linux-pipewire.c
+          pipewire-common.c
+          pipewire-common.h
+          pipewire.c
+          pipewire.h
+          pipewire-capture.c
+          pipewire-capture.h
+          portal.c
+          portal.h)
+
+target_link_libraries(
+  linux-pipewire PRIVATE OBS::libobs OBS::obsglad PipeWire::PipeWire GIO::GIO
+                         Libdrm::Libdrm)
 
 set_target_properties(linux-pipewire PROPERTIES FOLDER "plugins")
 

+ 5 - 0
plugins/linux-pipewire/data/locale/en-US.ini

@@ -0,0 +1,5 @@
+PipeWireDesktopCapture="Screen Capture (PipeWire)"
+PipeWireSelectMonitor="Select Monitor"
+PipeWireSelectWindow="Select Window"
+PipeWireWindowCapture="Window Capture (PipeWire)"
+ShowCursor="Show Cursor"

+ 14 - 0
plugins/linux-pipewire/linux-pipewire.c

@@ -1,6 +1,7 @@
 /* linux-pipewire.c
  *
  * Copyright 2021 columbarius <[email protected]>
+ * Copyright 2021 Georges Basile Stavracas Neto <[email protected]>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,6 +23,7 @@
 #include <obs-nix-platform.h>
 
 #include "pipewire-common.h"
+#include "pipewire-capture.h"
 
 OBS_DECLARE_MODULE()
 OBS_MODULE_USE_DEFAULT_LOCALE("linux-pipewire", "en-US")
@@ -34,6 +36,18 @@ bool obs_module_load(void)
 {
 	obs_pipewire_load();
 
+	// OBS PipeWire Screen Capture
+	switch (obs_get_nix_platform()) {
+#ifdef ENABLE_WAYLAND
+	case OBS_NIX_PLATFORM_WAYLAND:
+#endif
+	case OBS_NIX_PLATFORM_X11_EGL:
+		pipewire_capture_load();
+		break;
+	case OBS_NIX_PLATFORM_X11_GLX:
+		break;
+	}
+
 	return true;
 }
 

+ 0 - 9
plugins/linux-capture/pipewire-capture.c → plugins/linux-pipewire/pipewire-capture.c

@@ -174,13 +174,4 @@ void pipewire_capture_load(void)
 	};
 	if (window_capture_available)
 		obs_register_source(&pipewire_window_capture_info);
-
-	pw_init(NULL, NULL);
-	initialized = true;
-}
-
-void pipewire_capture_unload(void)
-{
-	if (initialized)
-		pw_deinit();
 }

+ 0 - 1
plugins/linux-capture/pipewire-capture.h → plugins/linux-pipewire/pipewire-capture.h

@@ -21,4 +21,3 @@
 #pragma once
 
 void pipewire_capture_load(void);
-void pipewire_capture_unload(void);

+ 0 - 0
plugins/linux-capture/pipewire.c → plugins/linux-pipewire/pipewire.c


+ 0 - 0
plugins/linux-capture/pipewire.h → plugins/linux-pipewire/pipewire.h


+ 0 - 0
plugins/linux-capture/portal.c → plugins/linux-pipewire/portal.c


+ 0 - 0
plugins/linux-capture/portal.h → plugins/linux-pipewire/portal.h