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

Side by Side Diff: webrtc/api/java/jni/native_handle_impl.h

Issue 1965953003: Android: Add support for cropping textures (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 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 20 matching lines...) Expand all
31 class AndroidTextureBuffer : public webrtc::NativeHandleBuffer { 31 class AndroidTextureBuffer : public webrtc::NativeHandleBuffer {
32 public: 32 public:
33 AndroidTextureBuffer(int width, 33 AndroidTextureBuffer(int width,
34 int height, 34 int height,
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 rtc::scoped_refptr<AndroidTextureBuffer> ScaleAndRotate( 41 // First crop, then scale to dst resolution, and then rotate.
42 int dst_widht, 42 rtc::scoped_refptr<AndroidTextureBuffer> CropScaleAndRotate(
43 int cropped_width,
44 int cropped_height,
45 int dst_width,
43 int dst_height, 46 int dst_height,
44 webrtc::VideoRotation rotation); 47 webrtc::VideoRotation rotation);
45 48
46 private: 49 private:
47 NativeHandleImpl native_handle_; 50 NativeHandleImpl native_handle_;
48 // Raw object pointer, relying on the caller, i.e., 51 // Raw object pointer, relying on the caller, i.e.,
49 // AndroidVideoCapturerJni or the C++ SurfaceTextureHelper, to keep 52 // AndroidVideoCapturerJni or the C++ SurfaceTextureHelper, to keep
50 // a global reference. TODO(nisse): Make this a reference to the C++ 53 // a global reference. TODO(nisse): Make this a reference to the C++
51 // SurfaceTextureHelper instead, but that requires some refactoring 54 // SurfaceTextureHelper instead, but that requires some refactoring
52 // of AndroidVideoCapturerJni. 55 // of AndroidVideoCapturerJni.
53 jobject surface_texture_helper_; 56 jobject surface_texture_helper_;
54 rtc::Callback0<void> no_longer_used_cb_; 57 rtc::Callback0<void> no_longer_used_cb_;
55 }; 58 };
56 59
57 } // namespace webrtc_jni 60 } // namespace webrtc_jni
58 61
59 #endif // WEBRTC_API_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ 62 #endif // WEBRTC_API_JAVA_JNI_NATIVE_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698