OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 int crop_width, | 127 int crop_width, |
128 int crop_height); | 128 int crop_height); |
129 | 129 |
130 // The common case of a center crop, when needed to adjust the | 130 // The common case of a center crop, when needed to adjust the |
131 // aspect ratio without distorting the image. | 131 // aspect ratio without distorting the image. |
132 void CropAndScaleFrom(const rtc::scoped_refptr<VideoFrameBuffer>& src); | 132 void CropAndScaleFrom(const rtc::scoped_refptr<VideoFrameBuffer>& src); |
133 | 133 |
134 // Scale all of |src| to the size of |this| buffer, with no cropping. | 134 // Scale all of |src| to the size of |this| buffer, with no cropping. |
135 void ScaleFrom(const rtc::scoped_refptr<VideoFrameBuffer>& src); | 135 void ScaleFrom(const rtc::scoped_refptr<VideoFrameBuffer>& src); |
136 | 136 |
| 137 // Create a new buffer with identical strides, and copy the pixel data. |
| 138 static rtc::scoped_refptr<I420Buffer> CopyKeepStride( |
| 139 const rtc::scoped_refptr<VideoFrameBuffer>& buffer); |
| 140 |
137 protected: | 141 protected: |
138 ~I420Buffer() override; | 142 ~I420Buffer() override; |
139 | 143 |
140 private: | 144 private: |
141 const int width_; | 145 const int width_; |
142 const int height_; | 146 const int height_; |
143 const int stride_y_; | 147 const int stride_y_; |
144 const int stride_u_; | 148 const int stride_u_; |
145 const int stride_v_; | 149 const int stride_v_; |
146 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_; | 150 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 const uint8_t* const v_plane_; | 211 const uint8_t* const v_plane_; |
208 const int y_stride_; | 212 const int y_stride_; |
209 const int u_stride_; | 213 const int u_stride_; |
210 const int v_stride_; | 214 const int v_stride_; |
211 rtc::Callback0<void> no_longer_used_cb_; | 215 rtc::Callback0<void> no_longer_used_cb_; |
212 }; | 216 }; |
213 | 217 |
214 } // namespace webrtc | 218 } // namespace webrtc |
215 | 219 |
216 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 220 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
OLD | NEW |