desktop_capture_options.cc (2291B)
1 /* 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #include "modules/desktop_capture/desktop_capture_options.h" 12 13 #include "api/make_ref_counted.h" // IWYU pragma: keep 14 #include "modules/desktop_capture/linux/x11/shared_x_display.h" 15 16 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) 17 #include "modules/desktop_capture/mac/full_screen_mac_application_handler.h" 18 #elif defined(WEBRTC_WIN) 19 #include "modules/desktop_capture/win/full_screen_win_application_handler.h" 20 #endif 21 #if defined(WEBRTC_USE_PIPEWIRE) 22 #include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h" 23 #endif 24 25 namespace webrtc { 26 27 DesktopCaptureOptions::DesktopCaptureOptions() {} 28 DesktopCaptureOptions::DesktopCaptureOptions( 29 const DesktopCaptureOptions& options) = default; 30 DesktopCaptureOptions::DesktopCaptureOptions(DesktopCaptureOptions&& options) = 31 default; 32 DesktopCaptureOptions::~DesktopCaptureOptions() {} 33 34 DesktopCaptureOptions& DesktopCaptureOptions::operator=( 35 const DesktopCaptureOptions& options) = default; 36 DesktopCaptureOptions& DesktopCaptureOptions::operator=( 37 DesktopCaptureOptions&& options) = default; 38 39 // static 40 DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() { 41 DesktopCaptureOptions result; 42 #if defined(WEBRTC_USE_X11) 43 result.set_x_display(SharedXDisplay::CreateDefault()); 44 #endif 45 #if defined(WEBRTC_USE_PIPEWIRE) 46 result.set_screencast_stream(SharedScreenCastStream::CreateDefault()); 47 #endif 48 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) 49 result.set_configuration_monitor( 50 make_ref_counted<DesktopConfigurationMonitor>()); 51 result.set_full_screen_window_detector( 52 make_ref_counted<FullScreenWindowDetector>( 53 CreateFullScreenMacApplicationHandler)); 54 #elif defined(WEBRTC_WIN) 55 result.set_full_screen_window_detector( 56 make_ref_counted<FullScreenWindowDetector>( 57 CreateFullScreenWinApplicationHandler)); 58 #endif 59 return result; 60 } 61 62 } // namespace webrtc