Android rendering: Move common EGL and GL functions to separate classes
This CL does not make any functional changes. The purpose is to extract some common code that is needed for texture capture and texture encode.
This CL does the following changes:
* Move common EGL functions from org.webrtc.MediaCodecVideoDecoder to org.webrtc.EglBase.
* Move common GL functions from org.webrtc.VideoRendererGui to org.webrtc.GlUtil and org.webrtc.GlShader.
* Remove unused call to surfaceTexture.getTransformMatrix in YuvImageRenderer.
* Add helper functions rotatedWidth()/rotatedHeight() in VideoRenderer.I420Frame.
R=glaznev@webrtc.org, hbos@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/47309005.
Cr-Commit-Position: refs/heads/master@{#9414}
diff --git a/talk/app/webrtc/java/jni/classreferenceholder.cc b/talk/app/webrtc/java/jni/classreferenceholder.cc
index f074921..2c4f1e6 100644
--- a/talk/app/webrtc/java/jni/classreferenceholder.cc
+++ b/talk/app/webrtc/java/jni/classreferenceholder.cc
@@ -73,17 +73,18 @@
LoadClass(jni, "android/graphics/SurfaceTexture");
LoadClass(jni, "org/webrtc/VideoCapturerAndroid");
LoadClass(jni, "org/webrtc/VideoCapturerAndroid$NativeObserver");
+ LoadClass(jni, "org/webrtc/EglBase");
LoadClass(jni, "org/webrtc/MediaCodecVideoEncoder");
LoadClass(jni, "org/webrtc/MediaCodecVideoEncoder$OutputBufferInfo");
LoadClass(jni, "org/webrtc/MediaCodecVideoEncoder$VideoCodecType");
LoadClass(jni, "org/webrtc/MediaCodecVideoDecoder");
LoadClass(jni, "org/webrtc/MediaCodecVideoDecoder$DecoderOutputBufferInfo");
LoadClass(jni, "org/webrtc/MediaCodecVideoDecoder$VideoCodecType");
- jclass j_decoder_class = GetClass("org/webrtc/MediaCodecVideoDecoder");
+ jclass j_egl_base_class = GetClass("org/webrtc/EglBase");
jmethodID j_is_egl14_supported_method = jni->GetStaticMethodID(
- j_decoder_class, "isEGL14Supported", "()Z");
+ j_egl_base_class, "isEGL14Supported", "()Z");
bool is_egl14_supported = jni->CallStaticBooleanMethod(
- j_decoder_class, j_is_egl14_supported_method);
+ j_egl_base_class, j_is_egl14_supported_method);
CHECK_EXCEPTION(jni);
if (is_egl14_supported) {
LoadClass(jni, "android/opengl/EGLContext");