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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 static rtc::scoped_refptr<SurfaceTextureHelper> create( | 42 static rtc::scoped_refptr<SurfaceTextureHelper> create( |
43 JNIEnv* jni, const char* thread_name, jobject j_egl_context); | 43 JNIEnv* jni, const char* thread_name, jobject j_egl_context); |
44 | 44 |
45 jobject GetJavaSurfaceTextureHelper() const; | 45 jobject GetJavaSurfaceTextureHelper() const; |
46 | 46 |
47 rtc::scoped_refptr<webrtc::VideoFrameBuffer> CreateTextureFrame( | 47 rtc::scoped_refptr<webrtc::VideoFrameBuffer> CreateTextureFrame( |
48 int width, | 48 int width, |
49 int height, | 49 int height, |
50 const NativeHandleImpl& native_handle); | 50 const NativeHandleImpl& native_handle); |
51 | 51 |
| 52 // May be called on arbitrary thread. |
| 53 void ReturnTextureFrame() const; |
| 54 |
52 protected: | 55 protected: |
53 ~SurfaceTextureHelper(); | 56 ~SurfaceTextureHelper(); |
54 SurfaceTextureHelper(JNIEnv* jni, jobject j_surface_texture_helper); | 57 SurfaceTextureHelper(JNIEnv* jni, jobject j_surface_texture_helper); |
55 | 58 |
56 private: | 59 private: |
57 // May be called on arbitrary thread. | |
58 void ReturnTextureFrame() const; | |
59 | |
60 const ScopedGlobalRef<jobject> j_surface_texture_helper_; | 60 const ScopedGlobalRef<jobject> j_surface_texture_helper_; |
61 const jmethodID j_return_texture_method_; | 61 const jmethodID j_return_texture_method_; |
62 }; | 62 }; |
63 | 63 |
64 } // namespace webrtc_jni | 64 } // namespace webrtc_jni |
65 | 65 |
66 #endif // WEBRTC_API_JAVA_JNI_SURFACETEXTUREHELPER_JNI_H_ | 66 #endif // WEBRTC_API_JAVA_JNI_SURFACETEXTUREHELPER_JNI_H_ |
OLD | NEW |