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

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

Issue 1416213004: EGL10.eglCreateWindowSurface(): Replace Surface input with SurfaceHolder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 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 | talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/android/org/webrtc/EglBase.java
diff --git a/talk/app/webrtc/java/android/org/webrtc/EglBase.java b/talk/app/webrtc/java/android/org/webrtc/EglBase.java
index 32c38f3f09c0970cfd17dd15ed4dc9b119c21344..2ee36882e8eb9b6e78d7cd77370dc8db3587256d 100644
--- a/talk/app/webrtc/java/android/org/webrtc/EglBase.java
+++ b/talk/app/webrtc/java/android/org/webrtc/EglBase.java
@@ -28,7 +28,7 @@
package org.webrtc;
import android.graphics.SurfaceTexture;
-import android.view.Surface;
+import android.view.SurfaceHolder;
import org.webrtc.Logging;
@@ -86,9 +86,9 @@ public final class EglBase {
eglContext = createEglContext(sharedContext, eglDisplay, eglConfig);
}
- // Create EGLSurface from the Android Surface.
- public void createSurface(Surface surface) {
- createSurfaceInternal(surface);
+ // Create EGLSurface from the Android SurfaceHolder.
+ public void createSurface(SurfaceHolder surfaceHolder) {
+ createSurfaceInternal(surfaceHolder);
}
// Create EGLSurface from the Android SurfaceTexture.
@@ -96,10 +96,10 @@ public final class EglBase {
createSurfaceInternal(surfaceTexture);
}
- // Create EGLSurface from either Surface or SurfaceTexture.
- private void createSurfaceInternal(Object surface) {
- if (!(surface instanceof Surface) && !(surface instanceof SurfaceTexture)) {
- throw new IllegalStateException("Input must be either a Surface or SurfaceTexture");
+ // Create EGLSurface from either a SurfaceHolder or a SurfaceTexture.
+ private void createSurfaceInternal(Object nativeWindow) {
+ if (!(nativeWindow instanceof SurfaceHolder) && !(nativeWindow instanceof SurfaceTexture)) {
+ throw new IllegalStateException("Input must be either a SurfaceHolder or SurfaceTexture");
}
checkIsNotReleased();
if (configType == ConfigType.PIXEL_BUFFER) {
@@ -109,7 +109,7 @@ public final class EglBase {
throw new RuntimeException("Already has an EGLSurface");
}
int[] surfaceAttribs = {EGL10.EGL_NONE};
- eglSurface = egl.eglCreateWindowSurface(eglDisplay, eglConfig, surface, surfaceAttribs);
+ eglSurface = egl.eglCreateWindowSurface(eglDisplay, eglConfig, nativeWindow, surfaceAttribs);
if (eglSurface == EGL10.EGL_NO_SURFACE) {
throw new RuntimeException("Failed to create window surface");
}
« no previous file with comments | « no previous file | talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698