Change PeerConnectionFactory.setVideoHwAccelerationOptions to be able to replace Egl context.

BUG=b/27222102
R=glaznev@webrtc.org

Review URL: https://codereview.webrtc.org/1707933003 .

Cr-Commit-Position: refs/heads/master@{#11666}
This commit is contained in:
Per
2016-02-18 11:35:48 +01:00
parent 74db777d64
commit fd22e6cf2d
3 changed files with 15 additions and 4 deletions

View File

@ -896,7 +896,10 @@ MediaCodecVideoDecoderFactory::~MediaCodecVideoDecoderFactory() {
void MediaCodecVideoDecoderFactory::SetEGLContext(
JNIEnv* jni, jobject egl_context) {
ALOGD << "MediaCodecVideoDecoderFactory::SetEGLContext";
RTC_DCHECK(!egl_context_);
if (egl_context_) {
jni->DeleteGlobalRef(egl_context_);
egl_context_ = nullptr;
}
egl_context_ = jni->NewGlobalRef(egl_context);
if (CheckException(jni)) {
ALOGE << "error calling NewGlobalRef for EGL Context.";