1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! RTCP control packets — RFC 3550 §6, spec-complete (not just a happy-path
//! subset).
//!
//! Typed, symmetric [`Parse`](broadcast_common::Parse)/[`Serialize`](broadcast_common::Serialize)
//! for every RTCP packet type described in the curated spec transcription at
//! `rtcp-packet/docs/rtcp.md` (fetched directly from
//! [RFC 3550](https://www.rfc-editor.org/rfc/rfc3550.txt)) — cite that file,
//! not this doc comment, as the field-semantics oracle.
//!
//! - [`SenderReport`] — SR (§6.4.1, PT 200).
//! - [`ReceiverReport`] — RR (§6.4.2, PT 201).
//! - [`ReportBlock`] — the 24-byte reception report block shared by SR/RR.
//! - [`SourceDescription`] / [`SdesChunk`] / [`SdesItem`] / [`SdesItemType`]
//! — SDES (§6.5, PT 202).
//! - [`Bye`] — BYE (§6.6, PT 203).
//! - [`App`] — APP (§6.7, PT 204).
//! - [`RtcpPacket`] / [`RtcpPacketType`] — the packet-type dispatch enum.
//! - [`CompoundPacket`] — §6.1's compound packet (a sequence of RTCP packets
//! that must begin with SR or RR), with byte-exact round-trip.
//!
//! Two decode-completeness gaps are documented (not silently glossed over)
//! in `docs/rtcp.md`: SR/RR profile-specific extensions and the SDES PRIV
//! item's internal `prefix`/`value` sub-structure are not separately typed.
//!
//! RTCP carries **no media** — this is a standalone wire codec for the RTP
//! control channel (a companion to the `rtp-packet` crate), not a hub
//! `Package`/`Unpackage` spoke.
//!
//! Depends only on `broadcast-common`. `#![no_std]` (+ `alloc`) when the
//! `std` feature is disabled.
//!
//! # Examples
//!
//! Build a Sender Report with two reception report blocks and round-trip it:
//!
//! ```
//! use broadcast_common::{Parse, Serialize};
//! use rtcp_packet::{ReportBlock, SenderReport};
//!
//! let sr = SenderReport {
//! ssrc: 0x1122_3344,
//! ntp_msw: 0xE0E1_E2E3,
//! ntp_lsw: 0x1020_3040,
//! rtp_timestamp: 0x0009_0000,
//! packet_count: 4321,
//! octet_count: 999_999,
//! report_blocks: vec![ReportBlock {
//! ssrc: 0xAAAA_AAAA,
//! fraction_lost: 12,
//! cumulative_lost: -3,
//! ext_highest_seq: 0x0001_2345,
//! jitter: 500,
//! lsr: 0xAABB_CCDD,
//! dlsr: 0x0000_1000,
//! }],
//! };
//! let mut bytes = vec![0u8; sr.serialized_len()];
//! sr.serialize_into(&mut bytes).unwrap();
//! assert_eq!(SenderReport::parse(&bytes).unwrap(), sr);
//! ```
// Runnable examples, embedded so they render on docs.rs and stay in sync with
// the actual `examples/*.rs` files (shown, not compiled).
extern crate alloc;
pub use ;
pub use ;