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

Unified Diff: talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java

Issue 1349433003: Re-add SurfaceTexture as member for setLocalPreview in VideoCapturerAndroid. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
diff --git a/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java b/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
index 18eb6e43fa8a5b0d194cd3944be1089b966c863d..eff539044ca022c57bfbe085cce1376aa159a547 100644
--- a/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
+++ b/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
@@ -76,6 +76,8 @@ public class VideoCapturerAndroid extends VideoCapturer implements PreviewCallba
private Camera camera; // Only non-null while capturing.
private CameraThread cameraThread;
private Handler cameraThreadHandler;
+ // |cameraSurfaceTexture| is used with setPreviewTexture. Must be a member, see issue webrtc:5021.
+ private SurfaceTexture cameraSurfaceTexture;
magjed_webrtc 2015/09/21 11:55:32 This is very strange. I hope we are not missing a
private Context applicationContext;
private int id;
private Camera.CameraInfo info;
@@ -321,9 +323,8 @@ public class VideoCapturerAndroid extends VideoCapturer implements PreviewCallba
// and never call updateTexImage on it.
try {
cameraGlTexture = GlUtil.generateTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES);
- SurfaceTexture cameraSurfaceTexture = new SurfaceTexture(cameraGlTexture);
+ cameraSurfaceTexture = new SurfaceTexture(cameraGlTexture);
cameraSurfaceTexture.setOnFrameAvailableListener(null);
-
camera.setPreviewTexture(cameraSurfaceTexture);
} catch (IOException e) {
Logging.e(TAG, "setPreviewTexture failed", error);
@@ -461,6 +462,7 @@ public class VideoCapturerAndroid extends VideoCapturer implements PreviewCallba
Logging.d(TAG, "Release camera.");
camera.release();
camera = null;
+ cameraSurfaceTexture = null;
}
private void switchCameraOnCameraThread(Runnable switchDoneEvent) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698