From 8db246a6bbda2b73573c07e196d428647967b259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Kalliom=C3=A4ki?= Date: Thu, 4 Oct 2018 10:58:24 +0200 Subject: [PATCH] Document methods that are only supported on a specific Android version. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R=phensman@webrtc.org Bug: webrtc:9819 Change-Id: Ifd3da9e1b70d0cfc479777c3a8031f632296be38 Reviewed-on: https://webrtc-review.googlesource.com/c/103680 Reviewed-by: Paulina Hensman Commit-Queue: Sami Kalliomäki Cr-Commit-Position: refs/heads/master@{#24987} --- sdk/android/api/org/webrtc/EglBase.java | 12 ++++++++++-- .../api/org/webrtc/ScreenCapturerAndroid.java | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk/android/api/org/webrtc/EglBase.java b/sdk/android/api/org/webrtc/EglBase.java index 31ab678225..50ebe6cbf3 100644 --- a/sdk/android/api/org/webrtc/EglBase.java +++ b/sdk/android/api/org/webrtc/EglBase.java @@ -11,8 +11,8 @@ package org.webrtc; import android.graphics.SurfaceTexture; -import javax.annotation.Nullable; import android.view.Surface; +import javax.annotation.Nullable; import javax.microedition.khronos.egl.EGL10; /** @@ -21,7 +21,15 @@ import javax.microedition.khronos.egl.EGL10; */ public interface EglBase { // EGL wrapper for an actual EGLContext. - public interface Context { long getNativeEglContext(); } + public interface Context { + /** + * Returns an EGL context that can be used by native code. Returns 0 if the method is + * unsupported. + * + * @note This is currently only supported for EGL 1.4 and not for EGL 1.0. + */ + long getNativeEglContext(); + } // According to the documentation, EGL can be used from multiple threads at the same time if each // thread has its own EGLContext, but in practice it deadlocks on some devices when doing this. diff --git a/sdk/android/api/org/webrtc/ScreenCapturerAndroid.java b/sdk/android/api/org/webrtc/ScreenCapturerAndroid.java index 2528460f32..fef28f5ac1 100644 --- a/sdk/android/api/org/webrtc/ScreenCapturerAndroid.java +++ b/sdk/android/api/org/webrtc/ScreenCapturerAndroid.java @@ -31,6 +31,8 @@ import javax.annotation.Nullable; * place on the HandlerThread of the given {@code SurfaceTextureHelper}. When done with each frame, * the native code returns the buffer to the {@code SurfaceTextureHelper} to be used for new * frames. At any time, at most one frame is being processed. + * + * @note This class is only supported on Android Lollipop and above. */ @TargetApi(21) public class ScreenCapturerAndroid implements VideoCapturer, VideoSink {