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

Unified Diff: talk/app/webrtc/java/jni/peerconnection_jni.cc

Issue 1461083002: Use EGL14 if supported on Android (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed tests Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/java/jni/peerconnection_jni.cc
diff --git a/talk/app/webrtc/java/jni/peerconnection_jni.cc b/talk/app/webrtc/java/jni/peerconnection_jni.cc
index c79e3a5cb57f7af5b3a90a7bfdf57e602fef9064..d58a29bfaa6d166e126a722844594ca0ab80a2e9 100644
--- a/talk/app/webrtc/java/jni/peerconnection_jni.cc
+++ b/talk/app/webrtc/java/jni/peerconnection_jni.cc
@@ -1298,6 +1298,32 @@ JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)(
OwnedFactoryAndThreads* owned_factory =
reinterpret_cast<OwnedFactoryAndThreads*>(native_factory);
+ // TODO(perkj): In order to not break existing applications we need to
+ // check if |local_egl_context| or |remote_egl_context| is an
+ // EGL10 context. If so, create an EGLBase10.EGL10Context instead.
+ // Remove this once existing applications has been updated.
+ jobject local_eglbase10_context = local_egl_context;
+ jobject remote_eglbase10_context = remote_egl_context;
+
+ jclass j_egl10_context_class =
+ FindClass(jni, "javax/microedition/khronos/egl/EGLContext");
+ jclass j_eglbase10_context_class =
+ FindClass(jni, "org/webrtc/EglBase10$Egl10Context");
+
+ jmethodID j_eglbase10_context_ctor = GetMethodID(
+ jni, j_eglbase10_context_class,
+ "<init>", "(Ljavax/microedition/khronos/egl/EGLContext;)V");
+ if (jni->IsInstanceOf(local_egl_context, j_egl10_context_class)) {
+ local_eglbase10_context = jni->NewObject(
+ j_eglbase10_context_class, j_eglbase10_context_ctor,
+ local_egl_context);
+ }
+ if (jni->IsInstanceOf(remote_egl_context, j_egl10_context_class)) {
+ remote_eglbase10_context = jni->NewObject(
+ j_eglbase10_context_class, j_eglbase10_context_ctor,
+ remote_egl_context);
+ }
+
MediaCodecVideoEncoderFactory* encoder_factory =
static_cast<MediaCodecVideoEncoderFactory*>
(owned_factory->encoder_factory());

Powered by Google App Engine
This is Rietveld 408576698