diff --git a/apps/desktop/src/utils/socket.ts b/apps/desktop/src/utils/socket.ts index fc1c5d64..37bec54a 100644 --- a/apps/desktop/src/utils/socket.ts +++ b/apps/desktop/src/utils/socket.ts @@ -23,13 +23,8 @@ export function createImageDataWS( setIsConnected(false); }); - // let lastTime = Date.now(); ws.binaryType = "arraybuffer"; ws.onmessage = (event) => { - // console.log(Date.now() - lastTime); - - // onmessage(new ImageData(new Uint8ClampedArray([0, 0, 0, 0]), 1, 1)); - const buffer = event.data as ArrayBuffer; const clamped = new Uint8ClampedArray(buffer); @@ -54,16 +49,12 @@ export function createImageDataWS( (strideArr[3] << 24)) / 4; - console.log({ stride, width, height }); - const imageData = new ImageData( clamped.slice(0, clamped.length - 12), stride, height ); - // lastTime = Date.now(); - onmessage({ width, data: imageData }); }; diff --git a/crates/media/src/feeds/camera.rs b/crates/media/src/feeds/camera.rs index 8ed9c977..3d770995 100644 --- a/crates/media/src/feeds/camera.rs +++ b/crates/media/src/feeds/camera.rs @@ -423,6 +423,7 @@ impl FrameConverter { } }; + data.extend_from_slice(&(resolution.width() * 4).to_le_bytes()); data.extend_from_slice(&resolution.height().to_le_bytes()); data.extend_from_slice(&resolution.width().to_le_bytes());