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));
}
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));
}
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);
}
});
}
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));
}
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();
}
Aggregations