Skip to content

Commit dd1b7e6

Browse files
Remove last use of Buffer in ringrtc API
Co-authored-by: Jim Gustafson <[email protected]>
1 parent 3b67d00 commit dd1b7e6

14 files changed

+27
-40
lines changed

ACKNOWLEDGMENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14517,7 +14517,7 @@ For more information on this, and how to apply and follow the GNU AGPL, see
1451714517

1451814518
```
1451914519

14520-
## libsignal-account-keys 0.1.0, libsignal-core 0.1.0, mrp 2.58.1, protobuf 2.58.1, ringrtc 2.58.1, regex-aot 0.1.0, partial-default-derive 0.1.0
14520+
## libsignal-account-keys 0.1.0, libsignal-core 0.1.0, mrp 2.59.0, protobuf 2.59.0, ringrtc 2.59.0, regex-aot 0.1.0, partial-default-derive 0.1.0
1452114521

1452214522
```
1452314523
GNU AFFERO GENERAL PUBLIC LICENSE

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"@signalapp/libsignal-client": "0.81.1",
134134
"@signalapp/minimask": "1.0.1",
135135
"@signalapp/quill-cjs": "2.1.2",
136-
"@signalapp/ringrtc": "2.58.1",
136+
"@signalapp/ringrtc": "2.59.0",
137137
"@signalapp/sqlcipher": "2.4.4",
138138
"@signalapp/windows-ucv": "1.0.1",
139139
"@tanstack/react-virtual": "3.11.2",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ts/calling/VideoSupport.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export class GumVideoCapturer {
307307
const reader = new MediaStreamTrackProcessor({
308308
track,
309309
}).readable.getReader();
310-
const buffer = Buffer.alloc(MAX_VIDEO_CAPTURE_BUFFER_SIZE);
310+
const buffer = new Uint8Array(MAX_VIDEO_CAPTURE_BUFFER_SIZE);
311311
this.spawnedSenderRunning = true;
312312
// eslint-disable-next-line @typescript-eslint/no-floating-promises
313313
(async () => {
@@ -397,13 +397,13 @@ export const MAX_VIDEO_CAPTURE_BUFFER_SIZE = MAX_VIDEO_CAPTURE_AREA * 4;
397397

398398
export class CanvasVideoRenderer {
399399
private canvas?: RefObject<HTMLCanvasElement>;
400-
private buffer: Buffer;
400+
private buffer: Uint8Array;
401401
private imageData?: ImageData;
402402
private source?: VideoFrameSource;
403403
private rafId?: any;
404404

405405
constructor() {
406-
this.buffer = Buffer.alloc(MAX_VIDEO_CAPTURE_BUFFER_SIZE);
406+
this.buffer = new Uint8Array(MAX_VIDEO_CAPTURE_BUFFER_SIZE);
407407
}
408408

409409
setCanvas(canvas: RefObject<HTMLCanvasElement> | undefined): void {

ts/calling/useGetCallingFrameBuffer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import { FRAME_BUFFER_SIZE } from './constants.js';
1212
* of allocating one per participant. Be careful when using this buffer elsewhere, as it
1313
* is not cleaned up and may hold stale data.
1414
*/
15-
export function useGetCallingFrameBuffer(): () => Buffer {
16-
const ref = useRef<Buffer | null>(null);
15+
export function useGetCallingFrameBuffer(): () => Uint8Array {
16+
const ref = useRef<Uint8Array | null>(null);
1717

1818
return useCallback(() => {
1919
if (!ref.current) {
20-
ref.current = Buffer.alloc(FRAME_BUFFER_SIZE);
20+
ref.current = new Uint8Array(FRAME_BUFFER_SIZE);
2121
}
2222
return ref.current;
2323
}, []);

ts/components/GroupCallOverflowArea.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
} satisfies Meta<PropsType>;
4444

4545
const defaultProps = {
46-
getFrameBuffer: memoize(() => Buffer.alloc(FRAME_BUFFER_SIZE)),
46+
getFrameBuffer: memoize(() => new Uint8Array(FRAME_BUFFER_SIZE)),
4747
getCallingImageDataCache: memoize(() => new Map()),
4848
getGroupCallVideoFrameSource: fakeGetGroupCallVideoFrameSource,
4949
imageDataCache: React.createRef<CallingImageDataCache>(),

ts/components/GroupCallOverflowArea.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const OVERFLOW_SCROLL_BUTTON_RATIO = 0.75;
1717
export const OVERFLOW_PARTICIPANT_WIDTH = 107;
1818

1919
export type PropsType = {
20-
getFrameBuffer: () => Buffer;
20+
getFrameBuffer: () => Uint8Array;
2121
getGroupCallVideoFrameSource: (demuxId: number) => VideoFrameSource;
2222
i18n: LocalizerType;
2323
imageDataCache: React.RefObject<CallingImageDataCache>;

ts/components/GroupCallRemoteParticipant.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type OverridePropsType = {
3232
}
3333
);
3434

35-
const getFrameBuffer = memoize(() => Buffer.alloc(FRAME_BUFFER_SIZE));
35+
const getFrameBuffer = memoize(() => new Uint8Array(FRAME_BUFFER_SIZE));
3636

3737
const createProps = (
3838
overrideProps: OverridePropsType,

ts/components/GroupCallRemoteParticipant.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const DELAY_TO_SHOW_MISSING_MEDIA_KEYS = 5000;
4242
const CONTAINER_TRANSITION_TIME = 200;
4343

4444
type BasePropsType = {
45-
getFrameBuffer: () => Buffer;
45+
getFrameBuffer: () => Uint8Array;
4646
getGroupCallVideoFrameSource: (demuxId: number) => VideoFrameSource;
4747
i18n: LocalizerType;
4848
imageDataCache: React.RefObject<CallingImageDataCache>;

ts/test-helpers/fakeGetGroupCallVideoFrameSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class FakeGroupCallVideoFrameSource implements VideoFrameSource {
3232
}
3333

3434
receiveVideoFrame(
35-
destinationBuffer: Buffer,
35+
destinationBuffer: Uint8Array,
3636
_maxWidth: number,
3737
_maxHeight: number
3838
): [number, number] | undefined {

0 commit comments

Comments
 (0)