Change PeerConnectionFactory.setVideoHwAccelerationOptions to create shared Egl context for harware encoders and decoders.
Before this fix, it was required that the EGL context used as an argument was kept open until all PeerConnections using the context had been closed. With this fix, that is no longer required.
Also, if a released EGLContext (EGL_NO_CONTEXT) is used, harware codecs will fallback to use byte buffers for encoding and decoding.
BUG=b/26583522
R=glaznev@webrtc.org
Review URL: https://codereview.webrtc.org/1615153002 .
Cr-Commit-Position: refs/heads/master@{#11398}
diff --git a/talk/app/webrtc/java/jni/androidmediadecoder_jni.h b/talk/app/webrtc/java/jni/androidmediadecoder_jni.h
index 673f998..85a61c1 100644
--- a/talk/app/webrtc/java/jni/androidmediadecoder_jni.h
+++ b/talk/app/webrtc/java/jni/androidmediadecoder_jni.h
@@ -29,7 +29,7 @@
#ifndef TALK_APP_WEBRTC_JAVA_JNI_ANDROIDMEDIADECODER_JNI_H_
#define TALK_APP_WEBRTC_JAVA_JNI_ANDROIDMEDIADECODER_JNI_H_
-#include "talk/app/webrtc/java/jni/jni_helpers.h"
+#include "talk/app/webrtc/java/jni/eglbase_jni.h"
#include "talk/media/webrtc/webrtcvideodecoderfactory.h"
namespace webrtc_jni {
@@ -50,7 +50,7 @@
void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) override;
private:
- jobject render_egl_context_; // Render EGL context.
+ EglBase egl_;
std::vector<webrtc::VideoCodecType> supported_codec_types_;
};