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

Side by Side Diff: webrtc/api/video/i420_buffer.cc

Issue 2847383002: Add support for multiple pixel formats in VideoFrameBuffer (Closed)
Patch Set: Created 3 years, 7 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) 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 int I420Buffer::StrideY() const { 168 int I420Buffer::StrideY() const {
169 return stride_y_; 169 return stride_y_;
170 } 170 }
171 int I420Buffer::StrideU() const { 171 int I420Buffer::StrideU() const {
172 return stride_u_; 172 return stride_u_;
173 } 173 }
174 int I420Buffer::StrideV() const { 174 int I420Buffer::StrideV() const {
175 return stride_v_; 175 return stride_v_;
176 } 176 }
177 177
178 void* I420Buffer::native_handle() const {
179 return nullptr;
180 }
181
182 rtc::scoped_refptr<VideoFrameBuffer> I420Buffer::NativeToI420Buffer() {
183 return this;
184 }
185
186 uint8_t* I420Buffer::MutableDataY() { 178 uint8_t* I420Buffer::MutableDataY() {
187 return const_cast<uint8_t*>(DataY()); 179 return const_cast<uint8_t*>(DataY());
188 } 180 }
189 uint8_t* I420Buffer::MutableDataU() { 181 uint8_t* I420Buffer::MutableDataU() {
190 return const_cast<uint8_t*>(DataU()); 182 return const_cast<uint8_t*>(DataU());
191 } 183 }
192 uint8_t* I420Buffer::MutableDataV() { 184 uint8_t* I420Buffer::MutableDataV() {
193 return const_cast<uint8_t*>(DataV()); 185 return const_cast<uint8_t*>(DataV());
194 } 186 }
195 187
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 src, 242 src,
251 (src.width() - crop_width) / 2, (src.height() - crop_height) / 2, 243 (src.width() - crop_width) / 2, (src.height() - crop_height) / 2,
252 crop_width, crop_height); 244 crop_width, crop_height);
253 } 245 }
254 246
255 void I420Buffer::ScaleFrom(const VideoFrameBuffer& src) { 247 void I420Buffer::ScaleFrom(const VideoFrameBuffer& src) {
256 CropAndScaleFrom(src, 0, 0, src.width(), src.height()); 248 CropAndScaleFrom(src, 0, 0, src.width(), src.height());
257 } 249 }
258 250
259 } // namespace webrtc 251 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698