UNPKG

mpegts-stream

Version:

Multiplex AAC audio samples and H264/AVC video samples into an MPEG2TS stream ready for transport.

130 lines (129 loc) 4.85 kB
export class TsHeader { mSyncByte: any; mTransportErrorIndicator: any; mPayloadUnitStartIndicator: any; mTransportPriority: any; mPid: any; mTransportScramblingControl: any; mAdaptationFieldControl: any; mContinuityCounter: any; /** * */ encode(): SimpleBuffer<4>; } export class AdaptationFieldHeader { /** @type {uint8} */ mAdaptationFieldLength: uint8; /** @type {uint8} */ mAdaptationFieldExtensionFlag: uint8; /** @type {uint8} */ mTransportPrivateDataFlag: uint8; /** @type {uint8} */ mSplicingPointFlag: uint8; /** @type {uint8} */ mOpcrFlag: uint8; /** @type {uint8} */ mPcrFlag: uint8; /** @type {uint8} */ mElementaryStreamPriorityIndicator: uint8; /** @type {uint8} */ mRandomAccessIndicator: uint8; /** @type {uint8} */ mDiscontinuityIndicator: uint8; encode(): SimpleBuffer<2>; } export class EsFrame { /** * @overload * @param {number=} streamType * @param {number=} pid */ constructor(streamType?: number | undefined, pid?: number | undefined); /** * @overload */ constructor(); /** @type {SimpleBuffer[]} */ mData: SimpleBuffer<any>[]; /** @type {uint64} */ mPts: uint64; /** @type {uint64} */ mDts: uint64; /** @type {uint64} */ mPcr: uint64; /** @type {uint8} */ mRandomAccess: uint8; /** @type {uint8} */ mStreamType: uint8; /** @type {uint8} */ mStreamId: uint8; /** @type {uint16} */ mPid: uint16; /** @type {uint16} */ mExpectedPesPacketLength: uint16; /** @type {uint16} */ mExpectedPlayloadLength: uint16; /** @type {boolean} */ mCompleted: boolean; /** @type {boolean} */ mBroken: boolean; empty(): boolean; reset(): void; mDataSize(): number; mDataPos(): number; } export class PatHeader { /** @type {uint8} */ mTableId: uint8; /** @type {uint8} */ mSectionSyntaxIndicator: uint8; /** @type {uint8} */ mB0: uint8; /** @type {uint8} */ mReserved0: uint8; /** @type {uint16} */ mSectionLength: uint16; /** @type {uint16} */ mTransportStreamId: uint16; /** @type {uint8} */ mReserved1: uint8; /** @type {uint8} */ mVersionNumber: uint8; /** @type {uint8} */ mCurrentNextIndicator: uint8; /** @type {uint8} */ mSectionNumber: uint8; /** @type {uint8} */ mLastSectionNumber: uint8; encode(): SimpleBuffer<8>; } export class PesHeader { /** @type {uint32} */ mPacketStartCode: uint32; /** @type {uint8} */ mStreamId: uint8; /** @type {uint16} */ mPesPacketLength: uint16; /** @type {uint8} */ mOriginalOrCopy: uint8; /** @type {uint8} */ mCopyright: uint8; /** @type {uint8} */ mDataAlignmentIndicator: uint8; /** @type {uint8} */ mPesPriority: uint8; /** @type {uint8} */ mPesScramblingControl: uint8; /** @type {uint8} */ mMarkerBits: uint8; /** @type {uint8} */ mPesExtFlag: uint8; /** @type {uint8} */ mPesCrcFlag: uint8; /** @type {uint8} */ mAddCopyInfoFlag: uint8; /** @type {uint8} */ mDsmTrickModeFlag: uint8; /** @type {uint8} */ mEsRateFlag: uint8; /** @type {uint8} */ mEscrFlag: uint8; /** @type {uint8} */ mPtsDtsFlags: uint8; /** @type {uint8} */ mHeaderDataLength: uint8; encode(): SimpleBuffer<21>; } export class PmtElementInfo { /** * * @param {uint8} lSt * @param {uint16} lPid */ constructor(lSt: uint8, lPid: uint16); /** @type {uint8} */ mStreamType: uint8; /** @type {uint8} */ mReserved0: uint8; /** @type {uint16} */ mElementaryPid: uint16; /** @type {uint8} */ mReserved1: uint8; /** @type {uint16} */ mEsInfoLength: uint16; /** @type {string} */ mEsInfo: string; encode(): SimpleBuffer<number>; size(): number; } export class PmtHeader { /** @type {PmtElementInfo[]} */ mInfos: PmtElementInfo[]; /** @type {uint8} */ mTableId: uint8; /** @type {uint8} */ mSectionSyntaxIndicator: uint8; /** @type {uint8} */ mB0: uint8; /** @type {uint8} */ mReserved0: uint8; /** @type {uint16} */ mSectionLength: uint16; /** @type {uint16} */ mProgramNumber: uint16; /** @type {uint8} */ mReserved1: uint8; /** @type {uint8} */ mVersionNumber: uint8; /** @type {uint8} */ mCurrentNextIndicator: uint8; /** @type {uint8} */ mSectionNumber: uint8; /** @type {uint8} */ mLastSectionNumber: uint8; /** @type {uint8} */ mReserved2: uint8; /** @type {uint16} */ mPcrPid: uint16; /** @type {uint8} */ mReserved3: uint8; /** @type {uint16} */ mProgramInfoLength: uint16; encode(): SimpleBuffer<number>; size(): number; } import { SimpleBuffer } from "./simple-buffer.js"; import type { uint8 } from "./simple-buffer.js"; import type { uint64 } from "./simple-buffer.js"; import type { uint16 } from "./simple-buffer.js"; import type { uint32 } from "./simple-buffer.js";