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

Side by Side Diff: webrtc/api/android/jni/androidvideocapturer_jni.cc

Issue 2278883002: Move MutableDataY{,U,V} methods to I420Buffer only. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update android capture and decoder code. Created 4 years, 3 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 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 200 }
201 201
202 int rotated_width = crop_width; 202 int rotated_width = crop_width;
203 int rotated_height = crop_height; 203 int rotated_height = crop_height;
204 204
205 if (capturer_->apply_rotation() && (rotation == 90 || rotation == 270)) { 205 if (capturer_->apply_rotation() && (rotation == 90 || rotation == 270)) {
206 std::swap(adapted_width, adapted_height); 206 std::swap(adapted_width, adapted_height);
207 std::swap(rotated_width, rotated_height); 207 std::swap(rotated_width, rotated_height);
208 } 208 }
209 209
210 rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer = 210 rtc::scoped_refptr<webrtc::I420Buffer> buffer =
211 pre_scale_pool_.CreateBuffer(rotated_width, rotated_height); 211 pre_scale_pool_.CreateBuffer(rotated_width, rotated_height);
212 212
213 const uint8_t* y_plane = static_cast<const uint8_t*>(video_frame); 213 const uint8_t* y_plane = static_cast<const uint8_t*>(video_frame);
214 const uint8_t* uv_plane = y_plane + width * height; 214 const uint8_t* uv_plane = y_plane + width * height;
215 215
216 // Can only crop at even pixels. 216 // Can only crop at even pixels.
217 crop_x &= ~1; 217 crop_x &= ~1;
218 crop_y &= ~1; 218 crop_y &= ~1;
219 int uv_width = (width + 1) / 2; 219 int uv_width = (width + 1) / 2;
220 220
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 340
341 JOW(void, VideoCapturer_00024NativeObserver_nativeOnOutputFormatRequest) 341 JOW(void, VideoCapturer_00024NativeObserver_nativeOnOutputFormatRequest)
342 (JNIEnv* jni, jclass, jlong j_capturer, jint j_width, jint j_height, 342 (JNIEnv* jni, jclass, jlong j_capturer, jint j_width, jint j_height,
343 jint j_fps) { 343 jint j_fps) {
344 LOG(LS_INFO) << "NativeObserver_nativeOnOutputFormatRequest"; 344 LOG(LS_INFO) << "NativeObserver_nativeOnOutputFormatRequest";
345 reinterpret_cast<AndroidVideoCapturerJni*>(j_capturer)->OnOutputFormatRequest( 345 reinterpret_cast<AndroidVideoCapturerJni*>(j_capturer)->OnOutputFormatRequest(
346 j_width, j_height, j_fps); 346 j_width, j_height, j_fps);
347 } 347 }
348 348
349 } // namespace webrtc_jni 349 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698