Search in sources :

Example 21 with RemotePeer

use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by signalapp.

the class SignalCallManager method onSendOffer.

@Override
public void onSendOffer(@NonNull CallId callId, @Nullable Remote remote, @NonNull Integer remoteDevice, @NonNull Boolean broadcast, @NonNull byte[] opaque, @NonNull CallManager.CallMediaType callMediaType) {
    if (!(remote instanceof RemotePeer)) {
        return;
    }
    RemotePeer remotePeer = (RemotePeer) remote;
    Log.i(TAG, "onSendOffer: id: " + remotePeer.getCallId().format(remoteDevice) + " type: " + callMediaType.name());
    OfferMessage.Type offerType = WebRtcUtil.getOfferTypeFromCallMediaType(callMediaType);
    WebRtcData.CallMetadata callMetadata = new WebRtcData.CallMetadata(remotePeer, remoteDevice);
    WebRtcData.OfferMetadata offerMetadata = new WebRtcData.OfferMetadata(opaque, null, offerType);
    process((s, p) -> p.handleSendOffer(s, callMetadata, offerMetadata, broadcast));
}
Also used : OfferMessage(org.whispersystems.signalservice.api.messages.calls.OfferMessage) RemotePeer(org.thoughtcrime.securesms.ringrtc.RemotePeer)

Example 22 with RemotePeer

use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by signalapp.

the class SignalCallManager method onSendIceCandidates.

@Override
public void onSendIceCandidates(@NonNull CallId callId, @Nullable Remote remote, @NonNull Integer remoteDevice, @NonNull Boolean broadcast, @NonNull List<byte[]> iceCandidates) {
    if (!(remote instanceof RemotePeer)) {
        return;
    }
    RemotePeer remotePeer = (RemotePeer) remote;
    Log.i(TAG, "onSendIceCandidates: id: " + remotePeer.getCallId().format(remoteDevice));
    WebRtcData.CallMetadata callMetadata = new WebRtcData.CallMetadata(remotePeer, remoteDevice);
    process((s, p) -> p.handleSendIceCandidates(s, callMetadata, broadcast, iceCandidates));
}
Also used : RemotePeer(org.thoughtcrime.securesms.ringrtc.RemotePeer)

Example 23 with RemotePeer

use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by signalapp.

the class SignalCallManager method processSendMessageFailureWithChangeDetection.

private void processSendMessageFailureWithChangeDetection(@NonNull RemotePeer remotePeer, @NonNull ProcessAction failureProcessAction) {
    process((s, p) -> {
        RemotePeer activePeer = s.getCallInfoState().getActivePeer();
        boolean stateChanged = activePeer == null || remotePeer.getState() != activePeer.getState() || !remotePeer.getCallId().equals(activePeer.getCallId());
        if (stateChanged) {
            return p.handleMessageSentSuccess(s, remotePeer.getCallId());
        } else {
            return failureProcessAction.process(s, p);
        }
    });
}
Also used : RemotePeer(org.thoughtcrime.securesms.ringrtc.RemotePeer)

Example 24 with RemotePeer

use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by signalapp.

the class SignalCallManager method onSendBusy.

@Override
public void onSendBusy(@NonNull CallId callId, @Nullable Remote remote, @NonNull Integer remoteDevice, @NonNull Boolean broadcast) {
    if (!(remote instanceof RemotePeer)) {
        return;
    }
    RemotePeer remotePeer = (RemotePeer) remote;
    Log.i(TAG, "onSendBusy: id: " + remotePeer.getCallId().format(remoteDevice));
    WebRtcData.CallMetadata callMetadata = new WebRtcData.CallMetadata(remotePeer, remoteDevice);
    process((s, p) -> p.handleSendBusy(s, callMetadata, broadcast));
}
Also used : RemotePeer(org.thoughtcrime.securesms.ringrtc.RemotePeer)

Example 25 with RemotePeer

use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by signalapp.

the class ActiveCallActionProcessorDelegate method handleRemoteVideoEnable.

@Override
@NonNull
protected WebRtcServiceState handleRemoteVideoEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
    RemotePeer activePeer = currentState.getCallInfoState().requireActivePeer();
    Log.i(tag, "handleRemoteVideoEnable(): call_id: " + activePeer.getCallId());
    CallParticipant oldParticipant = Objects.requireNonNull(currentState.getCallInfoState().getRemoteCallParticipant(activePeer.getRecipient()));
    CallParticipant newParticipant = oldParticipant.withVideoEnabled(enable);
    return currentState.builder().changeCallInfoState().putParticipant(activePeer.getRecipient(), newParticipant).build();
}
Also used : CallParticipant(org.thoughtcrime.securesms.events.CallParticipant) RemotePeer(org.thoughtcrime.securesms.ringrtc.RemotePeer) NonNull(androidx.annotation.NonNull)

Aggregations

RemotePeer (org.thoughtcrime.securesms.ringrtc.RemotePeer)70 NonNull (androidx.annotation.NonNull)44 CallException (org.signal.ringrtc.CallException)32 CallId (org.signal.ringrtc.CallId)14 Recipient (org.thoughtcrime.securesms.recipients.Recipient)14 CallParticipant (org.thoughtcrime.securesms.events.CallParticipant)10 GroupId (org.thoughtcrime.securesms.groups.GroupId)10 WebRtcData (org.thoughtcrime.securesms.service.webrtc.WebRtcData)10 OfferMessage (org.whispersystems.signalservice.api.messages.calls.OfferMessage)10 Context (android.content.Context)8 Build (android.os.Build)8 Nullable (androidx.annotation.Nullable)8 Stream (com.annimon.stream.Stream)8 IOException (java.io.IOException)8 Collection (java.util.Collection)8 Collections (java.util.Collections)8 LinkedList (java.util.LinkedList)8 List (java.util.List)8 UUID (java.util.UUID)8 Log (org.signal.core.util.logging.Log)8