Documentation ¶
Overview ¶
Package rtcp implements encoding and decoding of RTCP packets according to RFCs 3550 and 5506.
RTCP is a sister protocol of the Real-time Transport Protocol (RTP). Its basic functionality and packet structure is defined in RFC 3550. RTCP provides out-of-band statistics and control information for an RTP session. It partners with RTP in the delivery and packaging of multimedia data, but does not transport any media data itself.
The primary function of RTCP is to provide feedback on the quality of service (QoS) in media distribution by periodically sending statistics information such as transmitted octet and packet counts, packet loss, packet delay variation, and round-trip delay time to participants in a streaming multimedia session. An application may use this information to control quality of service parameters, perhaps by limiting flow, or using a different codec.
Decoding RTCP packets:
pkts, err := rtcp.Unmarshal(rtcpData) // ... for _, pkt := range pkts { switch p := pkt.(type) { case *rtcp.CompoundPacket: ... case *rtcp.PictureLossIndication: ... default: ... } }
Encoding RTCP packets:
pkt := &rtcp.PictureLossIndication{ SenderSSRC: senderSSRC, MediaSSRC: mediaSSRC } pliData, err := pkt.Marshal() // ...
Index ¶
- Constants
- func Marshal(packets []Packet) ([]byte, error)
- type ApplicationDefined
- type BlockTypeType
- type CCFeedbackMetricBlock
- type CCFeedbackReport
- func (b CCFeedbackReport) DestinationSSRC() []uint32
- func (b *CCFeedbackReport) Header() Header
- func (b *CCFeedbackReport) Len() int
- func (b CCFeedbackReport) Marshal() ([]byte, error)
- func (b *CCFeedbackReport) MarshalSize() int
- func (b CCFeedbackReport) String() string
- func (b *CCFeedbackReport) Unmarshal(rawPacket []byte) error
- type CCFeedbackReportBlock
- type Chunk
- type ChunkType
- type CompoundPacket
- func (c CompoundPacket) CNAME() (string, error)
- func (c CompoundPacket) DestinationSSRC() []uint32
- func (c CompoundPacket) Marshal() ([]byte, error)
- func (c CompoundPacket) MarshalSize() int
- func (c CompoundPacket) String() string
- func (c *CompoundPacket) Unmarshal(rawData []byte) error
- func (c CompoundPacket) Validate() error
- type DLRRReport
- type DLRRReportBlock
- type DuplicateRLEReportBlock
- type ECN
- type ExtendedReport
- type FIREntry
- type FullIntraRequest
- type Goodbye
- type Header
- type LossRLEReportBlock
- type NackPair
- type Packet
- type PacketBitmap
- type PacketReceiptTimesReportBlock
- type PacketStatusChunk
- type PacketType
- type PictureLossIndication
- func (p *PictureLossIndication) DestinationSSRC() []uint32
- func (p *PictureLossIndication) Header() Header
- func (p PictureLossIndication) Marshal() ([]byte, error)
- func (p *PictureLossIndication) MarshalSize() int
- func (p *PictureLossIndication) String() string
- func (p *PictureLossIndication) Unmarshal(rawPacket []byte) error
- type RapidResynchronisationRequest
- type RapidResynchronizationRequest
- func (p *RapidResynchronizationRequest) DestinationSSRC() []uint32
- func (p *RapidResynchronizationRequest) Header() Header
- func (p RapidResynchronizationRequest) Marshal() ([]byte, error)
- func (p *RapidResynchronizationRequest) MarshalSize() int
- func (p *RapidResynchronizationRequest) String() string
- func (p *RapidResynchronizationRequest) Unmarshal(rawPacket []byte) error
- type RawPacket
- type ReceiverEstimatedMaximumBitrate
- func (p *ReceiverEstimatedMaximumBitrate) DestinationSSRC() []uint32
- func (p *ReceiverEstimatedMaximumBitrate) Header() Header
- func (p ReceiverEstimatedMaximumBitrate) Marshal() (buf []byte, err error)
- func (p ReceiverEstimatedMaximumBitrate) MarshalSize() int
- func (p ReceiverEstimatedMaximumBitrate) MarshalTo(buf []byte) (n int, err error)
- func (p *ReceiverEstimatedMaximumBitrate) String() string
- func (p *ReceiverEstimatedMaximumBitrate) Unmarshal(buf []byte) (err error)
- type ReceiverReferenceTimeReportBlock
- type ReceiverReport
- type ReceptionReport
- type RecvDelta
- type ReportBlock
- type RunLengthChunk
- type SDESType
- type SLIEntry
- type SenderReport
- type SliceLossIndication
- func (p *SliceLossIndication) DestinationSSRC() []uint32
- func (p *SliceLossIndication) Header() Header
- func (p SliceLossIndication) Marshal() ([]byte, error)
- func (p *SliceLossIndication) MarshalSize() int
- func (p *SliceLossIndication) String() string
- func (p *SliceLossIndication) Unmarshal(rawPacket []byte) error
- type SourceDescription
- func (s *SourceDescription) DestinationSSRC() []uint32
- func (s *SourceDescription) Header() Header
- func (s SourceDescription) Marshal() ([]byte, error)
- func (s *SourceDescription) MarshalSize() int
- func (s *SourceDescription) String() string
- func (s *SourceDescription) Unmarshal(rawPacket []byte) error
- type SourceDescriptionChunk
- type SourceDescriptionItem
- type StatisticsSummaryReportBlock
- type StatusVectorChunk
- type TTLorHopLimitType
- type TransportLayerCC
- type TransportLayerNack
- func (p *TransportLayerNack) DestinationSSRC() []uint32
- func (p *TransportLayerNack) Header() Header
- func (p TransportLayerNack) Marshal() ([]byte, error)
- func (p *TransportLayerNack) MarshalSize() int
- func (p TransportLayerNack) String() string
- func (p *TransportLayerNack) Unmarshal(rawPacket []byte) error
- type TypeSpecificField
- type UnknownReportBlock
- type VoIPMetricsReportBlock
- type XRHeader
Constants ¶
const ( LossRLEReportBlockType = 1 // RFC 3611, section 4.1 DuplicateRLEReportBlockType = 2 // RFC 3611, section 4.2 PacketReceiptTimesReportBlockType = 3 // RFC 3611, section 4.3 ReceiverReferenceTimeReportBlockType = 4 // RFC 3611, section 4.4 DLRRReportBlockType = 5 // RFC 3611, section 4.5 StatisticsSummaryReportBlockType = 6 // RFC 3611, section 4.6 VoIPMetricsReportBlockType = 7 // RFC 3611, section 4.7 )
Extended Report block types from RFC 3611.
const ( RunLengthChunkType = 0 BitVectorChunkType = 1 TerminatingNullChunkType = 2 )
These are the valid values that ChunkType can assume
const ( ToHMissing = 0 ToHIPv4 = 1 ToHIPv6 = 2 )
Values for TTLorHopLimitType
const ( FormatSLI uint8 = 2 FormatPLI uint8 = 1 FormatFIR uint8 = 4 FormatTLN uint8 = 1 FormatRRR uint8 = 5 FormatCCFB uint8 = 11 FormatREMB uint8 = 15 // https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#page-5 FormatTCC uint8 = 15 )
Transport and Payload specific feedback messages overload the count field to act as a message type. those are listed here
const ( // type of packet status chunk TypeTCCRunLengthChunk = 0 TypeTCCStatusVectorChunk = 1 )
for packet status chunk
const ( // https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#section-3.1.1 TypeTCCPacketNotReceived = uint16(iota) TypeTCCPacketReceivedSmallDelta TypeTCCPacketReceivedLargeDelta // https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#page-7 // see Example 2: "packet received, w/o recv delta" TypeTCCPacketReceivedWithoutDelta )
type of packet status symbol and recv delta
const ( // https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#section-3.1.4 TypeTCCSymbolSizeOneBit = 0 TypeTCCSymbolSizeTwoBit = 1 )
for status vector chunk
const (
// TypeTCCDeltaScaleFactor https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#section-3.1.5
TypeTCCDeltaScaleFactor = 250
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplicationDefined ¶ added in v1.2.15
ApplicationDefined represents an RTCP application-defined packet.
func (ApplicationDefined) DestinationSSRC ¶ added in v1.2.15
func (a ApplicationDefined) DestinationSSRC() []uint32
DestinationSSRC returns the SSRC value for this packet.
func (ApplicationDefined) Marshal ¶ added in v1.2.15
func (a ApplicationDefined) Marshal() ([]byte, error)
Marshal serializes the application-defined struct into a byte slice with padding.
func (*ApplicationDefined) MarshalSize ¶ added in v1.2.15
func (a *ApplicationDefined) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (*ApplicationDefined) Unmarshal ¶ added in v1.2.15
func (a *ApplicationDefined) Unmarshal(rawPacket []byte) error
Unmarshal parses the given raw packet into an application-defined struct, handling padding.
type BlockTypeType ¶ added in v1.2.8
type BlockTypeType uint8
BlockTypeType specifies the type of report in a report block
func (BlockTypeType) String ¶ added in v1.2.8
func (t BlockTypeType) String() string
String converts the Extended report block types into readable strings
type CCFeedbackMetricBlock ¶ added in v1.2.10
type CCFeedbackMetricBlock struct { Received bool ECN ECN // Offset in 1/1024 seconds before Report Timestamp ArrivalTimeOffset uint16 }
CCFeedbackMetricBlock is a Feedback Metric Block
type CCFeedbackReport ¶ added in v1.2.10
type CCFeedbackReport struct { // SSRC of sender SenderSSRC uint32 // Report Blocks ReportBlocks []CCFeedbackReportBlock // Basetime ReportTimestamp uint32 }
CCFeedbackReport is a Congestion Control Feedback Report as defined in https://www.rfc-editor.org/rfc/rfc8888.html#name-rtcp-congestion-control-fee
func (CCFeedbackReport) DestinationSSRC ¶ added in v1.2.10
func (b CCFeedbackReport) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*CCFeedbackReport) Header ¶ added in v1.2.10
func (b *CCFeedbackReport) Header() Header
Header returns the Header associated with this packet.
func (*CCFeedbackReport) Len ¶ added in v1.2.10
func (b *CCFeedbackReport) Len() int
Len returns the length of the report in bytes
func (CCFeedbackReport) Marshal ¶ added in v1.2.10
func (b CCFeedbackReport) Marshal() ([]byte, error)
Marshal encodes the Congestion Control Feedback Report in binary
func (*CCFeedbackReport) MarshalSize ¶ added in v1.2.13
func (b *CCFeedbackReport) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (CCFeedbackReport) String ¶ added in v1.2.10
func (b CCFeedbackReport) String() string
func (*CCFeedbackReport) Unmarshal ¶ added in v1.2.10
func (b *CCFeedbackReport) Unmarshal(rawPacket []byte) error
Unmarshal decodes the Congestion Control Feedback Report from binary
type CCFeedbackReportBlock ¶ added in v1.2.10
type CCFeedbackReportBlock struct { // SSRC of the RTP stream on which this block is reporting MediaSSRC uint32 BeginSequence uint16 MetricBlocks []CCFeedbackMetricBlock }
CCFeedbackReportBlock is a Feedback Report Block
func (CCFeedbackReportBlock) String ¶ added in v1.2.10
func (b CCFeedbackReportBlock) String() string
type Chunk ¶ added in v1.2.8
type Chunk uint16
Chunk as defined in RFC 3611, section 4.1. These represent information about packet losses and packet duplication. They have three representations:
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| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (Chunk) RunType ¶ added in v1.2.8
RunType returns the RunType that this Chunk represents. It is only valid if ChunkType is RunLengthChunkType.
type ChunkType ¶ added in v1.2.8
type ChunkType uint8
ChunkType enumerates the three kinds of chunks described in RFC 3611 section 4.1.
type CompoundPacket ¶ added in v1.1.4
type CompoundPacket []Packet
A CompoundPacket is a collection of RTCP packets transmitted as a single packet with the underlying protocol (for example UDP).
To maximize the resolution of receiption statistics, the first Packet in a CompoundPacket must always be either a SenderReport or a ReceiverReport. This is true even if no data has been sent or received, in which case an empty ReceiverReport must be sent, and even if the only other RTCP packet in the compound packet is a Goodbye.
Next, a SourceDescription containing a CNAME item must be included in each CompoundPacket to identify the source and to begin associating media for purposes such as lip-sync.
Other RTCP packet types may follow in any order. Packet types may appear more than once.
func (CompoundPacket) CNAME ¶ added in v1.2.0
func (c CompoundPacket) CNAME() (string, error)
CNAME returns the CNAME that *must* be present in every CompoundPacket
func (CompoundPacket) DestinationSSRC ¶ added in v1.1.5
func (c CompoundPacket) DestinationSSRC() []uint32
DestinationSSRC returns the synchronization sources associated with this CompoundPacket's reception report.
func (CompoundPacket) Marshal ¶ added in v1.1.4
func (c CompoundPacket) Marshal() ([]byte, error)
Marshal encodes the CompoundPacket as binary.
func (CompoundPacket) MarshalSize ¶ added in v1.2.13
func (c CompoundPacket) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (CompoundPacket) String ¶ added in v1.2.7
func (c CompoundPacket) String() string
func (*CompoundPacket) Unmarshal ¶ added in v1.1.5
func (c *CompoundPacket) Unmarshal(rawData []byte) error
Unmarshal decodes a CompoundPacket from binary.
func (CompoundPacket) Validate ¶ added in v1.1.4
func (c CompoundPacket) Validate() error
Validate returns an error if this is not an RFC-compliant CompoundPacket.
type DLRRReport ¶ added in v1.2.8
DLRRReport encodes a single report inside a DLRRReportBlock.
type DLRRReportBlock ¶ added in v1.2.8
type DLRRReportBlock struct { XRHeader Reports []DLRRReport }
DLRRReportBlock encodes a DLRR Report Block as described in RFC 3611 section 4.5.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BT=5 | reserved | block length | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | SSRC_1 (SSRC of first receiver) | sub- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block | last RR (LRR) | 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | delay since last RR (DLRR) | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | SSRC_2 (SSRC of second receiver) | sub- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block : ... : 2 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
func (*DLRRReportBlock) DestinationSSRC ¶ added in v1.2.8
func (b *DLRRReportBlock) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this report block refers to.
type DuplicateRLEReportBlock ¶ added in v1.2.8
type DuplicateRLEReportBlock rleReportBlock
DuplicateRLEReportBlock is used to report information about packet duplication, as described in RFC 3611, section 4.1
func (*DuplicateRLEReportBlock) DestinationSSRC ¶ added in v1.2.8
func (b *DuplicateRLEReportBlock) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this report block refers to.
type ECN ¶ added in v1.2.10
type ECN uint8
ECN represents the two ECN bits
const ( //nolint:misspell // ECNNonECT signals Non ECN-Capable Transport, Non-ECT ECNNonECT ECN = iota // 00 //nolint:misspell // ECNECT1 signals ECN Capable Transport, ECT(0) ECNECT1 // 01 //nolint:misspell // ECNECT0 signals ECN Capable Transport, ECT(1) ECNECT0 // 10 // ECNCE signals ECN Congestion Encountered, CE ECNCE // 11 )
type ExtendedReport ¶ added in v1.2.8
type ExtendedReport struct { SenderSSRC uint32 `fmt:"0x%X"` Reports []ReportBlock }
The ExtendedReport packet is an Implementation of RTCP Extended Reports defined in RFC 3611. It is used to convey detailed information about an RTP stream. Each packet contains one or more report blocks, each of which conveys a different kind of information.
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|reserved | PT=XR=207 | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ : report blocks : +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (*ExtendedReport) DestinationSSRC ¶ added in v1.2.8
func (x *ExtendedReport) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (ExtendedReport) Marshal ¶ added in v1.2.8
func (x ExtendedReport) Marshal() ([]byte, error)
Marshal encodes the ExtendedReport in binary
func (ExtendedReport) MarshalSize ¶ added in v1.2.13
func (x ExtendedReport) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (*ExtendedReport) String ¶ added in v1.2.8
func (x *ExtendedReport) String() string
func (*ExtendedReport) Unmarshal ¶ added in v1.2.8
func (x *ExtendedReport) Unmarshal(b []byte) error
Unmarshal decodes the ExtendedReport from binary
type FullIntraRequest ¶ added in v1.2.2
The FullIntraRequest packet is used to reliably request an Intra frame in a video stream. See RFC 5104 Section 3.5.1. This is not for loss recovery, which should use PictureLossIndication (PLI) instead.
func (*FullIntraRequest) DestinationSSRC ¶ added in v1.2.2
func (p *FullIntraRequest) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*FullIntraRequest) Header ¶ added in v1.2.2
func (p *FullIntraRequest) Header() Header
Header returns the Header associated with this packet.
func (FullIntraRequest) Marshal ¶ added in v1.2.2
func (p FullIntraRequest) Marshal() ([]byte, error)
Marshal encodes the FullIntraRequest
func (*FullIntraRequest) MarshalSize ¶ added in v1.2.13
func (p *FullIntraRequest) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (*FullIntraRequest) String ¶ added in v1.2.2
func (p *FullIntraRequest) String() string
func (*FullIntraRequest) Unmarshal ¶ added in v1.2.2
func (p *FullIntraRequest) Unmarshal(rawPacket []byte) error
Unmarshal decodes the TransportLayerNack
type Goodbye ¶
type Goodbye struct { // The SSRC/CSRC identifiers that are no longer active Sources []uint32 // Optional text indicating the reason for leaving, e.g., "camera malfunction" or "RTP loop detected" Reason string }
The Goodbye packet indicates that one or more sources are no longer active.
func (*Goodbye) DestinationSSRC ¶
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*Goodbye) MarshalSize ¶ added in v1.2.13
MarshalSize returns the size of the packet once marshaled
type Header ¶
type Header struct { // If the padding bit is set, this individual RTCP packet contains // some additional padding octets at the end which are not part of // the control information but are included in the length field. Padding bool // The number of reception reports, sources contained or FMT in this packet (depending on the Type) Count uint8 // The RTCP packet type for this packet Type PacketType // The length of this RTCP packet in 32-bit words minus one, // including the header and any padding. Length uint16 }
A Header is the common header shared by all RTCP packets
type LossRLEReportBlock ¶ added in v1.2.8
type LossRLEReportBlock rleReportBlock
LossRLEReportBlock is used to report information about packet losses, as described in RFC 3611, section 4.1
func (*LossRLEReportBlock) DestinationSSRC ¶ added in v1.2.8
func (b *LossRLEReportBlock) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this report block refers to.
type NackPair ¶
type NackPair struct { // ID of lost packets PacketID uint16 // Bitmask of following lost packets LostPackets PacketBitmap }
NackPair is a wire-representation of a collection of Lost RTP packets
func NackPairsFromSequenceNumbers ¶ added in v1.2.6
NackPairsFromSequenceNumbers generates a slice of NackPair from a list of SequenceNumbers This handles generating the proper values for PacketID/LostPackets
func (*NackPair) PacketList ¶
PacketList returns a list of Nack'd packets that's referenced by a NackPair
type Packet ¶
type Packet interface { // DestinationSSRC returns an array of SSRC values that this packet refers to. DestinationSSRC() []uint32 Marshal() ([]byte, error) Unmarshal(rawPacket []byte) error MarshalSize() int }
Packet represents an RTCP packet, a protocol used for out-of-band statistics and control information for an RTP session
func Unmarshal ¶
Unmarshal takes an entire udp datagram (which may consist of multiple RTCP packets) and returns the unmarshaled packets it contains.
If this is a reduced-size RTCP packet a feedback packet (Goodbye, SliceLossIndication, etc) will be returned. Otherwise, the underlying type of the returned packet will be CompoundPacket.
type PacketBitmap ¶
type PacketBitmap uint16
PacketBitmap shouldn't be used like a normal integral, so it's type is masked here. Access it with PacketList().
type PacketReceiptTimesReportBlock ¶ added in v1.2.8
type PacketReceiptTimesReportBlock struct { XRHeader T uint8 `encoding:"omit"` SSRC uint32 `fmt:"0x%X"` BeginSeq uint16 EndSeq uint16 ReceiptTime []uint32 }
PacketReceiptTimesReportBlock represents a Packet Receipt Times report block, as described in RFC 3611 section 4.3.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BT=3 | rsvd. | T | block length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC of source | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | begin_seq | end_seq | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Receipt time of packet begin_seq | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Receipt time of packet (begin_seq + 1) mod 65536 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ : ... : +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Receipt time of packet (end_seq - 1) mod 65536 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (*PacketReceiptTimesReportBlock) DestinationSSRC ¶ added in v1.2.8
func (b *PacketReceiptTimesReportBlock) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this report block refers to.
type PacketStatusChunk ¶ added in v1.2.2
PacketStatusChunk has two kinds: RunLengthChunk and StatusVectorChunk
type PacketType ¶
type PacketType uint8
PacketType specifies the type of an RTCP packet
const ( TypeSenderReport PacketType = 200 // RFC 3550, 6.4.1 TypeReceiverReport PacketType = 201 // RFC 3550, 6.4.2 TypeSourceDescription PacketType = 202 // RFC 3550, 6.5 TypeGoodbye PacketType = 203 // RFC 3550, 6.6 TypeApplicationDefined PacketType = 204 // RFC 3550, 6.7 (unimplemented) TypeTransportSpecificFeedback PacketType = 205 // RFC 4585, 6051 TypePayloadSpecificFeedback PacketType = 206 // RFC 4585, 6.3 TypeExtendedReport PacketType = 207 // RFC 3611 )
RTCP packet types registered with IANA. See: https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-4
func (PacketType) String ¶
func (p PacketType) String() string
type PictureLossIndication ¶
type PictureLossIndication struct { // SSRC of sender SenderSSRC uint32 // SSRC where the loss was experienced MediaSSRC uint32 }
The PictureLossIndication packet informs the encoder about the loss of an undefined amount of coded video data belonging to one or more pictures
func (*PictureLossIndication) DestinationSSRC ¶
func (p *PictureLossIndication) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*PictureLossIndication) Header ¶
func (p *PictureLossIndication) Header() Header
Header returns the Header associated with this packet.
func (PictureLossIndication) Marshal ¶
func (p PictureLossIndication) Marshal() ([]byte, error)
Marshal encodes the PictureLossIndication in binary
func (*PictureLossIndication) MarshalSize ¶ added in v1.2.13
func (p *PictureLossIndication) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (*PictureLossIndication) String ¶
func (p *PictureLossIndication) String() string
func (*PictureLossIndication) Unmarshal ¶
func (p *PictureLossIndication) Unmarshal(rawPacket []byte) error
Unmarshal decodes the PictureLossIndication from binary
type RapidResynchronisationRequest ¶ added in v1.2.10
type RapidResynchronisationRequest = RapidResynchronizationRequest
RapidResynchronisationRequest is provided as RFC 6051 spells resynchronization with an s. We provide both names to be consistent with other RFCs which spell resynchronization with a z.
type RapidResynchronizationRequest ¶
type RapidResynchronizationRequest struct { // SSRC of sender SenderSSRC uint32 // SSRC of the media source MediaSSRC uint32 }
The RapidResynchronizationRequest packet informs the encoder about the loss of an undefined amount of coded video data belonging to one or more pictures
func (*RapidResynchronizationRequest) DestinationSSRC ¶
func (p *RapidResynchronizationRequest) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*RapidResynchronizationRequest) Header ¶
func (p *RapidResynchronizationRequest) Header() Header
Header returns the Header associated with this packet.
func (RapidResynchronizationRequest) Marshal ¶
func (p RapidResynchronizationRequest) Marshal() ([]byte, error)
Marshal encodes the RapidResynchronizationRequest in binary
func (*RapidResynchronizationRequest) MarshalSize ¶ added in v1.2.13
func (p *RapidResynchronizationRequest) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (*RapidResynchronizationRequest) String ¶
func (p *RapidResynchronizationRequest) String() string
func (*RapidResynchronizationRequest) Unmarshal ¶
func (p *RapidResynchronizationRequest) Unmarshal(rawPacket []byte) error
Unmarshal decodes the RapidResynchronizationRequest from binary
type RawPacket ¶
type RawPacket []byte
RawPacket represents an unparsed RTCP packet. It's returned by Unmarshal when a packet with an unknown type is encountered.
func (*RawPacket) DestinationSSRC ¶
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (RawPacket) MarshalSize ¶ added in v1.2.13
MarshalSize returns the size of the packet once marshaled
type ReceiverEstimatedMaximumBitrate ¶ added in v1.1.4
type ReceiverEstimatedMaximumBitrate struct { // SSRC of sender SenderSSRC uint32 // Estimated maximum bitrate Bitrate float32 // SSRC entries which this packet applies to SSRCs []uint32 }
ReceiverEstimatedMaximumBitrate contains the receiver's estimated maximum bitrate. see: https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03
func (*ReceiverEstimatedMaximumBitrate) DestinationSSRC ¶ added in v1.1.4
func (p *ReceiverEstimatedMaximumBitrate) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*ReceiverEstimatedMaximumBitrate) Header ¶ added in v1.1.4
func (p *ReceiverEstimatedMaximumBitrate) Header() Header
Header returns the Header associated with this packet.
func (ReceiverEstimatedMaximumBitrate) Marshal ¶ added in v1.1.4
func (p ReceiverEstimatedMaximumBitrate) Marshal() (buf []byte, err error)
Marshal serializes the packet and returns a byte slice.
func (ReceiverEstimatedMaximumBitrate) MarshalSize ¶ added in v1.1.4
func (p ReceiverEstimatedMaximumBitrate) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (ReceiverEstimatedMaximumBitrate) MarshalTo ¶ added in v1.1.4
func (p ReceiverEstimatedMaximumBitrate) MarshalTo(buf []byte) (n int, err error)
MarshalTo serializes the packet to the given byte slice.
func (*ReceiverEstimatedMaximumBitrate) String ¶ added in v1.1.4
func (p *ReceiverEstimatedMaximumBitrate) String() string
String prints the REMB packet in a human-readable format.
func (*ReceiverEstimatedMaximumBitrate) Unmarshal ¶ added in v1.1.4
func (p *ReceiverEstimatedMaximumBitrate) Unmarshal(buf []byte) (err error)
Unmarshal reads a REMB packet from the given byte slice.
type ReceiverReferenceTimeReportBlock ¶ added in v1.2.8
ReceiverReferenceTimeReportBlock encodes a Receiver Reference Time report block as described in RFC 3611 section 4.4.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BT=4 | reserved | block length = 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NTP timestamp, most significant word | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NTP timestamp, least significant word | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (*ReceiverReferenceTimeReportBlock) DestinationSSRC ¶ added in v1.2.8
func (b *ReceiverReferenceTimeReportBlock) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this report block refers to.
type ReceiverReport ¶
type ReceiverReport struct { // The synchronization source identifier for the originator of this RR packet. SSRC uint32 // Zero or more reception report blocks depending on the number of other // sources heard by this sender since the last report. Each reception report // block conveys statistics on the reception of RTP packets from a // single synchronization source. Reports []ReceptionReport // Extension contains additional, payload-specific information that needs to // be reported regularly about the receiver. ProfileExtensions []byte }
A ReceiverReport (RR) packet provides reception quality feedback for an RTP stream
func (*ReceiverReport) DestinationSSRC ¶
func (r *ReceiverReport) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*ReceiverReport) Header ¶
func (r *ReceiverReport) Header() Header
Header returns the Header associated with this packet.
func (ReceiverReport) Marshal ¶
func (r ReceiverReport) Marshal() ([]byte, error)
Marshal encodes the ReceiverReport in binary
func (*ReceiverReport) MarshalSize ¶ added in v1.2.13
func (r *ReceiverReport) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (ReceiverReport) String ¶
func (r ReceiverReport) String() string
func (*ReceiverReport) Unmarshal ¶
func (r *ReceiverReport) Unmarshal(rawPacket []byte) error
Unmarshal decodes the ReceiverReport from binary
type ReceptionReport ¶
type ReceptionReport struct { // The SSRC identifier of the source to which the information in this // reception report block pertains. SSRC uint32 // The fraction of RTP data packets from source SSRC lost since the // previous SR or RR packet was sent, expressed as a fixed point // number with the binary point at the left edge of the field. FractionLost uint8 // The total number of RTP data packets from source SSRC that have // been lost since the beginning of reception. TotalLost uint32 // The low 16 bits contain the highest sequence number received in an // RTP data packet from source SSRC, and the most significant 16 // bits extend that sequence number with the corresponding count of // sequence number cycles. LastSequenceNumber uint32 // An estimate of the statistical variance of the RTP data packet // interarrival time, measured in timestamp units and expressed as an // unsigned integer. Jitter uint32 // The middle 32 bits out of 64 in the NTP timestamp received as part of // the most recent RTCP sender report (SR) packet from source SSRC. If no // SR has been received yet, the field is set to zero. LastSenderReport uint32 // The delay, expressed in units of 1/65536 seconds, between receiving the // last SR packet from source SSRC and sending this reception report block. // If no SR packet has been received yet from SSRC, the field is set to zero. Delay uint32 }
A ReceptionReport block conveys statistics on the reception of RTP packets from a single synchronization source.
func (ReceptionReport) Marshal ¶
func (r ReceptionReport) Marshal() ([]byte, error)
Marshal encodes the ReceptionReport in binary
func (*ReceptionReport) Unmarshal ¶
func (r *ReceptionReport) Unmarshal(rawPacket []byte) error
Unmarshal decodes the ReceptionReport from binary
type RecvDelta ¶ added in v1.2.2
RecvDelta are represented as multiples of 250us small delta is 1 byte: [0,63.75]ms = [0, 63750]us = [0, 255]*250us big delta is 2 bytes: [-8192.0, 8191.75]ms = [-8192000, 8191750]us = [-32768, 32767]*250us https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#section-3.1.5
type ReportBlock ¶ added in v1.2.8
type ReportBlock interface { DestinationSSRC() []uint32 // contains filtered or unexported methods }
ReportBlock represents a single report within an ExtendedReport packet
type RunLengthChunk ¶ added in v1.2.2
type RunLengthChunk struct { PacketStatusChunk // T = TypeTCCRunLengthChunk Type uint16 // S: type of packet status // kind: TypeTCCPacketNotReceived or... PacketStatusSymbol uint16 // RunLength: count of S RunLength uint16 }
RunLengthChunk T=TypeTCCRunLengthChunk 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |T| S | Run Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (RunLengthChunk) Marshal ¶ added in v1.2.2
func (r RunLengthChunk) Marshal() ([]byte, error)
Marshal ..
func (*RunLengthChunk) Unmarshal ¶ added in v1.2.2
func (r *RunLengthChunk) Unmarshal(rawPacket []byte) error
Unmarshal ..
type SDESType ¶
type SDESType uint8
SDESType is the item type used in the RTCP SDES control packet.
const ( SDESEnd SDESType = iota // end of SDES list RFC 3550, 6.5 SDESCNAME // canonical name RFC 3550, 6.5.1 SDESName // user name RFC 3550, 6.5.2 SDESEmail // user's electronic mail address RFC 3550, 6.5.3 SDESPhone // user's phone number RFC 3550, 6.5.4 SDESLocation // geographic user location RFC 3550, 6.5.5 SDESTool // name of application or tool RFC 3550, 6.5.6 SDESNote // notice about the source RFC 3550, 6.5.7 SDESPrivate // private extensions RFC 3550, 6.5.8 (not implemented) )
RTP SDES item types registered with IANA. See: https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-5
type SLIEntry ¶
type SLIEntry struct { // ID of first lost slice First uint16 // Number of lost slices Number uint16 // ID of related picture Picture uint8 }
SLIEntry represents a single entry to the SLI packet's list of lost slices.
type SenderReport ¶
type SenderReport struct { // The synchronization source identifier for the originator of this SR packet. SSRC uint32 // The wallclock time when this report was sent so that it may be used in // combination with timestamps returned in reception reports from other // receivers to measure round-trip propagation to those receivers. NTPTime uint64 // Corresponds to the same time as the NTP timestamp (above), but in // the same units and with the same random offset as the RTP // timestamps in data packets. This correspondence may be used for // intra- and inter-media synchronization for sources whose NTP // timestamps are synchronized, and may be used by media-independent // receivers to estimate the nominal RTP clock frequency. RTPTime uint32 // The total number of RTP data packets transmitted by the sender // since starting transmission up until the time this SR packet was // generated. PacketCount uint32 // The total number of payload octets (i.e., not including header or // padding) transmitted in RTP data packets by the sender since // starting transmission up until the time this SR packet was // generated. OctetCount uint32 // Zero or more reception report blocks depending on the number of other // sources heard by this sender since the last report. Each reception report // block conveys statistics on the reception of RTP packets from a // single synchronization source. Reports []ReceptionReport // ProfileExtensions contains additional, payload-specific information that needs to // be reported regularly about the sender. ProfileExtensions []byte }
A SenderReport (SR) packet provides reception quality feedback for an RTP stream
func (*SenderReport) DestinationSSRC ¶
func (r *SenderReport) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*SenderReport) Header ¶
func (r *SenderReport) Header() Header
Header returns the Header associated with this packet.
func (SenderReport) Marshal ¶
func (r SenderReport) Marshal() ([]byte, error)
Marshal encodes the SenderReport in binary
func (*SenderReport) MarshalSize ¶ added in v1.2.13
func (r *SenderReport) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (SenderReport) String ¶ added in v1.1.4
func (r SenderReport) String() string
func (*SenderReport) Unmarshal ¶
func (r *SenderReport) Unmarshal(rawPacket []byte) error
Unmarshal decodes the SenderReport from binary
type SliceLossIndication ¶
type SliceLossIndication struct { // SSRC of sender SenderSSRC uint32 // SSRC of the media source MediaSSRC uint32 SLI []SLIEntry }
The SliceLossIndication packet informs the encoder about the loss of a picture slice
func (*SliceLossIndication) DestinationSSRC ¶
func (p *SliceLossIndication) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*SliceLossIndication) Header ¶
func (p *SliceLossIndication) Header() Header
Header returns the Header associated with this packet.
func (SliceLossIndication) Marshal ¶
func (p SliceLossIndication) Marshal() ([]byte, error)
Marshal encodes the SliceLossIndication in binary
func (*SliceLossIndication) MarshalSize ¶ added in v1.2.13
func (p *SliceLossIndication) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (*SliceLossIndication) String ¶
func (p *SliceLossIndication) String() string
func (*SliceLossIndication) Unmarshal ¶
func (p *SliceLossIndication) Unmarshal(rawPacket []byte) error
Unmarshal decodes the SliceLossIndication from binary
type SourceDescription ¶
type SourceDescription struct {
Chunks []SourceDescriptionChunk
}
A SourceDescription (SDES) packet describes the sources in an RTP stream.
func NewCNAMESourceDescription ¶ added in v1.2.10
func NewCNAMESourceDescription(ssrc uint32, cname string) *SourceDescription
NewCNAMESourceDescription creates a new SourceDescription with a single CNAME item.
func (*SourceDescription) DestinationSSRC ¶
func (s *SourceDescription) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*SourceDescription) Header ¶
func (s *SourceDescription) Header() Header
Header returns the Header associated with this packet.
func (SourceDescription) Marshal ¶
func (s SourceDescription) Marshal() ([]byte, error)
Marshal encodes the SourceDescription in binary
func (*SourceDescription) MarshalSize ¶ added in v1.2.13
func (s *SourceDescription) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (*SourceDescription) String ¶ added in v1.1.4
func (s *SourceDescription) String() string
func (*SourceDescription) Unmarshal ¶
func (s *SourceDescription) Unmarshal(rawPacket []byte) error
Unmarshal decodes the SourceDescription from binary
type SourceDescriptionChunk ¶
type SourceDescriptionChunk struct { // The source (ssrc) or contributing source (csrc) identifier this packet describes Source uint32 Items []SourceDescriptionItem }
A SourceDescriptionChunk contains items describing a single RTP source
func (SourceDescriptionChunk) Marshal ¶
func (s SourceDescriptionChunk) Marshal() ([]byte, error)
Marshal encodes the SourceDescriptionChunk in binary
func (*SourceDescriptionChunk) Unmarshal ¶
func (s *SourceDescriptionChunk) Unmarshal(rawPacket []byte) error
Unmarshal decodes the SourceDescriptionChunk from binary
type SourceDescriptionItem ¶
type SourceDescriptionItem struct { // The type identifier for this item. eg, SDESCNAME for canonical name description. // // Type zero or SDESEnd is interpreted as the end of an item list and cannot be used. Type SDESType // Text is a unicode text blob associated with the item. Its meaning varies based on the item's Type. Text string }
A SourceDescriptionItem is a part of a SourceDescription that describes a stream.
func (SourceDescriptionItem) Len ¶ added in v1.2.13
func (s SourceDescriptionItem) Len() int
Len returns the length of the SourceDescriptionItem when encoded as binary.
func (SourceDescriptionItem) Marshal ¶
func (s SourceDescriptionItem) Marshal() ([]byte, error)
Marshal encodes the SourceDescriptionItem in binary
func (*SourceDescriptionItem) Unmarshal ¶
func (s *SourceDescriptionItem) Unmarshal(rawPacket []byte) error
Unmarshal decodes the SourceDescriptionItem from binary
type StatisticsSummaryReportBlock ¶ added in v1.2.8
type StatisticsSummaryReportBlock struct { XRHeader LossReports bool `encoding:"omit"` DuplicateReports bool `encoding:"omit"` JitterReports bool `encoding:"omit"` TTLorHopLimit TTLorHopLimitType `encoding:"omit"` SSRC uint32 `fmt:"0x%X"` BeginSeq uint16 EndSeq uint16 LostPackets uint32 DupPackets uint32 MinJitter uint32 MaxJitter uint32 MeanJitter uint32 DevJitter uint32 MinTTLOrHL uint8 MaxTTLOrHL uint8 MeanTTLOrHL uint8 DevTTLOrHL uint8 }
StatisticsSummaryReportBlock encodes a Statistics Summary Report Block as described in RFC 3611, section 4.6.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BT=6 |L|D|J|ToH|rsvd.| block length = 9 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC of source | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | begin_seq | end_seq | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | lost_packets | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | dup_packets | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | min_jitter | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | max_jitter | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | mean_jitter | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | dev_jitter | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | min_ttl_or_hl | max_ttl_or_hl |mean_ttl_or_hl | dev_ttl_or_hl | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (*StatisticsSummaryReportBlock) DestinationSSRC ¶ added in v1.2.8
func (b *StatisticsSummaryReportBlock) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this report block refers to.
type StatusVectorChunk ¶ added in v1.2.2
type StatusVectorChunk struct { PacketStatusChunk // T = TypeTCCRunLengthChunk Type uint16 // TypeTCCSymbolSizeOneBit or TypeTCCSymbolSizeTwoBit SymbolSize uint16 // when SymbolSize = TypeTCCSymbolSizeOneBit, SymbolList is 14*1bit: // TypeTCCSymbolListPacketReceived or TypeTCCSymbolListPacketNotReceived // when SymbolSize = TypeTCCSymbolSizeTwoBit, SymbolList is 7*2bit: // TypeTCCPacketNotReceived TypeTCCPacketReceivedSmallDelta TypeTCCPacketReceivedLargeDelta or typePacketReserved SymbolList []uint16 }
StatusVectorChunk T=typeStatusVecotrChunk 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |T|S| symbol list | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (StatusVectorChunk) Marshal ¶ added in v1.2.2
func (r StatusVectorChunk) Marshal() ([]byte, error)
Marshal ..
func (*StatusVectorChunk) Unmarshal ¶ added in v1.2.2
func (r *StatusVectorChunk) Unmarshal(rawPacket []byte) error
Unmarshal ..
type TTLorHopLimitType ¶ added in v1.2.8
type TTLorHopLimitType uint8
TTLorHopLimitType encodes values for the ToH field in a StatisticsSummaryReportBlock
func (TTLorHopLimitType) String ¶ added in v1.2.8
func (t TTLorHopLimitType) String() string
type TransportLayerCC ¶ added in v1.2.2
type TransportLayerCC struct { // header Header Header // SSRC of sender SenderSSRC uint32 // SSRC of the media source MediaSSRC uint32 // Transport wide sequence of rtp extension BaseSequenceNumber uint16 // PacketStatusCount PacketStatusCount uint16 // ReferenceTime ReferenceTime uint32 // FbPktCount FbPktCount uint8 // PacketChunks PacketChunks []PacketStatusChunk // RecvDeltas RecvDeltas []*RecvDelta }
TransportLayerCC for sender-BWE https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#page-5
func (TransportLayerCC) DestinationSSRC ¶ added in v1.2.2
func (t TransportLayerCC) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*TransportLayerCC) Len ¶ added in v1.2.2
func (t *TransportLayerCC) Len() uint16
Len return total bytes with padding
func (TransportLayerCC) Marshal ¶ added in v1.2.2
func (t TransportLayerCC) Marshal() ([]byte, error)
Marshal encodes the TransportLayerCC in binary
func (*TransportLayerCC) MarshalSize ¶ added in v1.2.13
func (t *TransportLayerCC) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (TransportLayerCC) String ¶ added in v1.2.2
func (t TransportLayerCC) String() string
func (*TransportLayerCC) Unmarshal ¶ added in v1.2.2
func (t *TransportLayerCC) Unmarshal(rawPacket []byte) error
Unmarshal ..
type TransportLayerNack ¶
type TransportLayerNack struct { // SSRC of sender SenderSSRC uint32 // SSRC of the media source MediaSSRC uint32 Nacks []NackPair }
The TransportLayerNack packet informs the encoder about the loss of a transport packet IETF RFC 4585, Section 6.2.1 https://tools.ietf.org/html/rfc4585#section-6.2.1
func (*TransportLayerNack) DestinationSSRC ¶
func (p *TransportLayerNack) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this packet refers to.
func (*TransportLayerNack) Header ¶
func (p *TransportLayerNack) Header() Header
Header returns the Header associated with this packet.
func (TransportLayerNack) Marshal ¶
func (p TransportLayerNack) Marshal() ([]byte, error)
Marshal encodes the TransportLayerNack in binary
func (*TransportLayerNack) MarshalSize ¶ added in v1.2.13
func (p *TransportLayerNack) MarshalSize() int
MarshalSize returns the size of the packet once marshaled
func (TransportLayerNack) String ¶
func (p TransportLayerNack) String() string
func (*TransportLayerNack) Unmarshal ¶
func (p *TransportLayerNack) Unmarshal(rawPacket []byte) error
Unmarshal decodes the TransportLayerNack from binary
type TypeSpecificField ¶ added in v1.2.8
type TypeSpecificField uint8
TypeSpecificField as described in RFC 3611 section 4.5. In typical cases, users of ExtendedReports shouldn't need to access this, and should instead use the corresponding fields in the actual report blocks themselves.
type UnknownReportBlock ¶ added in v1.2.8
UnknownReportBlock is used to store bytes for any report block that has an unknown Report Block Type.
func (*UnknownReportBlock) DestinationSSRC ¶ added in v1.2.8
func (b *UnknownReportBlock) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this report block refers to.
type VoIPMetricsReportBlock ¶ added in v1.2.8
type VoIPMetricsReportBlock struct { XRHeader SSRC uint32 `fmt:"0x%X"` LossRate uint8 DiscardRate uint8 BurstDensity uint8 GapDensity uint8 BurstDuration uint16 GapDuration uint16 RoundTripDelay uint16 EndSystemDelay uint16 SignalLevel uint8 NoiseLevel uint8 RERL uint8 Gmin uint8 RFactor uint8 ExtRFactor uint8 MOSLQ uint8 MOSCQ uint8 RXConfig uint8 JBNominal uint16 JBMaximum uint16 JBAbsMax uint16 // contains filtered or unexported fields }
VoIPMetricsReportBlock encodes a VoIP Metrics Report Block as described in RFC 3611, section 4.7.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BT=7 | reserved | block length = 8 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC of source | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | loss rate | discard rate | burst density | gap density | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | burst duration | gap duration | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | round trip delay | end system delay | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | signal level | noise level | RERL | Gmin | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | R factor | ext. R factor | MOS-LQ | MOS-CQ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RX config | reserved | JB nominal | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | JB maximum | JB abs max | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (*VoIPMetricsReportBlock) DestinationSSRC ¶ added in v1.2.8
func (b *VoIPMetricsReportBlock) DestinationSSRC() []uint32
DestinationSSRC returns an array of SSRC values that this report block refers to.
type XRHeader ¶ added in v1.2.8
type XRHeader struct { BlockType BlockTypeType TypeSpecific TypeSpecificField `fmt:"0x%X"` BlockLength uint16 }
XRHeader defines the common fields that must appear at the start of each report block. In typical cases, users of ExtendedReports shouldn't need to access this. For locally-constructed report blocks, these values will not be accurate until the corresponding packet is marshaled.
Source Files ¶
- application_defined.go
- compound_packet.go
- doc.go
- errors.go
- extended_report.go
- full_intra_request.go
- goodbye.go
- header.go
- packet.go
- packet_buffer.go
- packet_stringifier.go
- picture_loss_indication.go
- rapid_resynchronization_request.go
- raw_packet.go
- receiver_estimated_maximum_bitrate.go
- receiver_report.go
- reception_report.go
- rfc8888.go
- sender_report.go
- slice_loss_indication.go
- source_description.go
- transport_layer_cc.go
- transport_layer_nack.go
- util.go