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

Unified Diff: webrtc/api/java/jni/surfacetexturehelper_jni.h

Issue 1840193007: Android: Handle SurfaceTextureHelper ctor failure for decoder and capturer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Simply let startCapture fail Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/java/jni/androidvideocapturer_jni.cc ('k') | webrtc/api/java/jni/surfacetexturehelper_jni.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/java/jni/surfacetexturehelper_jni.h
diff --git a/webrtc/api/java/jni/surfacetexturehelper_jni.h b/webrtc/api/java/jni/surfacetexturehelper_jni.h
index 849c66b5dd2ca6e418d47b82c376ffd392fbbe47..2d7e0655cb27ba7c4bd12f9bc50f5926743b4e7d 100644
--- a/webrtc/api/java/jni/surfacetexturehelper_jni.h
+++ b/webrtc/api/java/jni/surfacetexturehelper_jni.h
@@ -38,9 +38,9 @@ namespace webrtc_jni {
// 4. Call CreateTextureFrame to wrap the Java texture in a VideoFrameBuffer.
class SurfaceTextureHelper : public rtc::RefCountInterface {
public:
- SurfaceTextureHelper(JNIEnv* jni,
- const char* thread_name,
- jobject j_egl_context);
+ // Might return null if creating the Java SurfaceTextureHelper fails.
+ static rtc::scoped_refptr<SurfaceTextureHelper>
+ create(JNIEnv* jni, const char* thread_name, jobject j_egl_context);
AlexG 2016/05/06 17:45:24 alignment? create is on previous line?
magjed_webrtc 2016/05/09 09:51:07 It's the result of 'clang format', but it looks a
jobject GetJavaSurfaceTextureHelper() const;
@@ -53,6 +53,10 @@ class SurfaceTextureHelper : public rtc::RefCountInterface {
~SurfaceTextureHelper();
private:
+ SurfaceTextureHelper(JNIEnv* jni, jobject j_surface_texture_helper);
+ // RefCountedObject needs access to the private ctor.
+ friend class rtc::RefCountedObject<SurfaceTextureHelper>;
+
// May be called on arbitrary thread.
void ReturnTextureFrame() const;
« no previous file with comments | « webrtc/api/java/jni/androidvideocapturer_jni.cc ('k') | webrtc/api/java/jni/surfacetexturehelper_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698