Search in sources :

Example 16 with BroadcastVideoSink

use of org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink in project Signal-Android by signalapp.

the class GroupActionProcessor method handleUpdateRenderedResolutions.

@Override
@NonNull
protected WebRtcServiceState handleUpdateRenderedResolutions(@NonNull WebRtcServiceState currentState) {
    Map<CallParticipantId, CallParticipant> participants = currentState.getCallInfoState().getRemoteCallParticipantsMap();
    ArrayList<GroupCall.VideoRequest> resolutionRequests = new ArrayList<>(participants.size());
    for (Map.Entry<CallParticipantId, CallParticipant> entry : participants.entrySet()) {
        BroadcastVideoSink videoSink = entry.getValue().getVideoSink();
        BroadcastVideoSink.RequestedSize maxSize = videoSink.getMaxRequestingSize();
        resolutionRequests.add(new GroupCall.VideoRequest(entry.getKey().getDemuxId(), maxSize.getWidth(), maxSize.getHeight(), null));
        videoSink.setCurrentlyRequestedMaxSize(maxSize);
    }
    try {
        currentState.getCallInfoState().requireGroupCall().requestVideo(resolutionRequests);
    } catch (CallException e) {
        return groupCallFailure(currentState, "Unable to set rendered resolutions", e);
    }
    return currentState;
}
Also used : CallException(org.signal.ringrtc.CallException) CallParticipant(org.thoughtcrime.securesms.events.CallParticipant) BroadcastVideoSink(org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink) ArrayList(java.util.ArrayList) CallParticipantId(org.thoughtcrime.securesms.events.CallParticipantId) GroupCall(org.signal.ringrtc.GroupCall) Map(java.util.Map) NonNull(androidx.annotation.NonNull)

Aggregations

NonNull (androidx.annotation.NonNull)16 BroadcastVideoSink (org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink)16 CallParticipantId (org.thoughtcrime.securesms.events.CallParticipantId)10 CallParticipant (org.thoughtcrime.securesms.events.CallParticipant)8 CallException (org.signal.ringrtc.CallException)6 GroupCall (org.signal.ringrtc.GroupCall)6 Recipient (org.thoughtcrime.securesms.recipients.Recipient)6 WebRtcServiceStateBuilder (org.thoughtcrime.securesms.service.webrtc.state.WebRtcServiceStateBuilder)6 ArrayList (java.util.ArrayList)4 EglBaseWrapper (org.thoughtcrime.securesms.components.webrtc.EglBaseWrapper)4 Camera (org.thoughtcrime.securesms.ringrtc.Camera)4 RemotePeer (org.thoughtcrime.securesms.ringrtc.RemotePeer)4 Uri (android.net.Uri)2 Stream (com.annimon.stream.Stream)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Map (java.util.Map)2 Log (org.signal.core.util.logging.Log)2 PeekInfo (org.signal.ringrtc.PeekInfo)2 RecipientDatabase (org.thoughtcrime.securesms.database.RecipientDatabase)2