Search in sources :

Example 1 with EglBaseWrapper

use of org.thoughtcrime.securesms.components.webrtc.EglBaseWrapper in project Signal-Android by WhisperSystems.

the class WebRtcVideoUtil method initializeVideo.

@NonNull
public static WebRtcServiceState initializeVideo(@NonNull Context context, @NonNull CameraEventListener cameraEventListener, @NonNull WebRtcServiceState currentState, @NonNull Object eglBaseHolder) {
    final WebRtcServiceStateBuilder builder = currentState.builder();
    ThreadUtil.runOnMainSync(() -> {
        EglBaseWrapper eglBase = EglBaseWrapper.acquireEglBase(eglBaseHolder);
        BroadcastVideoSink localSink = new BroadcastVideoSink(eglBase, true, false, currentState.getLocalDeviceState().getOrientation().getDegrees());
        Camera camera = new Camera(context, cameraEventListener, eglBase, CameraState.Direction.FRONT);
        camera.setOrientation(currentState.getLocalDeviceState().getOrientation().getDegrees());
        builder.changeVideoState().eglBase(eglBase).localSink(localSink).camera(camera).commit().changeLocalDeviceState().cameraState(camera.getCameraState()).commit();
    });
    return builder.build();
}
Also used : BroadcastVideoSink(org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink) WebRtcServiceStateBuilder(org.thoughtcrime.securesms.service.webrtc.state.WebRtcServiceStateBuilder) EglBaseWrapper(org.thoughtcrime.securesms.components.webrtc.EglBaseWrapper) Camera(org.thoughtcrime.securesms.ringrtc.Camera) NonNull(androidx.annotation.NonNull)

Aggregations

NonNull (androidx.annotation.NonNull)1 BroadcastVideoSink (org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink)1 EglBaseWrapper (org.thoughtcrime.securesms.components.webrtc.EglBaseWrapper)1 Camera (org.thoughtcrime.securesms.ringrtc.Camera)1 WebRtcServiceStateBuilder (org.thoughtcrime.securesms.service.webrtc.state.WebRtcServiceStateBuilder)1