From b0ce3a5fdaecaf379848a15beefbf0ab8d273718 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Thu, 13 Oct 2022 10:49:47 +0200 Subject: [PATCH] Wayland screencast: link against libdrm Libdrm is an essential library and should be available everywhere where needed. It also looks it's a dependency for Chromium already. Bug: webrtc:13429 Change-Id: Id81497b4f29bbd80f7d94f57333aa533288c3538 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279023 Commit-Queue: Jan Grulich Reviewed-by: Alexander Cooper Cr-Commit-Position: refs/heads/main@{#38392} --- modules/desktop_capture/BUILD.gn | 9 +-------- modules/desktop_capture/linux/wayland/drm.sigs | 11 ----------- .../linux/wayland/pipewire_stub_header.fragment | 1 - .../linux/wayland/shared_screencast_stream.cc | 8 ++------ 4 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 modules/desktop_capture/linux/wayland/drm.sigs diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn index a124a074ee..dd5b37b218 100644 --- a/modules/desktop_capture/BUILD.gn +++ b/modules/desktop_capture/BUILD.gn @@ -267,9 +267,6 @@ if (is_linux || is_chromeos) { } pkg_config("libdrm") { packages = [ "libdrm" ] - if (!rtc_link_pipewire) { - ignore_libs = true - } } if (!rtc_link_pipewire) { @@ -279,7 +276,6 @@ if (is_linux || is_chromeos) { configs = [ "../../:common_config", ":pipewire", - ":libdrm", ] deps = [ "../../rtc_base" ] extra_header = "linux/wayland/pipewire_stub_header.fragment" @@ -287,10 +283,7 @@ if (is_linux || is_chromeos) { logging_include = "rtc_base/logging.h" output_name = "linux/wayland/pipewire_stubs" path_from_source = "modules/desktop_capture/linux/wayland" - sigs = [ - "linux/wayland/pipewire.sigs", - "linux/wayland/drm.sigs", - ] + sigs = [ "linux/wayland/pipewire.sigs" ] if (!build_with_chromium) { macro_include = "rtc_base/system/no_cfi_icall.h" macro_deps = [ "../../rtc_base/system:no_cfi_icall" ] diff --git a/modules/desktop_capture/linux/wayland/drm.sigs b/modules/desktop_capture/linux/wayland/drm.sigs deleted file mode 100644 index 226979fe16..0000000000 --- a/modules/desktop_capture/linux/wayland/drm.sigs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2021 The WebRTC project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//------------------------------------------------ -// Functions from DRM used in capturer code. -//-------- - -// xf86drm.h -int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); -void drmFreeDevices(drmDevicePtr devices[], int count); diff --git a/modules/desktop_capture/linux/wayland/pipewire_stub_header.fragment b/modules/desktop_capture/linux/wayland/pipewire_stub_header.fragment index 06ae18dfd4..9d7dbd27c5 100644 --- a/modules/desktop_capture/linux/wayland/pipewire_stub_header.fragment +++ b/modules/desktop_capture/linux/wayland/pipewire_stub_header.fragment @@ -5,5 +5,4 @@ extern "C" { #include -#include } diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc index 10950d7727..48a15c1942 100644 --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc @@ -31,7 +31,6 @@ #if defined(WEBRTC_DLOPEN_PIPEWIRE) #include "modules/desktop_capture/linux/wayland/pipewire_stubs.h" using modules_desktop_capture_linux_wayland::InitializeStubs; -using modules_desktop_capture_linux_wayland::kModuleDrm; using modules_desktop_capture_linux_wayland::kModulePipewire; using modules_desktop_capture_linux_wayland::StubPathMap; #endif // defined(WEBRTC_DLOPEN_PIPEWIRE) @@ -42,7 +41,6 @@ const int kBytesPerPixel = 4; #if defined(WEBRTC_DLOPEN_PIPEWIRE) const char kPipeWireLib[] = "libpipewire-0.3.so.0"; -const char kDrmLib[] = "libdrm.so.2"; #endif constexpr int kCursorBpp = 4; @@ -380,15 +378,13 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( #if defined(WEBRTC_DLOPEN_PIPEWIRE) StubPathMap paths; - // Check if the PipeWire and DRM libraries are available. + // Check if the PipeWire library is available. paths[kModulePipewire].push_back(kPipeWireLib); - paths[kModuleDrm].push_back(kDrmLib); if (!InitializeStubs(paths)) { RTC_LOG(LS_ERROR) << "One of following libraries is missing on your system:\n" - << " - PipeWire (" << kPipeWireLib << ")\n" - << " - drm (" << kDrmLib << ")"; + << " - PipeWire (" << kPipeWireLib << ")\n"; return false; } #endif // defined(WEBRTC_DLOPEN_PIPEWIRE)