| 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 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 DesktopFrame* SharedDesktopFrame::GetUnderlyingFrame() { | 32 DesktopFrame* SharedDesktopFrame::GetUnderlyingFrame() { |
| 33 return core_->get(); | 33 return core_->get(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 std::unique_ptr<SharedDesktopFrame> SharedDesktopFrame::Share() { | 36 std::unique_ptr<SharedDesktopFrame> SharedDesktopFrame::Share() { |
| 37 std::unique_ptr<SharedDesktopFrame> result(new SharedDesktopFrame(core_)); | 37 std::unique_ptr<SharedDesktopFrame> result(new SharedDesktopFrame(core_)); |
| 38 result->set_dpi(dpi()); | 38 result->set_dpi(dpi()); |
| 39 result->set_capture_time_ms(capture_time_ms()); | 39 result->set_capture_time_ms(capture_time_ms()); |
| 40 result->set_capturer_id(capturer_id()); |
| 40 *result->mutable_updated_region() = updated_region(); | 41 *result->mutable_updated_region() = updated_region(); |
| 41 return result; | 42 return result; |
| 42 } | 43 } |
| 43 | 44 |
| 44 bool SharedDesktopFrame::IsShared() { | 45 bool SharedDesktopFrame::IsShared() { |
| 45 return !core_->HasOneRef(); | 46 return !core_->HasOneRef(); |
| 46 } | 47 } |
| 47 | 48 |
| 48 SharedDesktopFrame::SharedDesktopFrame(rtc::scoped_refptr<Core> core) | 49 SharedDesktopFrame::SharedDesktopFrame(rtc::scoped_refptr<Core> core) |
| 49 : DesktopFrame((*core)->size(), | 50 : DesktopFrame((*core)->size(), |
| 50 (*core)->stride(), | 51 (*core)->stride(), |
| 51 (*core)->data(), | 52 (*core)->data(), |
| 52 (*core)->shared_memory()), | 53 (*core)->shared_memory()), |
| 53 core_(core) {} | 54 core_(core) {} |
| 54 | 55 |
| 55 } // namespace webrtc | 56 } // namespace webrtc |
| OLD | NEW |