Bug 1819044 - fix build non-pipewire builds (attempt #2) r=webrtc-reviewers,pehrsons

Make the new API available to everyone and just return an empty capturer
in case when building without PipeWire. It will not make any difference
because using X11 based capturers on Wayland is useless anyway so if we
fail for missing PipeWire on Wayland, it will have the same outcome.

Differential Revision: https://phabricator.services.mozilla.com/D171192
This commit is contained in:
Jan Grulich 2023-02-28 09:18:57 +00:00
parent 47cb3017ed
commit 39c4d9ae34
2 changed files with 2 additions and 6 deletions

View File

@ -82,7 +82,6 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
return capturer;
}
#if defined(WEBRTC_USE_PIPEWIRE)
// static
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateGenericCapturer(
const DesktopCaptureOptions& options) {
@ -96,14 +95,15 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateGenericCapturer(
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawGenericCapturer(
const DesktopCaptureOptions& options) {
#if defined(WEBRTC_USE_PIPEWIRE)
if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) {
return std::make_unique<BaseCapturerPipeWire>(options,
CaptureType::kAnyScreenContent);
}
#endif // defined(WEBRTC_USE_PIPEWIRE)
return nullptr;
}
#endif // defined(WEBRTC_USE_PIPEWIRE)
// static
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(

View File

@ -164,11 +164,9 @@ class RTC_EXPORT DesktopCapturer {
// The return value if `pos` is out of the scope of the source is undefined.
virtual bool IsOccluded(const DesktopVector& pos);
#if defined(WEBRTC_USE_PIPEWIRE)
// Creates a DesktopCapturer instance which targets to capture windows and screens.
static std::unique_ptr<DesktopCapturer> CreateGenericCapturer(
const DesktopCaptureOptions& options);
#endif
// Creates a DesktopCapturer instance which targets to capture windows.
static std::unique_ptr<DesktopCapturer> CreateWindowCapturer(
@ -198,12 +196,10 @@ class RTC_EXPORT DesktopCapturer {
// CroppingWindowCapturer needs to create raw capturers without wrappers, so
// the following two functions are protected.
#if defined(WEBRTC_USE_PIPEWIRE)
// Creates a platform specific DesktopCapturer instance which targets to
// capture windows and screens.
static std::unique_ptr<DesktopCapturer> CreateRawGenericCapturer(
const DesktopCaptureOptions& options);
#endif
// Creates a platform specific DesktopCapturer instance which targets to
// capture windows.