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

Side by Side Diff: webrtc/api/java/android/org/webrtc/EglBase.java

Issue 1848483002: Android EGL: Synchronize calls to eglSwapBuffers and eglMakeCurrent (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments Created 4 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/java/android/org/webrtc/EglBase10.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 package org.webrtc; 11 package org.webrtc;
12 12
13 import android.graphics.SurfaceTexture; 13 import android.graphics.SurfaceTexture;
14 import android.view.Surface; 14 import android.view.Surface;
15 15
16 import javax.microedition.khronos.egl.EGL10; 16 import javax.microedition.khronos.egl.EGL10;
17 17
18 18
19 /** 19 /**
20 * Holds EGL state and utility methods for handling an egl 1.0 EGLContext, an EG LDisplay, 20 * Holds EGL state and utility methods for handling an egl 1.0 EGLContext, an EG LDisplay,
21 * and an EGLSurface. 21 * and an EGLSurface.
22 */ 22 */
23 public abstract class EglBase { 23 public abstract class EglBase {
24 // EGL wrapper for an actual EGLContext. 24 // EGL wrapper for an actual EGLContext.
25 public static class Context { 25 public static class Context {
26 } 26 }
27 27
28 // According to the documentation, EGL can be used from multiple threads at th e same time if each
29 // thread has its own EGLContext, but in practice it deadlocks on some devices when doing this.
30 // Therefore, synchronize on this global lock before calling dangerous EGL fun ctions that might
31 // deadlock. See https://bugs.chromium.org/p/webrtc/issues/detail?id=5702 for more info.
32 public static final Object lock = new Object();
33
28 // These constants are taken from EGL14.EGL_OPENGL_ES2_BIT and EGL14.EGL_CONTE XT_CLIENT_VERSION. 34 // These constants are taken from EGL14.EGL_OPENGL_ES2_BIT and EGL14.EGL_CONTE XT_CLIENT_VERSION.
29 // https://android.googlesource.com/platform/frameworks/base/+/master/opengl/j ava/android/opengl/EGL14.java 35 // https://android.googlesource.com/platform/frameworks/base/+/master/opengl/j ava/android/opengl/EGL14.java
30 // This is similar to how GlSurfaceView does: 36 // This is similar to how GlSurfaceView does:
31 // http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.androi d/android/5.1.1_r1/android/opengl/GLSurfaceView.java#760 37 // http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.androi d/android/5.1.1_r1/android/opengl/GLSurfaceView.java#760
32 private static final int EGL_OPENGL_ES2_BIT = 4; 38 private static final int EGL_OPENGL_ES2_BIT = 4;
33 // Android-specific extension. 39 // Android-specific extension.
34 private static final int EGL_RECORDABLE_ANDROID = 0x3142; 40 private static final int EGL_RECORDABLE_ANDROID = 0x3142;
35 41
36 public static final int[] CONFIG_PLAIN = { 42 public static final int[] CONFIG_PLAIN = {
37 EGL10.EGL_RED_SIZE, 8, 43 EGL10.EGL_RED_SIZE, 8,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 119
114 public abstract void release(); 120 public abstract void release();
115 121
116 public abstract void makeCurrent(); 122 public abstract void makeCurrent();
117 123
118 // Detach the current EGL context, so that it can be made current on another t hread. 124 // Detach the current EGL context, so that it can be made current on another t hread.
119 public abstract void detachCurrent(); 125 public abstract void detachCurrent();
120 126
121 public abstract void swapBuffers(); 127 public abstract void swapBuffers();
122 } 128 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/java/android/org/webrtc/EglBase10.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698