Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 #include <jni.h> | 32 #include <jni.h> |
| 33 | 33 |
| 34 #include "webrtc/common_video/include/video_frame_buffer.h" | 34 #include "webrtc/common_video/include/video_frame_buffer.h" |
| 35 | 35 |
| 36 namespace webrtc_jni { | 36 namespace webrtc_jni { |
| 37 | 37 |
| 38 // Wrapper for texture object. | 38 // Wrapper for texture object. |
| 39 struct NativeHandleImpl { | 39 struct NativeHandleImpl { |
| 40 NativeHandleImpl(JNIEnv* jni, | 40 NativeHandleImpl(JNIEnv* jni, |
| 41 jint j_oes_texture_id, | 41 jint j_oes_texture_id, |
| 42 jfloatArray j_transform_matrix); | 42 jfloatArray j_transform_matrix, |
| 43 jobject helper); | |
| 43 | 44 |
| 44 const int oes_texture_id; | 45 const int oes_texture_id; |
| 46 // Raw object pointer, relying on AndroidVideoCapturerJni to keep a | |
|
magjed_webrtc
2015/12/03 12:33:58
Can't you place the |surface_texture_helper| in An
nisse-webrtc
2015/12/03 13:35:21
I can. And then the GetSurfaceHelper method is no
| |
| 47 // global reference. | |
| 48 jobject surface_texture_helper; | |
| 45 float sampling_matrix[16]; | 49 float sampling_matrix[16]; |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 class AndroidTextureBuffer : public webrtc::NativeHandleBuffer { | 52 class AndroidTextureBuffer : public webrtc::NativeHandleBuffer { |
| 49 public: | 53 public: |
| 50 AndroidTextureBuffer(int width, | 54 AndroidTextureBuffer(int width, |
| 51 int height, | 55 int height, |
| 52 const NativeHandleImpl& native_handle, | 56 const NativeHandleImpl& native_handle, |
| 53 const rtc::Callback0<void>& no_longer_used); | 57 const rtc::Callback0<void>& no_longer_used); |
| 54 ~AndroidTextureBuffer(); | 58 ~AndroidTextureBuffer(); |
| 55 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; | 59 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; |
| 56 | 60 |
| 57 rtc::scoped_refptr<AndroidTextureBuffer> CropAndScale( | 61 rtc::scoped_refptr<AndroidTextureBuffer> CropAndScale( |
| 58 int cropped_input_width, | 62 int cropped_input_width, |
| 59 int cropped_input_height, | 63 int cropped_input_height, |
| 60 int dst_widht, | 64 int dst_widht, |
| 61 int dst_height); | 65 int dst_height); |
| 62 | 66 |
| 63 private: | 67 private: |
| 64 NativeHandleImpl native_handle_; | 68 NativeHandleImpl native_handle_; |
| 65 rtc::Callback0<void> no_longer_used_cb_; | 69 rtc::Callback0<void> no_longer_used_cb_; |
| 66 }; | 70 }; |
| 67 | 71 |
| 68 } // namespace webrtc_jni | 72 } // namespace webrtc_jni |
| 69 | 73 |
| 70 #endif // TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ | 74 #endif // TALK_APP_WEBRTC_JAVA_JNI_NATIVE_HANDLE_IMPL_H_ |
| OLD | NEW |