| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_; |
| 276 CGDisplayBytesPerRowFunc cg_display_bytes_per_row_; | 276 CGDisplayBytesPerRowFunc cg_display_bytes_per_row_; |
| 277 CGDisplayBitsPerPixelFunc cg_display_bits_per_pixel_; | 277 CGDisplayBitsPerPixelFunc cg_display_bits_per_pixel_; |
| 278 void* opengl_library_; | 278 void* opengl_library_; |
| 279 CGLSetFullScreenFunc cgl_set_full_screen_; | 279 CGLSetFullScreenFunc cgl_set_full_screen_; |
| 280 | 280 |
| 281 CGWindowID excluded_window_; | 281 CGWindowID excluded_window_; |
| 282 | 282 |
| 283 DISALLOW_COPY_AND_ASSIGN(ScreenCapturerMac); | 283 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerMac); |
| 284 }; | 284 }; |
| 285 | 285 |
| 286 // DesktopFrame wrapper that flips wrapped frame upside down by inverting | 286 // DesktopFrame wrapper that flips wrapped frame upside down by inverting |
| 287 // stride. | 287 // stride. |
| 288 class InvertedDesktopFrame : public DesktopFrame { | 288 class InvertedDesktopFrame : public DesktopFrame { |
| 289 public: | 289 public: |
| 290 // Takes ownership of |frame|. | 290 // Takes ownership of |frame|. |
| 291 InvertedDesktopFrame(DesktopFrame* frame) | 291 InvertedDesktopFrame(DesktopFrame* frame) |
| 292 : DesktopFrame( | 292 : DesktopFrame( |
| 293 frame->size(), -frame->stride(), | 293 frame->size(), -frame->stride(), |
| 294 frame->data() + (frame->size().height() - 1) * frame->stride(), | 294 frame->data() + (frame->size().height() - 1) * frame->stride(), |
| 295 frame->shared_memory()), | 295 frame->shared_memory()), |
| 296 original_frame_(frame) { | 296 original_frame_(frame) { |
| 297 set_dpi(frame->dpi()); | 297 set_dpi(frame->dpi()); |
| 298 set_capture_time_ms(frame->capture_time_ms()); | 298 set_capture_time_ms(frame->capture_time_ms()); |
| 299 mutable_updated_region()->Swap(frame->mutable_updated_region()); | 299 mutable_updated_region()->Swap(frame->mutable_updated_region()); |
| 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 RTC_DISALLOW_COPY_AND_ASSIGN(InvertedDesktopFrame); |
| 307 }; | 307 }; |
| 308 | 308 |
| 309 ScreenCapturerMac::ScreenCapturerMac( | 309 ScreenCapturerMac::ScreenCapturerMac( |
| 310 rtc::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), |
| (...skipping 656 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 |