| 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 #include "webrtc/api/video/i420_buffer.h" | 10 #include "webrtc/api/video/i420_buffer.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 static_cast<libyuv::RotationMode>(rotation))); | 129 static_cast<libyuv::RotationMode>(rotation))); |
| 130 | 130 |
| 131 return buffer; | 131 return buffer; |
| 132 } | 132 } |
| 133 | 133 |
| 134 void I420Buffer::InitializeData() { | 134 void I420Buffer::InitializeData() { |
| 135 memset(data_.get(), 0, | 135 memset(data_.get(), 0, |
| 136 I420DataSize(height_, stride_y_, stride_u_, stride_v_)); | 136 I420DataSize(height_, stride_y_, stride_u_, stride_v_)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 VideoFrameBuffer::Type I420Buffer::type() const { | |
| 140 return Type::kI420; | |
| 141 } | |
| 142 | |
| 143 int I420Buffer::width() const { | 139 int I420Buffer::width() const { |
| 144 return width_; | 140 return width_; |
| 145 } | 141 } |
| 146 | 142 |
| 147 int I420Buffer::height() const { | 143 int I420Buffer::height() const { |
| 148 return height_; | 144 return height_; |
| 149 } | 145 } |
| 150 | 146 |
| 151 const uint8_t* I420Buffer::DataY() const { | 147 const uint8_t* I420Buffer::DataY() const { |
| 152 return data_.get(); | 148 return data_.get(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 src, | 231 src, |
| 236 (src.width() - crop_width) / 2, (src.height() - crop_height) / 2, | 232 (src.width() - crop_width) / 2, (src.height() - crop_height) / 2, |
| 237 crop_width, crop_height); | 233 crop_width, crop_height); |
| 238 } | 234 } |
| 239 | 235 |
| 240 void I420Buffer::ScaleFrom(const VideoFrameBuffer& src) { | 236 void I420Buffer::ScaleFrom(const VideoFrameBuffer& src) { |
| 241 CropAndScaleFrom(src, 0, 0, src.width(), src.height()); | 237 CropAndScaleFrom(src, 0, 0, src.width(), src.height()); |
| 242 } | 238 } |
| 243 | 239 |
| 244 } // namespace webrtc | 240 } // namespace webrtc |
| OLD | NEW |