rtp.js
Version:
RTP stack for Node.js and browser written in TypeScript
83 lines • 2.73 kB
TypeScript
import { RtcpPacket, RtcpPacketType, type RtcpPacketDump } from './RtcpPacket';
/**
* RTCP generic packet info dump.
*
* @category RTCP
*/
export type GenericPacketDump = RtcpPacketDump & {
bodyLength: number;
};
/**
* RTCP generic packet.
*
* ```text
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* header |V=2|P| SC | PT=??? | length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* body | ... |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* : ... :
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ```
*
* @category RTCP
*
* @see
* - [RFC 3550](https://datatracker.ietf.org/doc/html/rfc3550)
*/
export declare class GenericPacket extends RtcpPacket {
#private;
/**
* @param view - If given it will be parsed. Otherwise an empty RTCP generic
* packet will be created.
* @param packetType - If `view` is not given, this parameter must be given.
*
* @throws
* - If given `view` does not contain a valid RTCP generic packet.
*/
constructor(view?: DataView, packetType?: RtcpPacketType | number);
/**
* Dump RTCP generic packet info.
*/
dump(): GenericPacketDump;
/**
* @inheritDoc
*/
getByteLength(): number;
/**
* @inheritDoc
*/
serialize(buffer?: ArrayBufferLike, byteOffset?: number): void;
/**
* @inheritDoc
*/
clone(buffer?: ArrayBufferLike, byteOffset?: number, serializationBuffer?: ArrayBufferLike, serializationByteOffset?: number): GenericPacket;
/**
* Set the RTCP header count value.
*
* @remarks
* - This field (the 5 less significant bits in the first byte of the common
* RTCP header) can be used for other custom purpose in case the packet
* needs it for something else.
*
* @privateRemarks
* - This method is made public for this class since the user is free to add
* whatever body to this packet, and hence the user may want to also
* manipulate this field.
*/
setCount(count: number): void;
/**
* Get the packet body.
*/
getBody(): DataView;
/**
* Set the packet body.
*
* @remarks
* - Serialization is needed after calling this method.
*/
setBody(view: DataView): void;
}
//# sourceMappingURL=GenericPacket.d.ts.map