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

Unified Diff: webrtc/api/android/java/src/org/webrtc/EglRenderer.java

Issue 2483143002: Make releaseEglSurface in EglRenderer asynchronous. (Closed)
Patch Set: Created 4 years, 1 month 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 | webrtc/api/android/java/src/org/webrtc/SurfaceViewRenderer.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/java/src/org/webrtc/EglRenderer.java
diff --git a/webrtc/api/android/java/src/org/webrtc/EglRenderer.java b/webrtc/api/android/java/src/org/webrtc/EglRenderer.java
index 9fb035b34b9edaf37997e87276c6900e8b374dc1..65961bb56021d0c4bdc6472ed72a1bd0601145a2 100644
--- a/webrtc/api/android/java/src/org/webrtc/EglRenderer.java
+++ b/webrtc/api/android/java/src/org/webrtc/EglRenderer.java
@@ -435,8 +435,7 @@ public class EglRenderer implements VideoRenderer.Callbacks {
/**
* Release EGL surface. This function will block until the EGL surface is released.
*/
- public void releaseEglSurface() {
- final CountDownLatch completionLatch = new CountDownLatch(1);
+ public void releaseEglSurface(final Runnable completionCallback) {
// Ensure that the render thread is no longer touching the Surface before returning from this
// function.
eglSurfaceCreationRunnable.setSurface(null /* surface */);
@@ -450,14 +449,13 @@ public class EglRenderer implements VideoRenderer.Callbacks {
eglBase.detachCurrent();
eglBase.releaseSurface();
}
- completionLatch.countDown();
+ completionCallback.run();
}
});
- } else {
- completionLatch.countDown();
+ return;
}
}
- ThreadUtils.awaitUninterruptibly(completionLatch);
+ completionCallback.run();
}
/**
« no previous file with comments | « no previous file | webrtc/api/android/java/src/org/webrtc/SurfaceViewRenderer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698