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

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

Issue 1783793002: VideoCapturer: Update interface (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 13 matching lines...) Expand all
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
31 // destroyed while a VideoFrameBuffer is in use. 31 // destroyed while a VideoFrameBuffer is in use.
32 // This class is the C++ counterpart of the java class SurfaceTextureHelper. 32 // This class is the C++ counterpart of the java class SurfaceTextureHelper.
33 // Usage: 33 // Usage:
34 // 1. Create an java instance of SurfaceTextureHelper. 34 // 1. Create an java instance of SurfaceTextureHelper.
perkj_webrtc 2016/03/11 15:25:02 Please change this comment as well.
magjed_webrtc 2016/03/13 11:14:34 Done.
35 // 2. Create an instance of this class. 35 // 2. Create an instance of this class.
36 // 3. Register a listener to the Java SurfaceListener and start producing 36 // 3. Register a listener to the Java SurfaceListener and start producing
37 // new buffers. 37 // new buffers.
38 // 4. Call CreateTextureFrame to wrap the Java texture in a VideoFrameBuffer. 38 // 4. Call CreateTextureFrame to wrap the Java texture in a VideoFrameBuffer.
39 class SurfaceTextureHelper : public rtc::RefCountInterface { 39 class SurfaceTextureHelper : public rtc::RefCountInterface {
40 public: 40 public:
41 SurfaceTextureHelper(JNIEnv* jni, jobject surface_texture_helper); 41 SurfaceTextureHelper(JNIEnv* jni, jobject j_egl_context);
42
43 jobject GetJavaSurfaceTextureHelper() const;
42 44
43 rtc::scoped_refptr<webrtc::VideoFrameBuffer> CreateTextureFrame( 45 rtc::scoped_refptr<webrtc::VideoFrameBuffer> CreateTextureFrame(
44 int width, 46 int width,
45 int height, 47 int height,
46 const NativeHandleImpl& native_handle); 48 const NativeHandleImpl& native_handle);
47 49
48 protected: 50 protected:
49 ~SurfaceTextureHelper(); 51 ~SurfaceTextureHelper();
50 52
51 private: 53 private:
52 // May be called on arbitrary thread. 54 // May be called on arbitrary thread.
53 void ReturnTextureFrame() const; 55 void ReturnTextureFrame() const;
54 56
55 const ScopedGlobalRef<jobject> j_surface_texture_helper_; 57 const ScopedGlobalRef<jobject> j_surface_texture_helper_;
56 const jmethodID j_return_texture_method_; 58 const jmethodID j_return_texture_method_;
57 }; 59 };
58 60
59 } // namespace webrtc_jni 61 } // namespace webrtc_jni
60 62
61 #endif // WEBRTC_API_JAVA_JNI_SURFACETEXTUREHELPER_JNI_H_ 63 #endif // WEBRTC_API_JAVA_JNI_SURFACETEXTUREHELPER_JNI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698