Import AudioDevice
and VideoFrameSource
directly from RingRTC
This commit is contained in:
parent
ed222fee9a
commit
e32503eed4
14 changed files with 21 additions and 42 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
import React, { useCallback, useEffect } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import type { VideoFrameSource } from 'ringrtc';
|
||||
import { CallNeedPermissionScreen } from './CallNeedPermissionScreen';
|
||||
import { CallScreen } from './CallScreen';
|
||||
import { CallingLobby } from './CallingLobby';
|
||||
|
@ -23,7 +24,6 @@ import {
|
|||
GroupCallJoinState,
|
||||
GroupCallVideoRequest,
|
||||
PresentedSource,
|
||||
VideoFrameSource,
|
||||
} from '../types/Calling';
|
||||
import { ConversationType } from '../state/ducks/conversations';
|
||||
import {
|
||||
|
|
|
@ -10,6 +10,7 @@ import React, {
|
|||
} from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import type { VideoFrameSource } from 'ringrtc';
|
||||
import {
|
||||
HangUpType,
|
||||
SetLocalAudioType,
|
||||
|
@ -30,7 +31,6 @@ import {
|
|||
GroupCallJoinState,
|
||||
GroupCallVideoRequest,
|
||||
PresentedSource,
|
||||
VideoFrameSource,
|
||||
} from '../types/Calling';
|
||||
import { AvatarColors, AvatarColorType } from '../types/Colors';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// Copyright 2020-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as React from 'react';
|
||||
import type { AudioDevice } from 'ringrtc';
|
||||
|
||||
import { Modal } from './Modal';
|
||||
import { LocalizerType } from '../types/Util';
|
||||
import {
|
||||
AudioDevice,
|
||||
CallingDeviceType,
|
||||
ChangeIODevicePayloadType,
|
||||
MediaDeviceSettings,
|
||||
|
|
|
@ -3,13 +3,10 @@
|
|||
|
||||
import React from 'react';
|
||||
import { minBy, debounce, noop } from 'lodash';
|
||||
import type { VideoFrameSource } from 'ringrtc';
|
||||
import { CallingPipRemoteVideo } from './CallingPipRemoteVideo';
|
||||
import { LocalizerType } from '../types/Util';
|
||||
import {
|
||||
ActiveCallType,
|
||||
GroupCallVideoRequest,
|
||||
VideoFrameSource,
|
||||
} from '../types/Calling';
|
||||
import type { ActiveCallType, GroupCallVideoRequest } from '../types/Calling';
|
||||
import {
|
||||
HangUpType,
|
||||
SetLocalPreviewType,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import React, { useMemo, useEffect } from 'react';
|
||||
import { maxBy } from 'lodash';
|
||||
import type { VideoFrameSource } from 'ringrtc';
|
||||
import { Avatar } from './Avatar';
|
||||
import { CallBackgroundBlur } from './CallBackgroundBlur';
|
||||
import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant';
|
||||
|
@ -13,7 +14,6 @@ import {
|
|||
CallMode,
|
||||
GroupCallRemoteParticipantType,
|
||||
GroupCallVideoRequest,
|
||||
VideoFrameSource,
|
||||
} from '../types/Calling';
|
||||
import { AvatarColors } from '../types/Colors';
|
||||
import { SetRendererCanvasType } from '../state/ducks/calling';
|
||||
|
|
|
@ -3,11 +3,9 @@
|
|||
|
||||
import React, { useRef, useState, useEffect, FC, ReactElement } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import type { VideoFrameSource } from 'ringrtc';
|
||||
import { LocalizerType } from '../types/Util';
|
||||
import {
|
||||
GroupCallRemoteParticipantType,
|
||||
VideoFrameSource,
|
||||
} from '../types/Calling';
|
||||
import type { GroupCallRemoteParticipantType } from '../types/Calling';
|
||||
import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant';
|
||||
|
||||
const OVERFLOW_SCROLLED_TO_EDGE_THRESHOLD = 20;
|
||||
|
|
|
@ -11,10 +11,8 @@ import React, {
|
|||
} from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { noop } from 'lodash';
|
||||
import {
|
||||
GroupCallRemoteParticipantType,
|
||||
VideoFrameSource,
|
||||
} from '../types/Calling';
|
||||
import type { VideoFrameSource } from 'ringrtc';
|
||||
import type { GroupCallRemoteParticipantType } from '../types/Calling';
|
||||
import { LocalizerType } from '../types/Util';
|
||||
import { AvatarColors } from '../types/Colors';
|
||||
import { CallBackgroundBlur } from './CallBackgroundBlur';
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
import React, { useState, useMemo, useEffect } from 'react';
|
||||
import Measure from 'react-measure';
|
||||
import { takeWhile, chunk, maxBy, flatten } from 'lodash';
|
||||
import type { VideoFrameSource } from 'ringrtc';
|
||||
import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant';
|
||||
import {
|
||||
GroupCallOverflowArea,
|
||||
|
@ -12,7 +13,6 @@ import {
|
|||
import {
|
||||
GroupCallRemoteParticipantType,
|
||||
GroupCallVideoRequest,
|
||||
VideoFrameSource,
|
||||
} from '../types/Calling';
|
||||
import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer';
|
||||
import { LocalizerType } from '../types/Util';
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
import React, { ReactNode, useEffect, useState, useCallback } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import type { AudioDevice } from 'ringrtc';
|
||||
|
||||
import { AudioDevice, MediaDeviceSettings } from '../types/Calling';
|
||||
import type { MediaDeviceSettings } from '../types/Calling';
|
||||
import {
|
||||
ZoomFactorType,
|
||||
ThemeSettingType,
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { desktopCapturer, ipcRenderer } from 'electron';
|
||||
import {
|
||||
AudioDevice,
|
||||
Call,
|
||||
CallEndedReason,
|
||||
CallId,
|
||||
|
@ -43,7 +44,6 @@ import { getConversationCallMode } from '../state/ducks/conversations';
|
|||
import { isConversationTooBigToRing } from '../conversations/isConversationTooBigToRing';
|
||||
import { isMe } from '../util/whatTypeOfConversation';
|
||||
import {
|
||||
AudioDevice,
|
||||
AvailableIODevicesType,
|
||||
CallMode,
|
||||
GroupCallConnectionState,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { VideoFrameSource } from '../../types/Calling';
|
||||
|
||||
import type { VideoFrameSource } from 'ringrtc';
|
||||
|
||||
const COLORS: Array<[number, number, number]> = [
|
||||
[0xff, 0x00, 0x00],
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// Copyright 2020-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { ConversationType } from '../state/ducks/conversations';
|
||||
import type { AudioDevice } from 'ringrtc';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
|
||||
// These are strings (1) for the database (2) for Storybook.
|
||||
export enum CallMode {
|
||||
|
@ -134,23 +135,6 @@ export type GroupCallVideoRequest = {
|
|||
height: number;
|
||||
};
|
||||
|
||||
// Should match RingRTC's VideoFrameSource
|
||||
export type VideoFrameSource = {
|
||||
receiveVideoFrame(buffer: Buffer): [number, number] | undefined;
|
||||
};
|
||||
|
||||
// Must be kept in sync with RingRTC.AudioDevice
|
||||
export type AudioDevice = {
|
||||
// Device name.
|
||||
name: string;
|
||||
// Index of this device, starting from 0.
|
||||
index: number;
|
||||
// A unique and somewhat stable identifier of this device.
|
||||
uniqueId: string;
|
||||
// If present, the identifier of a localized string to substitute for the device name.
|
||||
i18nKey?: string;
|
||||
};
|
||||
|
||||
export enum CallingDeviceType {
|
||||
CAMERA,
|
||||
MICROPHONE,
|
||||
|
|
2
ts/types/Storage.d.ts
vendored
2
ts/types/Storage.d.ts
vendored
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2020-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { AudioDevice } from 'ringrtc';
|
||||
import type {
|
||||
CustomColorsItemType,
|
||||
DefaultConversationColorType,
|
||||
} from './Colors';
|
||||
import type { AudioDevice } from './Calling';
|
||||
import type { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability';
|
||||
import type { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode';
|
||||
import type { RetryItemType } from '../util/retryPlaceholders';
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { webFrame } from 'electron';
|
||||
import type { AudioDevice } from 'ringrtc';
|
||||
|
||||
import { AudioDevice } from '../types/Calling';
|
||||
import { ZoomFactorType } from '../types/Storage.d';
|
||||
import {
|
||||
DEFAULT_CONVERSATION_COLOR,
|
||||
|
|
Loading…
Reference in a new issue