null check SurfaceTextureHelper

This commit is contained in:
Daniel Gultsch 2024-03-04 09:49:03 +01:00
parent b9a19dc6c7
commit 29978a0f2a
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -57,6 +57,9 @@ class VideoSourceWrapper {
final EglBase.Context eglBaseContext) {
final SurfaceTextureHelper surfaceTextureHelper =
SurfaceTextureHelper.create("webrtc", eglBaseContext);
if (surfaceTextureHelper == null) {
throw new IllegalStateException("Could not create SurfaceTextureHelper");
}
this.videoSource = peerConnectionFactory.createVideoSource(false);
this.cameraVideoCapturer.initialize(
surfaceTextureHelper, context, this.videoSource.getCapturerObserver());