UNPKG

rtp.js

Version:

RTP stack for Node.js and browser written in TypeScript

127 lines 3.48 kB
import { RtcpPacket, RtcpPacketType, type RtcpPacketDump } from './RtcpPacket'; export declare const FIXED_HEADER_LENGTH: number; /** * RTCP Feedback transport layer message types. * * @category RTCP */ export declare enum RtpFeedbackMessageType { /** * Generic NACK. */ NACK = 1, /** * Rapid Resynchronisation Request. */ SR_REQ = 5, /** * Explicit Congestion Notification (ECN). */ ECN = 8 } /** * RTCP Feedback payload specific message types. * * @category RTCP */ export declare enum PsFeedbackMessageType { /** * Picture Loss Indication. */ PLI = 1, /** * Slice Loss Indication. */ SLI = 2, /** * Reference Picture Selection Indication. */ RPSI = 3, /** * Application layer FB message. */ AFB = 15 } /** * RTCP Feedback packet info dump. * * @category RTCP */ export type FeedbackPacketDump = RtcpPacketDump & { messageType: RtpFeedbackMessageType | PsFeedbackMessageType; senderSsrc: number; mediaSsrc: number; }; /** * Get the RTCP Feedback message type. * * @hidden */ export declare function getRtcpFeedbackMessageType(view: DataView): RtpFeedbackMessageType | PsFeedbackMessageType; /** * RTCP Feedback 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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |V=2|P| FMT | PT | length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | SSRC of packet sender | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | SSRC of media source | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * : Feedback Control Information (FCI) : * : : * ``` * * @category RTCP * * @see * - [RFC 4585 section 6.1](https://datatracker.ietf.org/doc/html/rfc4585#section-6.1) */ export declare abstract class FeedbackPacket extends RtcpPacket { #private; protected constructor(packetType: RtcpPacketType.RTPFB | RtcpPacketType.PSFB, messageType: RtpFeedbackMessageType | PsFeedbackMessageType, view?: DataView); /** * Base RTCP Feedback packet dump. * * @remarks * - Read the info dump type of each RTCP Feedback packet instead. */ dump(): FeedbackPacketDump; /** * Get the RTCP Feedback message type. */ getMessageType(): RtpFeedbackMessageType | PsFeedbackMessageType; /** * Get sender SSRC. */ getSenderSsrc(): number; /** * Set sender SSRC. */ setSenderSsrc(ssrc: number): void; /** * Get media SSRC. */ getMediaSsrc(): number; /** * Set media SSRC. */ setMediaSsrc(ssrc: number): void; protected writeFixedHeader(): void; /** * Serialize base RTCP Feedback packet into a new buffer. */ protected serializeBase(buffer?: ArrayBufferLike, byteOffset?: number): DataView; /** * Set the RTCP Feedback message type. * * @privateRemarks * - This method is not public since users should not manipulate this field * directly. */ private setMessageType; } //# sourceMappingURL=FeedbackPacket.d.ts.map