Chromium Code Reviews| 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 e44443baa3b4a93d77e3cb7e35254d4bb0b3cda1..e6df7b570c98abbebec446d6a3d5892bb9802a06 100644 |
| --- a/talk/app/webrtc/java/android/org/webrtc/EglBase.java |
| +++ b/talk/app/webrtc/java/android/org/webrtc/EglBase.java |
| @@ -87,6 +87,15 @@ public class EglBase { |
| EGL10.EGL_SURFACE_TYPE, EGL10.EGL_PBUFFER_BIT, |
| EGL10.EGL_NONE |
| }; |
| + public static final int[] CONFIG_PIXEL_RGBA_BUFFER = { |
| + EGL10.EGL_RED_SIZE, 8, |
| + EGL10.EGL_GREEN_SIZE, 8, |
| + EGL10.EGL_BLUE_SIZE, 8, |
| + EGL10.EGL_ALPHA_SIZE, 8, |
| + EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, |
| + EGL10.EGL_SURFACE_TYPE, EGL10.EGL_PBUFFER_BIT, |
| + EGL10.EGL_NONE |
| + }; |
| public static final int[] CONFIG_RECORDABLE = { |
| EGL10.EGL_RED_SIZE, 8, |
| EGL10.EGL_GREEN_SIZE, 8, |
| @@ -247,6 +256,19 @@ public class EglBase { |
| } |
| } |
| + // Ensure we have a pixel buffer surface of the right size. |
| + public void withPbufferSurface(int width, int height) { |
|
perkj_webrtc
2015/12/10 10:15:53
I would prefer if put this this helper method wher
nisse-webrtc
2015/12/10 12:14:56
I'll delete this method and inline the logic where
|
| + if (hasSurface()) { |
| + if (surfaceWidth() == width && |
| + surfaceHeight() == height) |
| + // We already have a surface, and of the right size. |
| + return; |
| + |
| + releaseSurface(); |
| + } |
| + createPbufferSurface(width, height); |
| + } |
| + |
| public Context getEglBaseContext() { |
| return new Context(eglContext); |
| } |