import type { MediaRendererSource } from "#types/media-renderer"; /** * Renderer-neutral metadata for one frame the browser actually presented. * * `mediaTime` is on the same timeline the session reports, so a host can * correlate transport-side results with what is on screen. Every other field * is optional because browsers differ in what `requestVideoFrameCallback` * reports; absent fields are normal and must not break rendering. No DOM * element or vendor object is exposed. */ export type MediaStreamPresentedFrame = { /** Presentation time on the session media timeline, in seconds. */ readonly mediaTime: number; /** RTP timestamp the sender stamped this frame with, when reported. */ readonly rtpTimestamp?: number; /** Frame width in pixels, when reported. */ readonly width?: number; /** Frame height in pixels, when reported. */ readonly height?: number; /** `performance.now()` time the user agent submitted the frame, when reported. */ readonly presentationTime?: number; /** `performance.now()` time the frame is expected to be visible, when reported. */ readonly expectedDisplayTime?: number; }; export type MediaStreamRendererSourceOptions = { /** * Receives metadata for each presented frame, before the snapshot is taken. * * Called synchronously from the browser frame callback so wall-clock * correlation stays accurate. Keep the handler cheap; a handler that throws * is ignored and does not interrupt playback. */ readonly onPresentedFrame?: (frame: MediaStreamPresentedFrame) => void; /** Maximum decoded snapshots retained while the renderer is catching up. */ readonly maxBufferedFrames?: number; /** * Timestamp origin exposed to the renderer. `"media"` preserves the browser * MediaStream clock. `"first-frame"` starts the visible timeline at zero so * an independently transported detection stream can apply the same origin. * Defaults to `"media"`. */ readonly timestampOrigin?: "first-frame" | "media"; /** * Stop the caller-supplied MediaStream tracks when the session is destroyed. * Defaults to false because WebRTC connection ownership normally stays with * the host application. */ readonly stopTracksOnDispose?: boolean; }; /** * Adapts a browser MediaStream to the renderer-owned decoded-media boundary. * * The HTMLVideoElement is an internal decode clock only. Every presented frame * is snapshotted before it enters the bounded queue, so Pixi remains the sole * visible composition surface and annotations use the exact sample timestamp. */ export declare function createMediaStreamRendererSource(stream: MediaStream, options?: MediaStreamRendererSourceOptions): MediaRendererSource; //# sourceMappingURL=media-stream-media-source.d.ts.map