From d476b955046aee5d5f750111b567f5ed51bf85b8 Mon Sep 17 00:00:00 2001 From: Magnus Jedvert Date: Thu, 20 Aug 2015 09:58:31 +0200 Subject: [PATCH] Android EglBase: Add helper functions to query the surface size BUG=webrtc:4742 R=glaznev@webrtc.org Review URL: https://codereview.webrtc.org/1299543004 . Cr-Commit-Position: refs/heads/master@{#9739} --- talk/app/webrtc/java/android/org/webrtc/EglBase.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/talk/app/webrtc/java/android/org/webrtc/EglBase.java b/talk/app/webrtc/java/android/org/webrtc/EglBase.java index 3e7020db27..8d2c808cb2 100644 --- a/talk/app/webrtc/java/android/org/webrtc/EglBase.java +++ b/talk/app/webrtc/java/android/org/webrtc/EglBase.java @@ -127,6 +127,18 @@ public final class EglBase { return eglSurface != EGL14.EGL_NO_SURFACE; } + public int surfaceWidth() { + final int widthArray[] = new int[1]; + EGL14.eglQuerySurface(eglDisplay, eglSurface, EGL14.EGL_WIDTH, widthArray, 0); + return widthArray[0]; + } + + public int surfaceHeight() { + final int heightArray[] = new int[1]; + EGL14.eglQuerySurface(eglDisplay, eglSurface, EGL14.EGL_HEIGHT, heightArray, 0); + return heightArray[0]; + } + public void releaseSurface() { if (eglSurface != EGL14.EGL_NO_SURFACE) { EGL14.eglDestroySurface(eglDisplay, eglSurface);