| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 SelectObject(mem_dc, previous_object); | 245 SelectObject(mem_dc, previous_object); |
| 246 DeleteDC(mem_dc); | 246 DeleteDC(mem_dc); |
| 247 ReleaseDC(window_, window_dc); | 247 ReleaseDC(window_, window_dc); |
| 248 | 248 |
| 249 previous_size_ = frame->size(); | 249 previous_size_ = frame->size(); |
| 250 window_size_map_[window_] = previous_size_; | 250 window_size_map_[window_] = previous_size_; |
| 251 | 251 |
| 252 frame->mutable_updated_region()->SetRect( | 252 frame->mutable_updated_region()->SetRect( |
| 253 DesktopRect::MakeSize(frame->size())); | 253 DesktopRect::MakeSize(frame->size())); |
| 254 | 254 |
| 255 if (!result) { | 255 if (result) { |
| 256 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); |
| 257 } else { |
| 256 LOG(LS_ERROR) << "Both PrintWindow() and BitBlt() failed."; | 258 LOG(LS_ERROR) << "Both PrintWindow() and BitBlt() failed."; |
| 257 frame.reset(); | 259 callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); |
| 258 } | 260 } |
| 259 | |
| 260 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); | |
| 261 } | 261 } |
| 262 | 262 |
| 263 } // namespace | 263 } // namespace |
| 264 | 264 |
| 265 // static | 265 // static |
| 266 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( | 266 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( |
| 267 const DesktopCaptureOptions& options) { | 267 const DesktopCaptureOptions& options) { |
| 268 return std::unique_ptr<DesktopCapturer>(new WindowCapturerWin()); | 268 return std::unique_ptr<DesktopCapturer>(new WindowCapturerWin()); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace webrtc | 271 } // namespace webrtc |
| OLD | NEW |