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

Method constructor

src/video_decoder.ts:77–89  ·  view source on GitHub ↗

* Creates a new VideoDecoder.

(init: VideoDecoderInit)

Source from the content-addressed store, hash-verified

75 * Creates a new VideoDecoder.
76 */
77 constructor(init: VideoDecoderInit) {
78 super();
79
80 if (!init.output || !init.error) {
81 throw new TypeError('VideoDecoderInit requires \'output\' and \'error\' callbacks.');
82 }
83
84 this.init = init;
85 this.frame = new Frame();
86 this.frame.alloc();
87 this.packet = new Packet();
88 this.packet.alloc();
89 }
90
91 private static createCodecContext(config: VideoDecoderConfig) {
92 const inferred = inferCodecFromCodecString(config.codec);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected