Commit 8788015d authored by Tomas Popela's avatar Tomas Popela Committed by Commit Bot

Add about flag for enabling the PipeWire support in WebRTC

Add a new enable-webrtc-pipewire-capturer about flag, that when
enabled, will allow to use the PipeWire media server for providing
the screen content for screen casting when user is running on Wayland
display server on Linux.

The flag is disabled by default, due to the user experience as it
involves two extra confirmation dialogs outside of Chromium - requested
by Weiyong Yao. It could change the default, once it goes through Chromium
UI review.

Bug: 682122
Change-Id: I70c07a4a170b2bf1717f6c155905625eba84ff5a
Reviewed-on: https://chromium-review.googlesource.com/c/1365444Reviewed-by: default avatarWeiyong Yao <braveyao@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Tomáš Popela <tomas.popela@gmail.com>
Cr-Commit-Position: refs/heads/master@{#615886}
parent e73d3652
......@@ -25,6 +25,7 @@ import("//printing/buildflags/buildflags.gni")
import("//rlz/buildflags/buildflags.gni")
import("//sandbox/features.gni")
import("//third_party/protobuf/proto_library.gni")
import("//third_party/webrtc/webrtc.gni")
import("//third_party/widevine/cdm/widevine.gni")
import("//ui/base/ui_features.gni")
......@@ -3451,6 +3452,11 @@ jumbo_split_static_library("browser") {
"media/webrtc/window_icon_util_ozone.cc",
]
}
if (rtc_use_pipewire) {
configs +=
[ "//third_party/webrtc/modules/desktop_capture:pipewire_config" ]
}
}
if (is_posix || is_fuchsia) {
......
......@@ -1278,6 +1278,12 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kWebrtcHwVP8EncodingName,
flag_descriptions::kWebrtcHwVP8EncodingDescription, kOsAndroid | kOsCrOS,
FEATURE_VALUE_TYPE(features::kWebRtcHWVP8Encoding)},
#if defined(WEBRTC_USE_PIPEWIRE)
{"enable-webrtc-pipewire-capturer",
flag_descriptions::kWebrtcPipeWireCapturerName,
flag_descriptions::kWebrtcPipeWireCapturerDescription, kOsLinux,
FEATURE_VALUE_TYPE(features::kWebRtcPipeWireCapturer)},
#endif // defined(WEBRTC_USE_PIPEWIRE)
#if !defined(OS_ANDROID)
{"enable-webrtc-remote-event-log",
flag_descriptions::kWebRtcRemoteEventLogName,
......
......@@ -3773,6 +3773,15 @@ const char kAutofillCreditCardUploadDescription[] =
#endif // defined(TOOLKIT_VIEWS) || defined(OS_ANDROID)
#if defined(WEBRTC_USE_PIPEWIRE)
extern const char kWebrtcPipeWireCapturerName[] = "WebRTC PipeWire support";
extern const char kWebrtcPipeWireCapturerDescription[] =
"When enabled the WebRTC will use the PipeWire multimedia server for "
"capturing the desktop content on the Wayland display server.";
#endif // #if defined(WEBRTC_USE_PIPEWIRE)
// ============================================================================
// Don't just add flags to the end, put them in the right section in
// alphabetical order just like the header file.
......
......@@ -2281,6 +2281,13 @@ extern const char kAutofillCreditCardUploadDescription[];
#endif // defined(TOOLKIT_VIEWS) || defined(OS_ANDROID)
#if defined(WEBRTC_USE_PIPEWIRE)
extern const char kWebrtcPipeWireCapturerName[];
extern const char kWebrtcPipeWireCapturerDescription[];
#endif // #if defined(WEBRTC_USE_PIPEWIRE)
// ============================================================================
// Don't just add flags to the end, put them in the right section in
// alphabetical order. See top instructions for more.
......
......@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//third_party/webrtc/webrtc.gni")
# See //content/BUILD.gn for how this works.
group("browser") {
......@@ -334,6 +335,11 @@ jumbo_source_set("browser_sources") {
"//content:content_implementation",
]
if (rtc_use_pipewire) {
configs +=
[ "//third_party/webrtc/modules/desktop_capture:pipewire_config" ]
}
public_deps = [
"//components/download/public/common:public",
"//content/public/common:common_sources",
......
......@@ -30,6 +30,11 @@ webrtc::DesktopCaptureOptions CreateDesktopCaptureOptions() {
options.set_allow_iosurface(true);
}
#endif
#if defined(WEBRTC_USE_PIPEWIRE)
if (base::FeatureList::IsEnabled(features::kWebRtcPipeWireCapturer)) {
options.set_allow_pipewire(true);
}
#endif // defined(WEBRTC_USE_PIPEWIRE)
return options;
}
......
......@@ -297,6 +297,11 @@ jumbo_source_set("common_sources") {
public_deps += [ "//media/capture/video/chromeos/public" ]
}
if (rtc_use_pipewire) {
configs +=
[ "//third_party/webrtc/modules/desktop_capture:pipewire_config" ]
}
# //content/common needs to include public headers.
allow_circular_includes_from = [
":interfaces",
......
......@@ -705,6 +705,13 @@ const base::Feature kTextSuggestionsTouchBar{"TextSuggestionsTouchBar",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif // defined(OS_MACOSX)
#if defined(WEBRTC_USE_PIPEWIRE)
// Controls whether the PipeWire support for screen capturing is enabled on the
// Wayland display server.
const base::Feature kWebRtcPipeWireCapturer{"WebRTCPipeWireCapturer",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif // defined(WEBRTC_USE_PIPEWIRE)
enum class VideoCaptureServiceConfiguration {
kEnabledForOutOfProcess,
kEnabledForBrowserProcess,
......
......@@ -167,6 +167,10 @@ CONTENT_EXPORT extern const base::Feature kMacV2Sandbox;
CONTENT_EXPORT extern const base::Feature kTextSuggestionsTouchBar;
#endif // defined(OS_MACOSX)
#if defined(WEBRTC_USE_PIPEWIRE)
CONTENT_EXPORT extern const base::Feature kWebRtcPipeWireCapturer;
#endif // defined(WEBRTC_USE_PIPEWIRE)
// DON'T ADD RANDOM STUFF HERE. Put it in the main section above in
// alphabetical order, or in one of the ifdefs (also in order in each section).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment