mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Destroy EGLSurface during DummySurface cleanup
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=168020525
This commit is contained in:
parent
40d443dc02
commit
5a4155f09f
1 changed files with 9 additions and 3 deletions
|
|
@ -35,6 +35,7 @@ import static android.opengl.EGL14.eglChooseConfig;
|
||||||
import static android.opengl.EGL14.eglCreateContext;
|
import static android.opengl.EGL14.eglCreateContext;
|
||||||
import static android.opengl.EGL14.eglCreatePbufferSurface;
|
import static android.opengl.EGL14.eglCreatePbufferSurface;
|
||||||
import static android.opengl.EGL14.eglDestroyContext;
|
import static android.opengl.EGL14.eglDestroyContext;
|
||||||
|
import static android.opengl.EGL14.eglDestroySurface;
|
||||||
import static android.opengl.EGL14.eglGetDisplay;
|
import static android.opengl.EGL14.eglGetDisplay;
|
||||||
import static android.opengl.EGL14.eglInitialize;
|
import static android.opengl.EGL14.eglInitialize;
|
||||||
import static android.opengl.EGL14.eglMakeCurrent;
|
import static android.opengl.EGL14.eglMakeCurrent;
|
||||||
|
|
@ -175,8 +176,9 @@ public final class DummySurface extends Surface {
|
||||||
private static final int MSG_RELEASE = 3;
|
private static final int MSG_RELEASE = 3;
|
||||||
|
|
||||||
private final int[] textureIdHolder;
|
private final int[] textureIdHolder;
|
||||||
private EGLContext context;
|
|
||||||
private EGLDisplay display;
|
private EGLDisplay display;
|
||||||
|
private EGLContext context;
|
||||||
|
private EGLSurface pbuffer;
|
||||||
private Handler handler;
|
private Handler handler;
|
||||||
private SurfaceTexture surfaceTexture;
|
private SurfaceTexture surfaceTexture;
|
||||||
|
|
||||||
|
|
@ -315,7 +317,7 @@ public final class DummySurface extends Surface {
|
||||||
EGL_HEIGHT, 1,
|
EGL_HEIGHT, 1,
|
||||||
EGL_NONE};
|
EGL_NONE};
|
||||||
}
|
}
|
||||||
EGLSurface pbuffer = eglCreatePbufferSurface(display, config, pbufferAttributes, 0);
|
pbuffer = eglCreatePbufferSurface(display, config, pbufferAttributes, 0);
|
||||||
Assertions.checkState(pbuffer != null, "eglCreatePbufferSurface failed");
|
Assertions.checkState(pbuffer != null, "eglCreatePbufferSurface failed");
|
||||||
|
|
||||||
boolean eglMadeCurrent = eglMakeCurrent(display, pbuffer, pbuffer, context);
|
boolean eglMadeCurrent = eglMakeCurrent(display, pbuffer, pbuffer, context);
|
||||||
|
|
@ -334,11 +336,15 @@ public final class DummySurface extends Surface {
|
||||||
glDeleteTextures(1, textureIdHolder, 0);
|
glDeleteTextures(1, textureIdHolder, 0);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
if (pbuffer != null) {
|
||||||
|
eglDestroySurface(display, pbuffer);
|
||||||
|
}
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
eglDestroyContext(display, context);
|
eglDestroyContext(display, context);
|
||||||
}
|
}
|
||||||
display = null;
|
pbuffer = null;
|
||||||
context = null;
|
context = null;
|
||||||
|
display = null;
|
||||||
surface = null;
|
surface = null;
|
||||||
surfaceTexture = null;
|
surfaceTexture = null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue