OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 13 matching lines...) Expand all Loading... |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 * | 26 * |
27 */ | 27 */ |
28 | 28 |
29 #ifndef TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ | 29 #ifndef TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ |
30 #define TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ | 30 #define TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ |
31 | 31 |
32 #include <jni.h> | 32 #include <jni.h> |
33 | 33 |
| 34 #include "webrtc/common_video/interface/video_frame_buffer.h" |
| 35 |
34 namespace webrtc_jni { | 36 namespace webrtc_jni { |
35 | 37 |
36 // Wrapper for texture object. | 38 // Wrapper for texture object. |
37 struct NativeHandleImpl { | 39 struct NativeHandleImpl { |
38 NativeHandleImpl(JNIEnv* jni, | 40 NativeHandleImpl(JNIEnv* jni, |
39 jint j_oes_texture_id, | 41 jint j_oes_texture_id, |
40 jfloatArray j_transform_matrix); | 42 jfloatArray j_transform_matrix); |
41 | 43 |
42 const int oes_texture_id; | 44 const int oes_texture_id; |
43 float sampling_matrix[16]; | 45 float sampling_matrix[16]; |
44 }; | 46 }; |
45 | 47 |
| 48 class AndroidTextureBuffer : public webrtc::NativeHandleBuffer { |
| 49 public: |
| 50 AndroidTextureBuffer(int width, |
| 51 int height, |
| 52 const NativeHandleImpl& native_handle, |
| 53 const rtc::Callback0<void>& no_longer_used); |
| 54 ~AndroidTextureBuffer(); |
| 55 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; |
| 56 |
| 57 private: |
| 58 NativeHandleImpl native_handle_; |
| 59 rtc::Callback0<void> no_longer_used_cb_; |
| 60 }; |
| 61 |
46 } // namespace webrtc_jni | 62 } // namespace webrtc_jni |
47 | 63 |
48 #endif // TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ | 64 #endif // TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ |
OLD | NEW |