// SPDX-License-Identifier: MIT // Copyright (C) 2026 Pooya Parsa // The guest's camera in a browser: a CameraSource (core/camera.ts) that // gives the user's camera to kwcam (/dev/video0). createKernel({ camera: createCamera() }) // // - Nothing is asked for until a guest program starts streaming: the // stream's start calls getUserMedia (user-media.ts) with the stream's // size and rate as ideal constraints, which is when the browser shows its // permission prompt. Until it is granted (and after a refusal, without // media devices, or once the track ends) the guest gets black frames, // which the kernel fills where the source has none, at its rate. The // tracks are stopped when the guest stops streaming (STREAMOFF, or it // closed the device), so the browser's camera indicator goes off. A // refusal is asked again at the next start, or at retry() (from a click: // a page's Allow button) while the guest streams. // - Frames: with MediaStreamTrackProcessor (Chromium) the track's // VideoFrames are read as they come; otherwise a