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 984227de45dc1ee1831018d6195b249b430ec066..4f61fd936529e8a9846f9a0d3ec38992beac29c0 100644 |
--- a/talk/app/webrtc/java/jni/peerconnection_jni.cc |
+++ b/talk/app/webrtc/java/jni/peerconnection_jni.cc |
@@ -1300,12 +1300,36 @@ JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions)( |
static_cast<MediaCodecVideoDecoderFactory*> |
(owned_factory->decoder_factory()); |
if (decoder_factory) { |
- LOG(LS_INFO) << "Set EGL context for HW acceleration."; |
+ LOG(LS_INFO) << "Set EGL context for HW decoding."; |
decoder_factory->SetEGLContext(jni, render_egl_context); |
} |
#endif |
} |
+JOW(void, PeerConnectionFactory_nativeSetVideoHwAccelerationOptions2)( |
magjed_webrtc
2015/11/18 13:12:52
Why do we need two versions of nativeSetVideoHwAcc
perkj_webrtc
2015/11/18 14:51:21
This is on request by glaznew. We can then have se
magjed_webrtc
2015/11/18 15:38:12
The purpose with separate contexts is still unclea
|
+ JNIEnv* jni, jclass, jlong native_factory, jobject local_egl_context, |
+ jobject remote_egl_context) { |
+#if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) |
+ OwnedFactoryAndThreads* owned_factory = |
+ reinterpret_cast<OwnedFactoryAndThreads*>(native_factory); |
+ |
+ MediaCodecVideoEncoderFactory* encoder_factory = |
+ static_cast<MediaCodecVideoEncoderFactory*> |
+ (owned_factory->encoder_factory()); |
+ if (encoder_factory) { |
+ LOG(LS_INFO) << "Set EGL context for HW encoding."; |
+ encoder_factory->SetEGLContext(jni, local_egl_context); |
+ } |
+ |
+ MediaCodecVideoDecoderFactory* decoder_factory = |
+ static_cast<MediaCodecVideoDecoderFactory*> |
+ (owned_factory->decoder_factory()); |
+ if (decoder_factory) { |
+ LOG(LS_INFO) << "Set EGL context for HW decoding."; |
+ decoder_factory->SetEGLContext(jni, remote_egl_context); |
+ } |
+#endif |
+} |
static std::string |
GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) { |