Implement @mediabunny/prores extension, add onError callbacks to custom coders, fix visibleRect bug in VideoSample

This commit is contained in:
Vanilagy
2026-06-29 17:15:10 +02:00
parent af618f014a
commit 8ae0f9d09e
42 changed files with 1074 additions and 451 deletions
+8
View File
@@ -27,6 +27,8 @@ export abstract class CustomVideoDecoder {
readonly config!: VideoDecoderConfig;
/** The callback to call when a decoded VideoSample is available. */
readonly onSample!: (sample: VideoSample) => unknown;
/** The callback to call to surface out-of-band errors that can't be surfaced through the main methods. */
readonly onError!: (error: unknown) => undefined;
/** Returns true if and only if the decoder can decode the given codec configuration. */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -57,6 +59,8 @@ export abstract class CustomAudioDecoder {
readonly config!: AudioDecoderConfig;
/** The callback to call when a decoded AudioSample is available. */
readonly onSample!: (sample: AudioSample) => unknown;
/** The callback to call to surface out-of-band errors that can't be surfaced through the main methods. */
readonly onError!: (error: unknown) => undefined;
/** Returns true if and only if the decoder can decode the given codec configuration. */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -87,6 +91,8 @@ export abstract class CustomVideoEncoder {
readonly config!: VideoEncoderConfig;
/** The callback to call when an EncodedPacket is available. */
readonly onPacket!: (packet: EncodedPacket, meta?: EncodedVideoChunkMetadata) => unknown;
/** The callback to call to surface out-of-band errors that can't be surfaced through the main methods. */
readonly onError!: (error: unknown) => undefined;
/** Returns true if and only if the encoder can encode the given codec configuration. */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -117,6 +123,8 @@ export abstract class CustomAudioEncoder {
readonly config!: AudioEncoderConfig;
/** The callback to call when an EncodedPacket is available. */
readonly onPacket!: (packet: EncodedPacket, meta?: EncodedAudioChunkMetadata) => unknown;
/** The callback to call to surface out-of-band errors that can't be surfaced through the main methods. */
readonly onError!: (error: unknown) => undefined;
/** Returns true if and only if the encoder can encode the given codec configuration. */
// eslint-disable-next-line @typescript-eslint/no-unused-vars