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

Method constructor

src/video_encoder.ts:128–140  ·  view source on GitHub ↗

* Creates a new VideoEncoder.

(init: VideoEncoderInit)

Source from the content-addressed store, hash-verified

126 * Creates a new VideoEncoder.
127 */
128 constructor(init: VideoEncoderInit) {
129 super();
130
131 if (!init.output || !init.error) {
132 throw new TypeError('VideoEncoderInit requires \'output\' and \'error\' callbacks.');
133 }
134
135 this.init = init;
136 this.frame = new Frame();
137 this.frame.alloc();
138 this.packet = new Packet();
139 this.packet.alloc();
140 }
141
142 private static createCodecContext(config: VideoEncoderConfig) {
143 const inferred = inferCodecFromCodecString(config.codec);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected