Bug 1675767 [Linux] Use PipeWire on Wayland desktop, r=dminor

Differential Revision: https://phabricator.services.mozilla.com/D96587
This commit is contained in:
stransky 2020-11-10 16:30:41 +00:00
Родитель 21991a311d
Коммит b639a6c48a
1 изменённых файлов: 1 добавлений и 17 удалений

Просмотреть файл

@ -77,19 +77,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateTabCapturer(
}
#if defined(WEBRTC_USE_PIPEWIRE) || defined(USE_X11)
// Return true if Firefox is actually running with Wayland backend.
static bool IsWaylandDisplayUsed() {
const auto display = gdk_display_get_default();
if (display == nullptr) {
// We're running in headless mode.
return false;
}
return !GDK_IS_X11_DISPLAY(display);
}
// Return true if Firefox is actually running on Wayland enabled session.
// It means some screensharing capabilities may be limited.
static bool IsWaylandSessionUsed() {
bool DesktopCapturer::IsRunningUnderWayland() {
const char* xdg_session_type = getenv("XDG_SESSION_TYPE");
if (!xdg_session_type || strncmp(xdg_session_type, "wayland", 7) != 0)
return false;
@ -99,10 +87,6 @@ static bool IsWaylandSessionUsed() {
return true;
}
bool DesktopCapturer::IsRunningUnderWayland() {
return IsWaylandSessionUsed() ? IsWaylandDisplayUsed() : false;
}
#endif // defined(WEBRTC_USE_PIPEWIRE) || defined(USE_X11)
} // namespace webrtc