Chromium Code Reviews| Index: talk/app/webrtc/java/android/org/webrtc/EglBase14.java |
| diff --git a/talk/app/webrtc/java/android/org/webrtc/EglBase14.java b/talk/app/webrtc/java/android/org/webrtc/EglBase14.java |
| index 580a3c6826fb517389e88039e7cc9e0c67edd46b..c13e2cb690c7d1c7d903c3b215ee8176cdcadc69 100644 |
| --- a/talk/app/webrtc/java/android/org/webrtc/EglBase14.java |
| +++ b/talk/app/webrtc/java/android/org/webrtc/EglBase14.java |
| @@ -33,6 +33,7 @@ import android.opengl.EGL14; |
| import android.opengl.EGLConfig; |
| import android.opengl.EGLContext; |
| import android.opengl.EGLDisplay; |
| +import android.opengl.EGLExt; |
| import android.opengl.EGLSurface; |
| import android.view.Surface; |
| @@ -42,10 +43,10 @@ import org.webrtc.Logging; |
| * Holds EGL state and utility methods for handling an EGL14 EGLContext, an EGLDisplay, |
| * and an EGLSurface. |
| */ |
| -@TargetApi(17) |
| +@TargetApi(18) |
| final class EglBase14 extends EglBase { |
| private static final String TAG = "EglBase14"; |
| - private static final int EGL14_SDK_VERSION = android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; |
| + private static final int EGL14_SDK_VERSION = android.os.Build.VERSION_CODES.JELLY_BEAN_MR2; |
|
magjed_webrtc
2015/12/16 13:51:53
It's not EGL14_SDK_VERSION anymore. I guess this i
perkj_webrtc
2015/12/16 21:18:45
Done.
|
| private static final int CURRENT_SDK_VERSION = android.os.Build.VERSION.SDK_INT; |
| private EGLContext eglContext; |
| private EGLConfig eglConfig; |
| @@ -201,6 +202,17 @@ final class EglBase14 extends EglBase { |
| EGL14.eglSwapBuffers(eglDisplay, eglSurface); |
| } |
| + @Override |
| + public void swapBuffers(long timeStampNs) { |
| + checkIsNotReleased(); |
| + if (eglSurface == EGL14.EGL_NO_SURFACE) { |
| + throw new RuntimeException("No EGLSurface - can't swap buffers"); |
| + } |
| + // See https://android.googlesource.com/platform/frameworks/native/+/tools_r22.2/opengl/specs/EGL_ANDROID_presentation_time.txt |
| + EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, timeStampNs); |
| + EGL14.eglSwapBuffers(eglDisplay, eglSurface); |
| + } |
| + |
| // Return an EGLDisplay, or die trying. |
| private static EGLDisplay getEglDisplay() { |
| EGLDisplay eglDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY); |