| 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 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 CGDataProviderRef provider = CGImageGetDataProvider(excluded_image); | 183 CGDataProviderRef provider = CGImageGetDataProvider(excluded_image); |
| 184 *data_ref = CGDataProviderCopyData(provider); | 184 *data_ref = CGDataProviderCopyData(provider); |
| 185 assert(*data_ref); | 185 assert(*data_ref); |
| 186 return excluded_image; | 186 return excluded_image; |
| 187 } | 187 } |
| 188 | 188 |
| 189 // A class to perform video frame capturing for mac. | 189 // A class to perform video frame capturing for mac. |
| 190 class ScreenCapturerMac : public ScreenCapturer { | 190 class ScreenCapturerMac : public ScreenCapturer { |
| 191 public: | 191 public: |
| 192 explicit ScreenCapturerMac( | 192 explicit ScreenCapturerMac( |
| 193 scoped_refptr<DesktopConfigurationMonitor> desktop_config_monitor); | 193 rtc::scoped_refptr<DesktopConfigurationMonitor> desktop_config_monitor); |
| 194 virtual ~ScreenCapturerMac(); | 194 virtual ~ScreenCapturerMac(); |
| 195 | 195 |
| 196 bool Init(); | 196 bool Init(); |
| 197 | 197 |
| 198 // Overridden from ScreenCapturer: | 198 // Overridden from ScreenCapturer: |
| 199 void Start(Callback* callback) override; | 199 void Start(Callback* callback) override; |
| 200 void Capture(const DesktopRegion& region) override; | 200 void Capture(const DesktopRegion& region) override; |
| 201 void SetExcludedWindow(WindowId window) override; | 201 void SetExcludedWindow(WindowId window) override; |
| 202 bool GetScreenList(ScreenList* screens) override; | 202 bool GetScreenList(ScreenList* screens) override; |
| 203 bool SelectScreen(ScreenId id) override; | 203 bool SelectScreen(ScreenId id) override; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 float dip_to_pixel_scale_; | 255 float dip_to_pixel_scale_; |
| 256 | 256 |
| 257 // A thread-safe list of invalid rectangles, and the size of the most | 257 // A thread-safe list of invalid rectangles, and the size of the most |
| 258 // recently captured screen. | 258 // recently captured screen. |
| 259 ScreenCapturerHelper helper_; | 259 ScreenCapturerHelper helper_; |
| 260 | 260 |
| 261 // Contains an invalid region from the previous capture. | 261 // Contains an invalid region from the previous capture. |
| 262 DesktopRegion last_invalid_region_; | 262 DesktopRegion last_invalid_region_; |
| 263 | 263 |
| 264 // Monitoring display reconfiguration. | 264 // Monitoring display reconfiguration. |
| 265 scoped_refptr<DesktopConfigurationMonitor> desktop_config_monitor_; | 265 rtc::scoped_refptr<DesktopConfigurationMonitor> desktop_config_monitor_; |
| 266 | 266 |
| 267 // Power management assertion to prevent the screen from sleeping. | 267 // Power management assertion to prevent the screen from sleeping. |
| 268 IOPMAssertionID power_assertion_id_display_; | 268 IOPMAssertionID power_assertion_id_display_; |
| 269 | 269 |
| 270 // Power management assertion to indicate that the user is active. | 270 // Power management assertion to indicate that the user is active. |
| 271 IOPMAssertionID power_assertion_id_user_; | 271 IOPMAssertionID power_assertion_id_user_; |
| 272 | 272 |
| 273 // Dynamically link to deprecated APIs for Mac OS X 10.6 support. | 273 // Dynamically link to deprecated APIs for Mac OS X 10.6 support. |
| 274 void* app_services_library_; | 274 void* app_services_library_; |
| 275 CGDisplayBaseAddressFunc cg_display_base_address_; | 275 CGDisplayBaseAddressFunc cg_display_base_address_; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 300 } | 300 } |
| 301 virtual ~InvertedDesktopFrame() {} | 301 virtual ~InvertedDesktopFrame() {} |
| 302 | 302 |
| 303 private: | 303 private: |
| 304 rtc::scoped_ptr<DesktopFrame> original_frame_; | 304 rtc::scoped_ptr<DesktopFrame> original_frame_; |
| 305 | 305 |
| 306 DISALLOW_COPY_AND_ASSIGN(InvertedDesktopFrame); | 306 DISALLOW_COPY_AND_ASSIGN(InvertedDesktopFrame); |
| 307 }; | 307 }; |
| 308 | 308 |
| 309 ScreenCapturerMac::ScreenCapturerMac( | 309 ScreenCapturerMac::ScreenCapturerMac( |
| 310 scoped_refptr<DesktopConfigurationMonitor> desktop_config_monitor) | 310 rtc::scoped_refptr<DesktopConfigurationMonitor> desktop_config_monitor) |
| 311 : callback_(NULL), | 311 : callback_(NULL), |
| 312 cgl_context_(NULL), | 312 cgl_context_(NULL), |
| 313 current_display_(0), | 313 current_display_(0), |
| 314 dip_to_pixel_scale_(1.0f), | 314 dip_to_pixel_scale_(1.0f), |
| 315 desktop_config_monitor_(desktop_config_monitor), | 315 desktop_config_monitor_(desktop_config_monitor), |
| 316 power_assertion_id_display_(kIOPMNullAssertionID), | 316 power_assertion_id_display_(kIOPMNullAssertionID), |
| 317 power_assertion_id_user_(kIOPMNullAssertionID), | 317 power_assertion_id_user_(kIOPMNullAssertionID), |
| 318 app_services_library_(NULL), | 318 app_services_library_(NULL), |
| 319 cg_display_base_address_(NULL), | 319 cg_display_base_address_(NULL), |
| 320 cg_display_bytes_per_row_(NULL), | 320 cg_display_bytes_per_row_(NULL), |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 return NULL; | 973 return NULL; |
| 974 | 974 |
| 975 rtc::scoped_ptr<ScreenCapturerMac> capturer( | 975 rtc::scoped_ptr<ScreenCapturerMac> capturer( |
| 976 new ScreenCapturerMac(options.configuration_monitor())); | 976 new ScreenCapturerMac(options.configuration_monitor())); |
| 977 if (!capturer->Init()) | 977 if (!capturer->Init()) |
| 978 capturer.reset(); | 978 capturer.reset(); |
| 979 return capturer.release(); | 979 return capturer.release(); |
| 980 } | 980 } |
| 981 | 981 |
| 982 } // namespace webrtc | 982 } // namespace webrtc |
| OLD | NEW |