Add a method to remove an existing renderer from the internal list of Android renderers.

BUG=4290
R=jiayl@webrtc.org, mquiros@google.com

Review URL: https://webrtc-codereview.appspot.com/36089004

Cr-Commit-Position: refs/heads/master@{#8320}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8320 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
glaznev@webrtc.org 2015-02-10 23:23:11 +00:00
parent bc40324d9c
commit bc35703694

View File

@ -690,6 +690,19 @@ public class VideoRendererGui implements GLSurfaceView.Renderer {
}
}
public static void remove(VideoRenderer.Callbacks renderer) {
Log.d(TAG, "VideoRendererGui.remove");
if (instance == null) {
throw new RuntimeException(
"Attempt to remove yuv renderer before setting GLSurfaceView");
}
synchronized (instance.yuvImageRenderers) {
if (!instance.yuvImageRenderers.remove(renderer)) {
Log.w(TAG, "Couldn't remove renderer (not present in current list)");
}
}
}
@Override
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
Log.d(TAG, "VideoRendererGui.onSurfaceCreated");