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 <grulja@gmail.com>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/main@{#38392}
This commit is contained in:
Jan Grulich
2022-10-13 10:49:47 +02:00
committed by WebRTC LUCI CQ
parent f5fdac1535
commit b0ce3a5fda
4 changed files with 3 additions and 26 deletions

View File

@ -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" ]

View File

@ -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);

View File

@ -5,5 +5,4 @@ extern "C" {
#include <pipewire/pipewire.h>
#include <xf86drm.h>
}

View File

@ -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)