rtp.js
Version:
RTP stack for Node.js and browser written in TypeScript
93 lines • 2.7 kB
TypeScript
/**
* Loss RLE and Duplicate RLE Extended Report chunk info.
*
* ```text
* Run Length Chunk
* 0 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |C|R| run length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* Bit Vector Chunk
* 0 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |C| bit vector |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* Terminating Null Chunk
* 0 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ```
*
* @category RTCP Extended Reports
*
* @see
* - [RFC 3611 section 4.1](https://datatracker.ietf.org/doc/html/rfc3611#section-4.1)
*/
export type ExtendedReportChunk = {
/**
* Chunk type (Run Length Chunk, Bit Vector Chunk or Terminating Null Chunk).
*/
chunkType: 'run-length' | 'bit-vector' | 'terminating-null';
/**
* Chunk run type (only set if `chunkType` is 'run-length').
*/
runType?: 'zeros' | 'ones';
/**
* Chunk run length (only set if `chunkType` is 'run-length').
*/
runLength?: number;
/**
* Chunk bit vector (only set if `chunkType` is 'bit-vector').
*/
bitVector?: number;
};
/**
* Parse given 2 bytes number as a Extended Report chunk.
*
* @category RTCP Extended Reports
*
* @see
* - [RFC 3611 section 4.1](https://datatracker.ietf.org/doc/html/rfc3611#section-4.1)
*/
export declare function parseExtendedReportChunk(chunk: number): ExtendedReportChunk;
/**
* Create a Run Length Chunk and return a 2 bytes number representing it.
*
* ```text
* 0 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |C|R| run length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ```
*
* @category RTCP Extended Reports
*
* @see
* - [RFC 3611 section 4.1.1](https://datatracker.ietf.org/doc/html/rfc3611#section-4.1.1)
*/
export declare function createExtendedReportRunLengthChunk(runType: 'zeros' | 'ones', runLength: number): number;
/**
* Create a Bit Vector Chunk and return a 2 bytes number representing it.
*
* ```text
* 0 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |C| bit vector |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ```
*
* @category RTCP Extended Reports
*
* @see
* - [RFC 3611 section 4.1.2](https://datatracker.ietf.org/doc/html/rfc3611#section-4.1.2)
*/
export declare function createExtendedReportBitVectorChunk(bitVector: number): number;
//# sourceMappingURL=chunks.d.ts.map