Search in sources :

Example 6 with VideoState

use of org.thoughtcrime.securesms.service.webrtc.state.VideoState in project Signal-Android by signalapp.

the class OutgoingCallActionProcessor method handleTurnServerUpdate.

@Override
@NonNull
public WebRtcServiceState handleTurnServerUpdate(@NonNull WebRtcServiceState currentState, @NonNull List<PeerConnection.IceServer> iceServers, boolean isAlwaysTurn) {
    try {
        VideoState videoState = currentState.getVideoState();
        RemotePeer activePeer = currentState.getCallInfoState().requireActivePeer();
        CallParticipant callParticipant = Objects.requireNonNull(currentState.getCallInfoState().getRemoteCallParticipant(activePeer.getRecipient()));
        webRtcInteractor.getCallManager().proceed(activePeer.getCallId(), context, videoState.getLockableEglBase().require(), AudioProcessingMethodSelector.get(), videoState.requireLocalSink(), callParticipant.getVideoSink(), videoState.requireCamera(), iceServers, isAlwaysTurn, NetworkUtil.getCallingBandwidthMode(context), null, currentState.getCallSetupState(activePeer).isEnableVideoOnCreate());
    } catch (CallException e) {
        return callFailure(currentState, "Unable to proceed with call: ", e);
    }
    return currentState.builder().changeLocalDeviceState().cameraState(currentState.getVideoState().requireCamera().getCameraState()).build();
}
Also used : CallException(org.signal.ringrtc.CallException) CallParticipant(org.thoughtcrime.securesms.events.CallParticipant) RemotePeer(org.thoughtcrime.securesms.ringrtc.RemotePeer) VideoState(org.thoughtcrime.securesms.service.webrtc.state.VideoState) NonNull(androidx.annotation.NonNull)

Aggregations

NonNull (androidx.annotation.NonNull)6 CallException (org.signal.ringrtc.CallException)6 RemotePeer (org.thoughtcrime.securesms.ringrtc.RemotePeer)6 VideoState (org.thoughtcrime.securesms.service.webrtc.state.VideoState)6 CallParticipant (org.thoughtcrime.securesms.events.CallParticipant)4 GroupCall (org.signal.ringrtc.GroupCall)2 Recipient (org.thoughtcrime.securesms.recipients.Recipient)2