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 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "webrtc/modules/desktop_capture/cropped_desktop_frame.h" | 13 #include "webrtc/modules/desktop_capture/cropped_desktop_frame.h" |
14 | 14 |
| 15 #include "webrtc/base/constructormagic.h" |
| 16 |
15 namespace webrtc { | 17 namespace webrtc { |
16 | 18 |
17 // A DesktopFrame that is a sub-rect of another DesktopFrame. | 19 // A DesktopFrame that is a sub-rect of another DesktopFrame. |
18 class CroppedDesktopFrame : public DesktopFrame { | 20 class CroppedDesktopFrame : public DesktopFrame { |
19 public: | 21 public: |
20 CroppedDesktopFrame(DesktopFrame* frame, const DesktopRect& rect); | 22 CroppedDesktopFrame(DesktopFrame* frame, const DesktopRect& rect); |
21 | 23 |
22 private: | 24 private: |
23 std::unique_ptr<DesktopFrame> frame_; | 25 std::unique_ptr<DesktopFrame> frame_; |
24 | 26 |
(...skipping 13 matching lines...) Expand all Loading... |
38 CroppedDesktopFrame::CroppedDesktopFrame(DesktopFrame* frame, | 40 CroppedDesktopFrame::CroppedDesktopFrame(DesktopFrame* frame, |
39 const DesktopRect& rect) | 41 const DesktopRect& rect) |
40 : DesktopFrame(rect.size(), | 42 : DesktopFrame(rect.size(), |
41 frame->stride(), | 43 frame->stride(), |
42 frame->GetFrameDataAtPos(rect.top_left()), | 44 frame->GetFrameDataAtPos(rect.top_left()), |
43 frame->shared_memory()), | 45 frame->shared_memory()), |
44 frame_(frame) { | 46 frame_(frame) { |
45 } | 47 } |
46 | 48 |
47 } // namespace webrtc | 49 } // namespace webrtc |
OLD | NEW |