xref: /aosp_15_r20/external/webrtc/modules/desktop_capture/desktop_capture_options.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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"
14 
15 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
16 #include "modules/desktop_capture/mac/full_screen_mac_application_handler.h"
17 #elif defined(WEBRTC_WIN)
18 #include "modules/desktop_capture/win/full_screen_win_application_handler.h"
19 #endif
20 #if defined(WEBRTC_USE_PIPEWIRE)
21 #include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h"
22 #endif
23 
24 namespace webrtc {
25 
DesktopCaptureOptions()26 DesktopCaptureOptions::DesktopCaptureOptions() {}
27 DesktopCaptureOptions::DesktopCaptureOptions(
28     const DesktopCaptureOptions& options) = default;
29 DesktopCaptureOptions::DesktopCaptureOptions(DesktopCaptureOptions&& options) =
30     default;
~DesktopCaptureOptions()31 DesktopCaptureOptions::~DesktopCaptureOptions() {}
32 
33 DesktopCaptureOptions& DesktopCaptureOptions::operator=(
34     const DesktopCaptureOptions& options) = default;
35 DesktopCaptureOptions& DesktopCaptureOptions::operator=(
36     DesktopCaptureOptions&& options) = default;
37 
38 // static
CreateDefault()39 DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() {
40   DesktopCaptureOptions result;
41 #if defined(WEBRTC_USE_X11)
42   result.set_x_display(SharedXDisplay::CreateDefault());
43 #endif
44 #if defined(WEBRTC_USE_PIPEWIRE)
45   result.set_screencast_stream(SharedScreenCastStream::CreateDefault());
46 #endif
47 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
48   result.set_configuration_monitor(
49       rtc::make_ref_counted<DesktopConfigurationMonitor>());
50   result.set_full_screen_window_detector(
51       rtc::make_ref_counted<FullScreenWindowDetector>(
52           CreateFullScreenMacApplicationHandler));
53 #elif defined(WEBRTC_WIN)
54   result.set_full_screen_window_detector(
55       rtc::make_ref_counted<FullScreenWindowDetector>(
56           CreateFullScreenWinApplicationHandler));
57 #endif
58   return result;
59 }
60 
61 }  // namespace webrtc
62