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

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

Issue 1743203002: Replace scoped_ptr with unique_ptr in webrtc/modules/desktop_capture/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: More Windows reverts Created 4 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
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
11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_H_ 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_H_
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_H_ 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_H_
13 13
14 #include "webrtc/base/scoped_ptr.h" 14 #include <memory>
15
15 #include "webrtc/modules/desktop_capture/desktop_geometry.h" 16 #include "webrtc/modules/desktop_capture/desktop_geometry.h"
16 #include "webrtc/modules/desktop_capture/desktop_region.h" 17 #include "webrtc/modules/desktop_capture/desktop_region.h"
17 #include "webrtc/modules/desktop_capture/shared_memory.h" 18 #include "webrtc/modules/desktop_capture/shared_memory.h"
18 #include "webrtc/typedefs.h" 19 #include "webrtc/typedefs.h"
19 20
20 namespace webrtc { 21 namespace webrtc {
21 22
22 // DesktopFrame represents a video frame captured from the screen. 23 // DesktopFrame represents a video frame captured from the screen.
23 class DesktopFrame { 24 class DesktopFrame {
24 public: 25 public:
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 82
82 // Ownership of the buffers is defined by the classes that inherit from this 83 // Ownership of the buffers is defined by the classes that inherit from this
83 // class. They must guarantee that the buffer is not deleted before the frame 84 // class. They must guarantee that the buffer is not deleted before the frame
84 // is deleted. 85 // is deleted.
85 uint8_t* const data_; 86 uint8_t* const data_;
86 SharedMemory* const shared_memory_; 87 SharedMemory* const shared_memory_;
87 88
88 DesktopRegion updated_region_; 89 DesktopRegion updated_region_;
89 DesktopVector dpi_; 90 DesktopVector dpi_;
90 int64_t capture_time_ms_; 91 int64_t capture_time_ms_;
91 rtc::scoped_ptr<DesktopRegion> shape_; 92 std::unique_ptr<DesktopRegion> shape_;
92 93
93 private: 94 private:
94 RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrame); 95 RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrame);
95 }; 96 };
96 97
97 // A DesktopFrame that stores data in the heap. 98 // A DesktopFrame that stores data in the heap.
98 class BasicDesktopFrame : public DesktopFrame { 99 class BasicDesktopFrame : public DesktopFrame {
99 public: 100 public:
100 explicit BasicDesktopFrame(DesktopSize size); 101 explicit BasicDesktopFrame(DesktopSize size);
101 ~BasicDesktopFrame() override; 102 ~BasicDesktopFrame() override;
102 103
103 // Creates a BasicDesktopFrame that contains copy of |frame|. 104 // Creates a BasicDesktopFrame that contains copy of |frame|.
104 static DesktopFrame* CopyOf(const DesktopFrame& frame); 105 static DesktopFrame* CopyOf(const DesktopFrame& frame);
105 106
106 private: 107 private:
107 RTC_DISALLOW_COPY_AND_ASSIGN(BasicDesktopFrame); 108 RTC_DISALLOW_COPY_AND_ASSIGN(BasicDesktopFrame);
108 }; 109 };
109 110
110 // A DesktopFrame that stores data in shared memory. 111 // A DesktopFrame that stores data in shared memory.
111 class SharedMemoryDesktopFrame : public DesktopFrame { 112 class SharedMemoryDesktopFrame : public DesktopFrame {
112 public: 113 public:
113 static rtc::scoped_ptr<DesktopFrame> Create( 114 static std::unique_ptr<DesktopFrame> Create(
114 DesktopSize size, 115 DesktopSize size,
115 SharedMemoryFactory* shared_memory_factory); 116 SharedMemoryFactory* shared_memory_factory);
116 117
117 // Takes ownership of |shared_memory|. 118 // Takes ownership of |shared_memory|.
118 // TODO(sergeyu): Remove this constructor and keep the second one. 119 // TODO(sergeyu): Remove this constructor and keep the second one.
119 SharedMemoryDesktopFrame(DesktopSize size, 120 SharedMemoryDesktopFrame(DesktopSize size,
120 int stride, 121 int stride,
121 SharedMemory* shared_memory); 122 SharedMemory* shared_memory);
122 SharedMemoryDesktopFrame(DesktopSize size, 123 SharedMemoryDesktopFrame(DesktopSize size,
123 int stride, 124 int stride,
124 rtc::scoped_ptr<SharedMemory> shared_memory); 125 std::unique_ptr<SharedMemory> shared_memory);
125 ~SharedMemoryDesktopFrame() override; 126 ~SharedMemoryDesktopFrame() override;
126 127
127 private: 128 private:
128 RTC_DISALLOW_COPY_AND_ASSIGN(SharedMemoryDesktopFrame); 129 RTC_DISALLOW_COPY_AND_ASSIGN(SharedMemoryDesktopFrame);
129 }; 130 };
130 131
131 } // namespace webrtc 132 } // namespace webrtc
132 133
133 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_H_ 134 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_FRAME_H_
134 135
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698