Group calling: tell RingRTC about our rendered resolutions for perf

This commit is contained in:
Evan Hahn 2020-12-01 19:52:01 -06:00 committed by GitHub
parent b30b83ed57
commit d1866a0e5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 211 additions and 7 deletions

View file

@ -19,6 +19,7 @@ import {
GroupCallJoinState,
GroupCallPeekedParticipantType,
GroupCallRemoteParticipantType,
GroupCallVideoRequest,
MediaDeviceSettings,
} from '../../types/Calling';
import { callingTones } from '../../util/callingTones';
@ -168,6 +169,11 @@ export type SetLocalVideoType = {
enabled: boolean;
};
export type SetGroupCallVideoRequestType = {
conversationId: string;
resolutions: Array<GroupCallVideoRequest>;
};
export type ShowCallLobbyType =
| {
callMode: CallMode.Direct;
@ -684,6 +690,22 @@ function setLocalVideo(
};
}
function setGroupCallVideoRequest(
payload: SetGroupCallVideoRequestType
): ThunkAction<void, RootStateType, unknown, never> {
return () => {
calling.setGroupCallVideoRequest(
payload.conversationId,
payload.resolutions.map(resolution => ({
...resolution,
// The `framerate` property in RingRTC has to be set, even if it's set to
// `undefined`.
framerate: undefined,
}))
);
};
}
function showCallLobby(payload: ShowCallLobbyType): CallLobbyActionType {
return {
type: SHOW_CALL_LOBBY,
@ -758,6 +780,7 @@ export const actions = {
setRendererCanvas,
setLocalAudio,
setLocalVideo,
setGroupCallVideoRequest,
showCallLobby,
startCall,
toggleParticipants,