Remove last use of Buffer in ringrtc API

Co-authored-by: Jim Gustafson <jim@signal.org>
This commit is contained in:
Miriam Zimmerman
2025-10-01 16:57:39 -04:00
committed by GitHub
parent 3b67d00c85
commit dd1b7e6fc1
14 changed files with 27 additions and 40 deletions

View File

@@ -12,12 +12,12 @@ import { FRAME_BUFFER_SIZE } from './constants.js';
* of allocating one per participant. Be careful when using this buffer elsewhere, as it
* is not cleaned up and may hold stale data.
*/
export function useGetCallingFrameBuffer(): () => Buffer {
const ref = useRef<Buffer | null>(null);
export function useGetCallingFrameBuffer(): () => Uint8Array {
const ref = useRef<Uint8Array | null>(null);
return useCallback(() => {
if (!ref.current) {
ref.current = Buffer.alloc(FRAME_BUFFER_SIZE);
ref.current = new Uint8Array(FRAME_BUFFER_SIZE);
}
return ref.current;
}, []);