MCPcopy Create free account
hub / github.com/Vanilagy/webcodecs-polyfill / VideoFramePolyfill

Class VideoFramePolyfill

src/video_frame.ts:72–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 * Corresponds to the WebCodecs VideoFrame API.
71 */
72export class VideoFramePolyfill {
73 /** @internal */
74 data!: Frame | BufferFrameResource | null;
75 private closed = false;
76
77 /**
78 * The pixel format of the frame, or null if closed.
79 */
80 readonly format!: VideoPixelFormat | null;
81 /**
82 * The width of the frame in pixels.
83 */
84 readonly codedWidth!: number;
85 /**
86 * The height of the frame in pixels.
87 */
88 readonly codedHeight!: number;
89 /**
90 * The coded rectangle, or null if unknown.
91 */
92 readonly codedRect!: DOMRectReadOnly | null;
93 /**
94 * The visible rectangle within the coded frame.
95 */
96 readonly visibleRect!: DOMRectReadOnly | null;
97 /**
98 * The display width in pixels after applying rotation and flip.
99 */
100 readonly displayWidth!: number;
101 /**
102 * The display height in pixels after applying rotation and flip.
103 */
104 readonly displayHeight!: number;
105 /**
106 * The rotation in degrees (0, 90, 180, or 270).
107 */
108 readonly rotation!: number;
109 /**
110 * Whether the frame is flipped horizontally.
111 */
112 readonly flip!: boolean;
113 /**
114 * The timestamp in integer microseconds.
115 */
116 readonly timestamp!: number;
117 /**
118 * The duration in integer microseconds, or null if not specified.
119 */
120 readonly duration!: number | null;
121 /**
122 * The color space of the frame.
123 */
124 readonly colorSpace!: VideoColorSpace;
125
126 constructor(data: AllowSharedBufferSource, init: VideoFrameBufferInit);
127 constructor(source: CanvasImageSource, init?: VideoFrameInit);
128 constructor(data: Frame, init?: VideoFrameInit);
129 constructor(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected