@@ -35,7 +35,7 @@ import { StreamingUtils } from './utilities/streaming.js';
3535
3636import type { AVMediaType , AVSeekFlag , AVSeekWhence } from '../constants/index.js' ;
3737import type { Stream } from '../lib/stream.js' ;
38- import type { IOInputCallbacks , MediaInputOptions , RawData , RTPMediaInput } from './types.js' ;
38+ import type { DemuxerOptions , IOInputCallbacks , RawData , RTPDemuxer } from './types.js' ;
3939
4040/**
4141 * Per-stream timestamp processing state.
@@ -96,7 +96,7 @@ export class Demuxer implements AsyncDisposable, Disposable {
9696 private _streams : Stream [ ] = [ ] ;
9797 private ioContext ?: IOContext ;
9898 private isClosed = false ;
99- private options : Required < MediaInputOptions > ;
99+ private options : Required < DemuxerOptions > ;
100100
101101 // Timestamp processing state (per-stream)
102102 private streamStates = new Map < number , StreamState > ( ) ;
@@ -122,7 +122,7 @@ export class Demuxer implements AsyncDisposable, Disposable {
122122 *
123123 * @internal
124124 */
125- private constructor ( formatContext : FormatContext , options : Required < MediaInputOptions > , ioContext ?: IOContext ) {
125+ private constructor ( formatContext : FormatContext , options : Required < DemuxerOptions > , ioContext ?: IOContext ) {
126126 this . formatContext = formatContext ;
127127 this . ioContext = ioContext ;
128128 this . _streams = formatContext . streams ?? [ ] ;
@@ -382,18 +382,18 @@ export class Demuxer implements AsyncDisposable, Disposable {
382382 * });
383383 * ```
384384 *
385- * @see {@link MediaInputOptions } For configuration options
385+ * @see {@link DemuxerOptions } For configuration options
386386 * @see {@link RawData } For raw data input
387387 * @see {@link IOInputCallbacks } For custom I/O interface
388388 */
389- static async open ( input : string | Buffer , options ?: MediaInputOptions ) : Promise < Demuxer > ;
390- static async open ( input : IOInputCallbacks , options : ( MediaInputOptions | undefined ) & { format : string } ) : Promise < Demuxer > ;
391- static async open ( rawData : RawData , options ?: MediaInputOptions ) : Promise < Demuxer > ;
392- static async open ( input : string | Buffer | RawData | IOInputCallbacks , options : MediaInputOptions = { } ) : Promise < Demuxer > {
389+ static async open ( input : string | Buffer , options ?: DemuxerOptions ) : Promise < Demuxer > ;
390+ static async open ( input : IOInputCallbacks , options : ( DemuxerOptions | undefined ) & { format : string } ) : Promise < Demuxer > ;
391+ static async open ( rawData : RawData , options ?: DemuxerOptions ) : Promise < Demuxer > ;
392+ static async open ( input : string | Buffer | RawData | IOInputCallbacks , options : DemuxerOptions = { } ) : Promise < Demuxer > {
393393 // Check if input is raw data
394394 if ( typeof input === 'object' && 'type' in input && ( 'width' in input || 'sampleRate' in input ) ) {
395395 // Build options for raw data
396- const rawOptions : MediaInputOptions & { format : string } = {
396+ const rawOptions : DemuxerOptions & { format : string } = {
397397 bufferSize : options . bufferSize ,
398398 format : options . format ?? ( input . type === 'video' ? 'rawvideo' : 's16le' ) ,
399399 options : {
@@ -513,7 +513,7 @@ export class Demuxer implements AsyncDisposable, Disposable {
513513 }
514514
515515 // Apply defaults to options
516- const fullOptions : Required < MediaInputOptions > = {
516+ const fullOptions : Required < DemuxerOptions > = {
517517 bufferSize,
518518 format : options . format ?? '' ,
519519 skipStreamInfo : options . skipStreamInfo ?? false ,
@@ -614,14 +614,14 @@ export class Demuxer implements AsyncDisposable, Disposable {
614614 * @see {@link open } For async version
615615 * @see {@link IOInputCallbacks } For custom I/O interface
616616 */
617- static openSync ( input : string | Buffer , options ?: MediaInputOptions ) : Demuxer ;
618- static openSync ( input : IOInputCallbacks , options : ( MediaInputOptions | undefined ) & { format : string } ) : Demuxer ;
619- static openSync ( rawData : RawData , options ?: MediaInputOptions ) : Demuxer ;
620- static openSync ( input : string | Buffer | RawData | IOInputCallbacks , options : MediaInputOptions = { } ) : Demuxer {
617+ static openSync ( input : string | Buffer , options ?: DemuxerOptions ) : Demuxer ;
618+ static openSync ( input : IOInputCallbacks , options : ( DemuxerOptions | undefined ) & { format : string } ) : Demuxer ;
619+ static openSync ( rawData : RawData , options ?: DemuxerOptions ) : Demuxer ;
620+ static openSync ( input : string | Buffer | RawData | IOInputCallbacks , options : DemuxerOptions = { } ) : Demuxer {
621621 // Check if input is raw data
622622 if ( typeof input === 'object' && 'type' in input && ( 'width' in input || 'sampleRate' in input ) ) {
623623 // Build options for raw data
624- const rawOptions : MediaInputOptions & { format : string } = {
624+ const rawOptions : DemuxerOptions & { format : string } = {
625625 bufferSize : options . bufferSize ,
626626 format : options . format ?? ( input . type === 'video' ? 'rawvideo' : 's16le' ) ,
627627 options : {
@@ -727,7 +727,7 @@ export class Demuxer implements AsyncDisposable, Disposable {
727727 }
728728
729729 // Apply defaults to options
730- const fullOptions : Required < MediaInputOptions > = {
730+ const fullOptions : Required < DemuxerOptions > = {
731731 bufferSize,
732732 format : options . format ?? '' ,
733733 skipStreamInfo : options . skipStreamInfo ?? false ,
@@ -808,7 +808,7 @@ export class Demuxer implements AsyncDisposable, Disposable {
808808 *
809809 * @see {@link StreamingUtils.createInputSDP } to generate SDP content.
810810 */
811- static async openSDP ( sdpContent : string ) : Promise < RTPMediaInput > {
811+ static async openSDP ( sdpContent : string ) : Promise < RTPDemuxer > {
812812 // Extract all ports from SDP (supports multi-stream: video + audio)
813813 const ports = StreamingUtils . extractPortsFromSDP ( sdpContent ) ;
814814 if ( ports . length === 0 ) {
@@ -933,7 +933,7 @@ export class Demuxer implements AsyncDisposable, Disposable {
933933 * @see {@link StreamingUtils.createInputSDP } to generate SDP content.
934934 * @see {@link openSDP } For async version
935935 */
936- static openSDPSync ( sdpContent : string ) : RTPMediaInput {
936+ static openSDPSync ( sdpContent : string ) : RTPDemuxer {
937937 // Extract all ports from SDP (supports multi-stream: video + audio)
938938 const ports = StreamingUtils . extractPortsFromSDP ( sdpContent ) ;
939939 if ( ports . length === 0 ) {
0 commit comments