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

Side by Side Diff: webrtc/modules/desktop_capture/desktop_frame.cc

Issue 2851513003: Forward capturer_id between DesktopFrame and its implementations (Closed)
Patch Set: Created 3 years, 7 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/desktop_capturer_differ_wrapper.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) 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 DesktopFrame* BasicDesktopFrame::CopyOf(const DesktopFrame& frame) { 70 DesktopFrame* BasicDesktopFrame::CopyOf(const DesktopFrame& frame) {
71 DesktopFrame* result = new BasicDesktopFrame(frame.size()); 71 DesktopFrame* result = new BasicDesktopFrame(frame.size());
72 for (int y = 0; y < frame.size().height(); ++y) { 72 for (int y = 0; y < frame.size().height(); ++y) {
73 memcpy(result->data() + y * result->stride(), 73 memcpy(result->data() + y * result->stride(),
74 frame.data() + y * frame.stride(), 74 frame.data() + y * frame.stride(),
75 frame.size().width() * kBytesPerPixel); 75 frame.size().width() * kBytesPerPixel);
76 } 76 }
77 result->set_dpi(frame.dpi()); 77 result->set_dpi(frame.dpi());
78 result->set_capture_time_ms(frame.capture_time_ms()); 78 result->set_capture_time_ms(frame.capture_time_ms());
79 result->set_capturer_id(frame.capturer_id());
79 *result->mutable_updated_region() = frame.updated_region(); 80 *result->mutable_updated_region() = frame.updated_region();
80 return result; 81 return result;
81 } 82 }
82 83
83 // static 84 // static
84 std::unique_ptr<DesktopFrame> SharedMemoryDesktopFrame::Create( 85 std::unique_ptr<DesktopFrame> SharedMemoryDesktopFrame::Create(
85 DesktopSize size, 86 DesktopSize size,
86 SharedMemoryFactory* shared_memory_factory) { 87 SharedMemoryFactory* shared_memory_factory) {
87 size_t buffer_size = size.height() * size.width() * kBytesPerPixel; 88 size_t buffer_size = size.height() * size.width() * kBytesPerPixel;
88 std::unique_ptr<SharedMemory> shared_memory = 89 std::unique_ptr<SharedMemory> shared_memory =
(...skipping 20 matching lines...) Expand all
109 : DesktopFrame(size, 110 : DesktopFrame(size,
110 stride, 111 stride,
111 reinterpret_cast<uint8_t*>(shared_memory->data()), 112 reinterpret_cast<uint8_t*>(shared_memory->data()),
112 shared_memory) {} 113 shared_memory) {}
113 114
114 SharedMemoryDesktopFrame::~SharedMemoryDesktopFrame() { 115 SharedMemoryDesktopFrame::~SharedMemoryDesktopFrame() {
115 delete shared_memory_; 116 delete shared_memory_;
116 } 117 }
117 118
118 } // namespace webrtc 119 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_capturer_differ_wrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698