import IOggCodec from "./iOggCodec"; import { ByteVector } from "../../byteVector"; /** * Type shortcut for a method that can generate a codec object based on the first packet of the * bit stream. * @param firstPacket First packet in the bit stream * @returns * Generated {@link IOggCodec} is returned if a codec could be * constructed from the first packet, otherwise `undefined` is returned. */ export declare type CodecProvider = (firstPacket: ByteVector) => IOggCodec | undefined; /** * Factory for creating codecs from the first packet of the Ogg bitstream. * @remarks * By default, only codecs provided by the library will be matched. However, custom codec * support can be added by using {@link addCodecProvider}. */ export default class CodecFactory { private static _customCodecProviders; /** * Adds a custom codec provider to try before using standard codec creation methods. * Codec providers are used before standard methods so custom checking can be used and new * formats can be added. They are executed in reverse order in which they are added. * @param provider Codec provider function * * firstPacket: ByteVector First packet of the bitstream * * returns IOggCodec if method was able to match the packet, falsy otherwise */ static addCodecProvider(provider: CodecProvider): void; /** * Clears the custom providers from the factory. */ static clearCustomProviders(): void; /** * Determines the correc codec to use for a stream header packet. * @param packet First packet of an Ogg logical bitstream. */ static getCodec(packet: ByteVector): IOggCodec; }