| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Emit the current frame. | 87 // Emit the current frame. |
| 88 std::unique_ptr<DesktopFrame> frame = queue_.current_frame()->Share(); | 88 std::unique_ptr<DesktopFrame> frame = queue_.current_frame()->Share(); |
| 89 frame->set_dpi(DesktopVector( | 89 frame->set_dpi(DesktopVector( |
| 90 GetDeviceCaps(desktop_dc_, LOGPIXELSX), | 90 GetDeviceCaps(desktop_dc_, LOGPIXELSX), |
| 91 GetDeviceCaps(desktop_dc_, LOGPIXELSY))); | 91 GetDeviceCaps(desktop_dc_, LOGPIXELSY))); |
| 92 frame->mutable_updated_region()->SetRect( | 92 frame->mutable_updated_region()->SetRect( |
| 93 DesktopRect::MakeSize(frame->size())); | 93 DesktopRect::MakeSize(frame->size())); |
| 94 frame->set_capture_time_ms( | 94 frame->set_capture_time_ms( |
| 95 (rtc::TimeNanos() - capture_start_time_nanos) / | 95 (rtc::TimeNanos() - capture_start_time_nanos) / |
| 96 rtc::kNumNanosecsPerMillisec); | 96 rtc::kNumNanosecsPerMillisec); |
| 97 frame->set_capturer_id(DesktopCapturerId::kScreenCapturerWinGdi); |
| 97 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); | 98 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); |
| 98 } | 99 } |
| 99 | 100 |
| 100 bool ScreenCapturerWinGdi::GetSourceList(SourceList* sources) { | 101 bool ScreenCapturerWinGdi::GetSourceList(SourceList* sources) { |
| 101 return webrtc::GetScreenList(sources); | 102 return webrtc::GetScreenList(sources); |
| 102 } | 103 } |
| 103 | 104 |
| 104 bool ScreenCapturerWinGdi::SelectSource(SourceId id) { | 105 bool ScreenCapturerWinGdi::SelectSource(SourceId id) { |
| 105 bool valid = IsScreenValid(id, ¤t_device_key_); | 106 bool valid = IsScreenValid(id, ¤t_device_key_); |
| 106 if (valid) | 107 if (valid) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } | 223 } |
| 223 | 224 |
| 224 // Select back the previously selected object to that the device contect | 225 // Select back the previously selected object to that the device contect |
| 225 // could be destroyed independently of the bitmap if needed. | 226 // could be destroyed independently of the bitmap if needed. |
| 226 SelectObject(memory_dc_, previous_object); | 227 SelectObject(memory_dc_, previous_object); |
| 227 | 228 |
| 228 return result; | 229 return result; |
| 229 } | 230 } |
| 230 | 231 |
| 231 } // namespace webrtc | 232 } // namespace webrtc |
| OLD | NEW |