use of org.thoughtcrime.securesms.events.CallParticipant in project Signal-Android by WhisperSystems.
the class IncomingCallActionProcessor method handleTurnServerUpdate.
@Override
@NonNull
public WebRtcServiceState handleTurnServerUpdate(@NonNull WebRtcServiceState currentState, @NonNull List<PeerConnection.IceServer> iceServers, boolean isAlwaysTurn) {
RemotePeer activePeer = currentState.getCallInfoState().requireActivePeer();
boolean hideIp = !activePeer.getRecipient().isSystemContact() || isAlwaysTurn;
VideoState videoState = currentState.getVideoState();
CallParticipant callParticipant = Objects.requireNonNull(currentState.getCallInfoState().getRemoteCallParticipant(activePeer.getRecipient()));
try {
webRtcInteractor.getCallManager().proceed(activePeer.getCallId(), context, videoState.getLockableEglBase().require(), AudioProcessingMethodSelector.get(), videoState.requireLocalSink(), callParticipant.getVideoSink(), videoState.requireCamera(), iceServers, hideIp, NetworkUtil.getCallingBandwidthMode(context), null, false);
} catch (CallException e) {
return callFailure(currentState, "Unable to proceed with call: ", e);
}
webRtcInteractor.updatePhoneState(LockManager.PhoneState.PROCESSING);
webRtcInteractor.postStateUpdate(currentState);
return currentState;
}
use of org.thoughtcrime.securesms.events.CallParticipant in project Signal-Android by WhisperSystems.
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();
}
use of org.thoughtcrime.securesms.events.CallParticipant in project Signal-Android by WhisperSystems.
the class ActiveCallActionProcessorDelegate method handleScreenSharingEnable.
@Override
@NonNull
protected WebRtcServiceState handleScreenSharingEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
RemotePeer activePeer = currentState.getCallInfoState().requireActivePeer();
Log.i(tag, "handleScreenSharingEnable(): call_id: " + activePeer.getCallId() + " enable: " + enable);
CallParticipant oldParticipant = Objects.requireNonNull(currentState.getCallInfoState().getRemoteCallParticipant(activePeer.getRecipient()));
CallParticipant newParticipant = oldParticipant.withScreenSharingEnabled(enable);
return currentState.builder().changeCallInfoState().putParticipant(activePeer.getRecipient(), newParticipant).build();
}
use of org.thoughtcrime.securesms.events.CallParticipant in project Signal-Android by WhisperSystems.
the class CallParticipantListUpdateTest method createWrappers.
static CallParticipantListUpdate.Wrapper[] createWrappers(long... recipientIds) {
CallParticipantListUpdate.Wrapper[] ids = new CallParticipantListUpdate.Wrapper[recipientIds.length];
Set<Long> primaries = new HashSet<>();
for (int i = 0; i < recipientIds.length; i++) {
CallParticipant participant = createParticipant(recipientIds[i], recipientIds[i], primaries.contains(recipientIds[i]) ? CallParticipant.DeviceOrdinal.SECONDARY : CallParticipant.DeviceOrdinal.PRIMARY);
ids[i] = CallParticipantListUpdate.createWrapper(participant);
}
return ids;
}
use of org.thoughtcrime.securesms.events.CallParticipant in project Signal-Android by WhisperSystems.
the class WebRtcActionProcessor method handleOrientationChanged.
@NonNull
protected WebRtcServiceState handleOrientationChanged(@NonNull WebRtcServiceState currentState, boolean isLandscapeEnabled, int orientationDegrees) {
Camera camera = currentState.getVideoState().getCamera();
if (camera != null) {
camera.setOrientation(orientationDegrees);
}
int sinkRotationDegrees = isLandscapeEnabled ? BroadcastVideoSink.DEVICE_ROTATION_IGNORE : orientationDegrees;
int stateRotationDegrees = isLandscapeEnabled ? 0 : orientationDegrees;
BroadcastVideoSink sink = currentState.getVideoState().getLocalSink();
if (sink != null) {
sink.setDeviceOrientationDegrees(sinkRotationDegrees);
}
for (CallParticipant callParticipant : currentState.getCallInfoState().getRemoteCallParticipants()) {
callParticipant.getVideoSink().setDeviceOrientationDegrees(sinkRotationDegrees);
}
return currentState.builder().changeLocalDeviceState().setOrientation(Orientation.fromDegrees(stateRotationDegrees)).setLandscapeEnabled(isLandscapeEnabled).setDeviceOrientation(Orientation.fromDegrees(orientationDegrees)).build();
}
Aggregations