| 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 |
| 11 #ifndef WEBRTC_SDK_ANDROID_SRC_JNI_SURFACETEXTUREHELPER_JNI_H_ | 11 #ifndef WEBRTC_SDK_ANDROID_SRC_JNI_SURFACETEXTUREHELPER_JNI_H_ |
| 12 #define WEBRTC_SDK_ANDROID_SRC_JNI_SURFACETEXTUREHELPER_JNI_H_ | 12 #define WEBRTC_SDK_ANDROID_SRC_JNI_SURFACETEXTUREHELPER_JNI_H_ |
| 13 | 13 |
| 14 #include <jni.h> | 14 #include <jni.h> |
| 15 | 15 |
| 16 #include "webrtc/api/video/video_frame_buffer.h" |
| 17 #include "webrtc/rtc_base/refcount.h" |
| 18 #include "webrtc/rtc_base/scoped_ref_ptr.h" |
| 16 #include "webrtc/sdk/android/src/jni/jni_helpers.h" | 19 #include "webrtc/sdk/android/src/jni/jni_helpers.h" |
| 17 #include "webrtc/sdk/android/src/jni/native_handle_impl.h" | 20 #include "webrtc/sdk/android/src/jni/native_handle_impl.h" |
| 18 #include "webrtc/api/video/video_frame_buffer.h" | |
| 19 #include "webrtc/base/refcount.h" | |
| 20 #include "webrtc/base/scoped_ref_ptr.h" | |
| 21 | 21 |
| 22 namespace webrtc_jni { | 22 namespace webrtc_jni { |
| 23 | 23 |
| 24 // Helper class to create and synchronize access to an Android SurfaceTexture. | 24 // Helper class to create and synchronize access to an Android SurfaceTexture. |
| 25 // It is used for creating webrtc::VideoFrameBuffers from a SurfaceTexture when | 25 // It is used for creating webrtc::VideoFrameBuffers from a SurfaceTexture when |
| 26 // the SurfaceTexture has been updated. | 26 // the SurfaceTexture has been updated. |
| 27 // When the VideoFrameBuffer is released, this class returns the buffer to the | 27 // When the VideoFrameBuffer is released, this class returns the buffer to the |
| 28 // java SurfaceTextureHelper so it can be updated safely. The VideoFrameBuffer | 28 // java SurfaceTextureHelper so it can be updated safely. The VideoFrameBuffer |
| 29 // can be released on an arbitrary thread. | 29 // can be released on an arbitrary thread. |
| 30 // SurfaceTextureHelper is reference counted to make sure that it is not | 30 // SurfaceTextureHelper is reference counted to make sure that it is not |
| (...skipping 28 matching lines...) Expand all Loading... |
| 59 SurfaceTextureHelper(JNIEnv* jni, jobject j_surface_texture_helper); | 59 SurfaceTextureHelper(JNIEnv* jni, jobject j_surface_texture_helper); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 const ScopedGlobalRef<jobject> j_surface_texture_helper_; | 62 const ScopedGlobalRef<jobject> j_surface_texture_helper_; |
| 63 const jmethodID j_return_texture_method_; | 63 const jmethodID j_return_texture_method_; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace webrtc_jni | 66 } // namespace webrtc_jni |
| 67 | 67 |
| 68 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_SURFACETEXTUREHELPER_JNI_H_ | 68 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_SURFACETEXTUREHELPER_JNI_H_ |
| OLD | NEW |