| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/capturer.h" | 5 #include "remoting/host/capturer.h" |
| 6 | 6 |
| 7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
| 8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
| 9 #include <OpenGL/CGLMacro.h> | 9 #include <OpenGL/CGLMacro.h> |
| 10 #include <OpenGL/OpenGL.h> | 10 #include <OpenGL/OpenGL.h> |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 last_buffer_(NULL), | 221 last_buffer_(NULL), |
| 222 pixel_format_(media::VideoFrame::RGB32), | 222 pixel_format_(media::VideoFrame::RGB32), |
| 223 display_configuration_capture_event_(false, true), | 223 display_configuration_capture_event_(false, true), |
| 224 display_create_image_func_(NULL) { | 224 display_create_image_func_(NULL) { |
| 225 } | 225 } |
| 226 | 226 |
| 227 CapturerMac::~CapturerMac() { | 227 CapturerMac::~CapturerMac() { |
| 228 ReleaseBuffers(); | 228 ReleaseBuffers(); |
| 229 CGUnregisterScreenRefreshCallback(CapturerMac::ScreenRefreshCallback, this); | 229 CGUnregisterScreenRefreshCallback(CapturerMac::ScreenRefreshCallback, this); |
| 230 CGScreenUnregisterMoveCallback(CapturerMac::ScreenUpdateMoveCallback, this); | 230 CGScreenUnregisterMoveCallback(CapturerMac::ScreenUpdateMoveCallback, this); |
| 231 CGDisplayRemoveReconfigurationCallback( | 231 CGError err = CGDisplayRemoveReconfigurationCallback( |
| 232 CapturerMac::DisplaysReconfiguredCallback, this); | 232 CapturerMac::DisplaysReconfiguredCallback, this); |
| 233 if (err != kCGErrorSuccess) { |
| 234 LOG(ERROR) << "CGDisplayRemoveReconfigurationCallback " << err; |
| 235 } |
| 233 } | 236 } |
| 234 | 237 |
| 235 bool CapturerMac::Init() { | 238 bool CapturerMac::Init() { |
| 236 CGError err = | 239 CGError err = |
| 237 CGRegisterScreenRefreshCallback(CapturerMac::ScreenRefreshCallback, | 240 CGRegisterScreenRefreshCallback(CapturerMac::ScreenRefreshCallback, |
| 238 this); | 241 this); |
| 239 if (err != kCGErrorSuccess) { | 242 if (err != kCGErrorSuccess) { |
| 240 LOG(ERROR) << "CGRegisterScreenRefreshCallback " << err; | 243 LOG(ERROR) << "CGRegisterScreenRefreshCallback " << err; |
| 241 return false; | 244 return false; |
| 242 } | 245 } |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 Capturer* Capturer::Create() { | 623 Capturer* Capturer::Create() { |
| 621 CapturerMac* capturer = new CapturerMac(); | 624 CapturerMac* capturer = new CapturerMac(); |
| 622 if (!capturer->Init()) { | 625 if (!capturer->Init()) { |
| 623 delete capturer; | 626 delete capturer; |
| 624 capturer = NULL; | 627 capturer = NULL; |
| 625 } | 628 } |
| 626 return capturer; | 629 return capturer; |
| 627 } | 630 } |
| 628 | 631 |
| 629 } // namespace remoting | 632 } // namespace remoting |
| OLD | NEW |