android: disable HW accelerated decoding on Samsung

They just keep crashing.
This commit is contained in:
Saúl Ibarra Corretgé 2020-03-05 16:41:41 +01:00 committed by Saúl Ibarra Corretgé
parent 073fdc7b0e
commit 38d1032fec
1 changed files with 12 additions and 7 deletions

View File

@ -17,6 +17,8 @@
package org.jitsi.meet.sdk;
import android.app.Activity;
import android.os.Build;
import androidx.annotation.Nullable;
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
@ -90,16 +92,19 @@ class ReactInstanceManagerHolder {
options.setAudioDeviceModule(adm);
VideoEncoderFactory videoEncoderFactory = new SoftwareVideoEncoderFactory();
VideoDecoderFactory videoDecoderFactory;
VideoDecoderFactory videoDecoderFactory = new SoftwareVideoDecoderFactory();
// Initialize EGL context required for HW acceleration. We are only going to use it for
// decoding.
EglBase.Context eglContext = EglUtils.getRootEglBaseContext();
if (eglContext == null) {
// Fallback to the software decoder.
videoDecoderFactory = new SoftwareVideoDecoderFactory();
} else {
videoDecoderFactory = new DefaultVideoDecoderFactory(eglContext);
// NOTE: We are explicitly skipping Samsung devices because we have observed a high crash
// count on them.
if (!Build.MANUFACTURER.toLowerCase().contains("samsung")) {
EglBase.Context eglContext = EglUtils.getRootEglBaseContext();
if (eglContext != null) {
videoDecoderFactory = new DefaultVideoDecoderFactory(eglContext);
}
}
options.setVideoDecoderFactory(videoDecoderFactory);
options.setVideoEncoderFactory(videoEncoderFactory);