diff --git a/talk/app/webrtc/java/android/org/webrtc/VideoRendererGui.java b/talk/app/webrtc/java/android/org/webrtc/VideoRendererGui.java index 67b8c8c83..0a7e53180 100644 --- a/talk/app/webrtc/java/android/org/webrtc/VideoRendererGui.java +++ b/talk/app/webrtc/java/android/org/webrtc/VideoRendererGui.java @@ -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");