Use WritableStream for StreamTarget & integrate backpressure concepts

This commit is contained in:
Vanilagy
2024-11-28 22:06:49 +01:00
parent 527108f44e
commit 266fcd473e
19 changed files with 1078 additions and 741 deletions
+25 -6
View File
@@ -9,11 +9,17 @@ export abstract class OutputFormat {
abstract _createMuxer(output: Output): Muxer;
}
/** @public */
export type Mp4OutputFormatOptions = {
fastStart?: false | 'in-memory' | 'fragmented'
};
/** @public */
export class Mp4OutputFormat extends OutputFormat {
constructor(public options: {
fastStart?: false | 'in-memory' | 'fragmented',
} = {}) {
/** @internal */
_options: Mp4OutputFormatOptions;
constructor(options: Mp4OutputFormatOptions = {}) {
if (!options || typeof options !== 'object') {
throw new TypeError('options must be an object.');
}
@@ -22,6 +28,8 @@ export class Mp4OutputFormat extends OutputFormat {
}
super();
this._options = options;
}
/** @internal */
@@ -30,11 +38,17 @@ export class Mp4OutputFormat extends OutputFormat {
}
}
/** @public */
export type MkvOutputFormatOptions = {
streamable?: boolean
};
/** @public */
export class MkvOutputFormat extends OutputFormat {
constructor(public options: {
streamable?: boolean
} = {}) {
/** @internal */
_options: MkvOutputFormatOptions;
constructor(options: MkvOutputFormatOptions = {}) {
if (!options || typeof options !== 'object') {
throw new TypeError('options must be an object.');
}
@@ -43,6 +57,8 @@ export class MkvOutputFormat extends OutputFormat {
}
super();
this._options = options;
}
/** @internal */
@@ -51,5 +67,8 @@ export class MkvOutputFormat extends OutputFormat {
}
}
/** @public */
export type WebMOutputFormatOptions = MkvOutputFormatOptions;
/** @public */
export class WebMOutputFormat extends MkvOutputFormat {}