| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/modules/desktop_capture/mouse_cursor_monitor.h" | 11 #include "webrtc/modules/desktop_capture/mouse_cursor_monitor.h" |
| 12 | 12 |
| 13 #include <assert.h> | 13 #include <assert.h> |
| 14 #include <ApplicationServices/ApplicationServices.h> | 14 #include <ApplicationServices/ApplicationServices.h> |
| 15 #include <Cocoa/Cocoa.h> | 15 #include <Cocoa/Cocoa.h> |
| 16 #include <CoreFoundation/CoreFoundation.h> | 16 #include <CoreFoundation/CoreFoundation.h> |
| 17 | 17 |
| 18 #include "webrtc/base/macutils.h" | 18 #include "webrtc/base/macutils.h" |
| 19 #include "webrtc/base/scoped_ptr.h" | 19 #include "webrtc/base/scoped_ptr.h" |
| 20 #include "webrtc/base/scoped_ref_ptr.h" |
| 20 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" | 21 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" |
| 21 #include "webrtc/modules/desktop_capture/desktop_frame.h" | 22 #include "webrtc/modules/desktop_capture/desktop_frame.h" |
| 22 #include "webrtc/modules/desktop_capture/mac/desktop_configuration.h" | 23 #include "webrtc/modules/desktop_capture/mac/desktop_configuration.h" |
| 23 #include "webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.h" | 24 #include "webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.h" |
| 24 #include "webrtc/modules/desktop_capture/mac/full_screen_chrome_window_detector.
h" | 25 #include "webrtc/modules/desktop_capture/mac/full_screen_chrome_window_detector.
h" |
| 25 #include "webrtc/modules/desktop_capture/mouse_cursor.h" | 26 #include "webrtc/modules/desktop_capture/mouse_cursor.h" |
| 26 #include "webrtc/system_wrappers/interface/logging.h" | 27 #include "webrtc/system_wrappers/interface/logging.h" |
| 27 #include "webrtc/system_wrappers/interface/scoped_refptr.h" | |
| 28 | 28 |
| 29 namespace webrtc { | 29 namespace webrtc { |
| 30 | 30 |
| 31 class MouseCursorMonitorMac : public MouseCursorMonitor { | 31 class MouseCursorMonitorMac : public MouseCursorMonitor { |
| 32 public: | 32 public: |
| 33 MouseCursorMonitorMac(const DesktopCaptureOptions& options, | 33 MouseCursorMonitorMac(const DesktopCaptureOptions& options, |
| 34 CGWindowID window_id, | 34 CGWindowID window_id, |
| 35 ScreenId screen_id); | 35 ScreenId screen_id); |
| 36 virtual ~MouseCursorMonitorMac(); | 36 virtual ~MouseCursorMonitorMac(); |
| 37 | 37 |
| 38 void Init(Callback* callback, Mode mode) override; | 38 void Init(Callback* callback, Mode mode) override; |
| 39 void Capture() override; | 39 void Capture() override; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 static void DisplaysReconfiguredCallback(CGDirectDisplayID display, | 42 static void DisplaysReconfiguredCallback(CGDirectDisplayID display, |
| 43 CGDisplayChangeSummaryFlags flags, | 43 CGDisplayChangeSummaryFlags flags, |
| 44 void *user_parameter); | 44 void *user_parameter); |
| 45 void DisplaysReconfigured(CGDirectDisplayID display, | 45 void DisplaysReconfigured(CGDirectDisplayID display, |
| 46 CGDisplayChangeSummaryFlags flags); | 46 CGDisplayChangeSummaryFlags flags); |
| 47 | 47 |
| 48 void CaptureImage(); | 48 void CaptureImage(); |
| 49 | 49 |
| 50 scoped_refptr<DesktopConfigurationMonitor> configuration_monitor_; | 50 rtc::scoped_refptr<DesktopConfigurationMonitor> configuration_monitor_; |
| 51 CGWindowID window_id_; | 51 CGWindowID window_id_; |
| 52 ScreenId screen_id_; | 52 ScreenId screen_id_; |
| 53 Callback* callback_; | 53 Callback* callback_; |
| 54 Mode mode_; | 54 Mode mode_; |
| 55 rtc::scoped_ptr<MouseCursor> last_cursor_; | 55 rtc::scoped_ptr<MouseCursor> last_cursor_; |
| 56 scoped_refptr<FullScreenChromeWindowDetector> | 56 rtc::scoped_refptr<FullScreenChromeWindowDetector> |
| 57 full_screen_chrome_window_detector_; | 57 full_screen_chrome_window_detector_; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 MouseCursorMonitorMac::MouseCursorMonitorMac( | 60 MouseCursorMonitorMac::MouseCursorMonitorMac( |
| 61 const DesktopCaptureOptions& options, | 61 const DesktopCaptureOptions& options, |
| 62 CGWindowID window_id, | 62 CGWindowID window_id, |
| 63 ScreenId screen_id) | 63 ScreenId screen_id) |
| 64 : configuration_monitor_(options.configuration_monitor()), | 64 : configuration_monitor_(options.configuration_monitor()), |
| 65 window_id_(window_id), | 65 window_id_(window_id), |
| 66 screen_id_(screen_id), | 66 screen_id_(screen_id), |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 return new MouseCursorMonitorMac(options, window, kInvalidScreenId); | 287 return new MouseCursorMonitorMac(options, window, kInvalidScreenId); |
| 288 } | 288 } |
| 289 | 289 |
| 290 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( | 290 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( |
| 291 const DesktopCaptureOptions& options, | 291 const DesktopCaptureOptions& options, |
| 292 ScreenId screen) { | 292 ScreenId screen) { |
| 293 return new MouseCursorMonitorMac(options, kCGNullWindowID, screen); | 293 return new MouseCursorMonitorMac(options, kCGNullWindowID, screen); |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace webrtc | 296 } // namespace webrtc |
| OLD | NEW |