Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc

Issue 2759493002: Add DesktopCapturerId and attach it to DesktopFrame (Closed)
Patch Set: Remove dependency of webrtc/media:rtc_media_base Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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, &current_device_key_); 106 bool valid = IsScreenValid(id, &current_device_key_);
106 if (valid) 107 if (valid)
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698