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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 int StrideU() const override; | 115 int StrideU() const override; |
116 int StrideV() const override; | 116 int StrideV() const override; |
117 | 117 |
118 void* native_handle() const override; | 118 void* native_handle() const override; |
119 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; | 119 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; |
120 | 120 |
121 // Create a new buffer and copy the pixel data. | 121 // Create a new buffer and copy the pixel data. |
122 static rtc::scoped_refptr<I420Buffer> Copy( | 122 static rtc::scoped_refptr<I420Buffer> Copy( |
123 const rtc::scoped_refptr<VideoFrameBuffer>& buffer); | 123 const rtc::scoped_refptr<VideoFrameBuffer>& buffer); |
124 | 124 |
| 125 // Create a new buffer with identical strides, and copy the pixel data. |
| 126 static rtc::scoped_refptr<I420Buffer> CopyKeepStride( |
| 127 const rtc::scoped_refptr<VideoFrameBuffer>& buffer); |
| 128 |
125 protected: | 129 protected: |
126 ~I420Buffer() override; | 130 ~I420Buffer() override; |
127 | 131 |
128 private: | 132 private: |
129 const int width_; | 133 const int width_; |
130 const int height_; | 134 const int height_; |
131 const int stride_y_; | 135 const int stride_y_; |
132 const int stride_u_; | 136 const int stride_u_; |
133 const int stride_v_; | 137 const int stride_v_; |
134 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_; | 138 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // Helper function to crop |buffer| without making a deep copy. May only be used | 209 // Helper function to crop |buffer| without making a deep copy. May only be used |
206 // for non-native frames. | 210 // for non-native frames. |
207 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( | 211 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( |
208 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, | 212 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
209 int cropped_width, | 213 int cropped_width, |
210 int cropped_height); | 214 int cropped_height); |
211 | 215 |
212 } // namespace webrtc | 216 } // namespace webrtc |
213 | 217 |
214 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 218 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
OLD | NEW |