catch exception when hardware renderer can not be set up

This commit is contained in:
Daniel Gultsch 2024-02-07 10:55:01 +01:00
parent 7fe8be1adc
commit 01ac2912f5
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -13,6 +13,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.opengl.GLException;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@ -836,8 +837,12 @@ public class RtpSessionActivity extends XmppActivity
surfaceViewRenderer.setVisibility(View.VISIBLE); surfaceViewRenderer.setVisibility(View.VISIBLE);
try { try {
surfaceViewRenderer.init(requireRtpConnection().getEglBaseContext(), null); surfaceViewRenderer.init(requireRtpConnection().getEglBaseContext(), null);
} catch (final IllegalStateException e) { } catch (final IllegalStateException ignored) {
// Log.d(Config.LOGTAG, "SurfaceViewRenderer was already initialized"); // SurfaceViewRenderer was already initialized
} catch (final RuntimeException e) {
if (Throwables.getRootCause(e) instanceof GLException glException) {
Log.w(Config.LOGTAG, "could not set up hardware renderer", glException);
}
} }
surfaceViewRenderer.setEnableHardwareScaler(true); surfaceViewRenderer.setEnableHardwareScaler(true);
} }