| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 35 const NativeHandleImpl& native_handle, | 35 const NativeHandleImpl& native_handle, |
| 36 jobject surface_texture_helper, | 36 jobject surface_texture_helper, |
| 37 const rtc::Callback0<void>& no_longer_used); | 37 const rtc::Callback0<void>& no_longer_used); |
| 38 ~AndroidTextureBuffer(); | 38 ~AndroidTextureBuffer(); |
| 39 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; | 39 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; |
| 40 | 40 |
| 41 // First crop, then scale to dst resolution, and then rotate. | 41 // First crop, then scale to dst resolution, and then rotate. |
| 42 rtc::scoped_refptr<AndroidTextureBuffer> CropScaleAndRotate( | 42 rtc::scoped_refptr<AndroidTextureBuffer> CropScaleAndRotate( |
| 43 int cropped_width, | 43 int cropped_width, |
| 44 int cropped_height, | 44 int cropped_height, |
| 45 int crop_x, |
| 46 int crop_y, |
| 45 int dst_width, | 47 int dst_width, |
| 46 int dst_height, | 48 int dst_height, |
| 47 webrtc::VideoRotation rotation); | 49 webrtc::VideoRotation rotation); |
| 48 | 50 |
| 49 private: | 51 private: |
| 50 NativeHandleImpl native_handle_; | 52 NativeHandleImpl native_handle_; |
| 51 // Raw object pointer, relying on the caller, i.e., | 53 // Raw object pointer, relying on the caller, i.e., |
| 52 // AndroidVideoCapturerJni or the C++ SurfaceTextureHelper, to keep | 54 // AndroidVideoCapturerJni or the C++ SurfaceTextureHelper, to keep |
| 53 // a global reference. TODO(nisse): Make this a reference to the C++ | 55 // a global reference. TODO(nisse): Make this a reference to the C++ |
| 54 // SurfaceTextureHelper instead, but that requires some refactoring | 56 // SurfaceTextureHelper instead, but that requires some refactoring |
| 55 // of AndroidVideoCapturerJni. | 57 // of AndroidVideoCapturerJni. |
| 56 jobject surface_texture_helper_; | 58 jobject surface_texture_helper_; |
| 57 rtc::Callback0<void> no_longer_used_cb_; | 59 rtc::Callback0<void> no_longer_used_cb_; |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 } // namespace webrtc_jni | 62 } // namespace webrtc_jni |
| 61 | 63 |
| 62 #endif // WEBRTC_API_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ | 64 #endif // WEBRTC_API_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ |
| OLD | NEW |