| 1 | // SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly> |
| 2 | // SPDX-License-Identifier: MIT |
| 3 | |
| 4 | package rtcpscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ |
| 5 | |
| 6 | import ( |
| 7 | "bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/" |
| 8 | "slicesscip-go gomod github.com/golang/go/src go1.24.0 slices/" |
| 9 | "testingscip-go gomod github.com/golang/go/src go1.24.0 testing/" |
| 10 | |
| 11 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/" |
| 12 | ) |
| 13 | |
| 14 | var _ Packetscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Packet# = (*SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#)(nil) // assert is a Packet |
| 15 | |
| 16 | func TestSenderReportUnmarshalscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/TestSenderReportUnmarshal().(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 17 | for _, test := range []struct { |
| 18 | Name string |
| 19 | Data []byte |
| 20 | Want SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport# |
| 21 | WantError error |
| 22 | }{ |
| 23 | { |
| 24 | Name: "nil", |
| 25 | Data: nil, |
| 26 | WantError: errPacketTooShortscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/errPacketTooShort., |
| 27 | }, |
| 28 | { |
| 29 | Name: "valid", |
| 30 | Data: []byte{ |
| 31 | // v=2, p=0, count=1, SR, len=7 |
| 32 | 0x81, 0xc8, 0x0, 0x7, |
| 33 | // ssrc=0x902f9e2e |
| 34 | 0x90, 0x2f, 0x9e, 0x2e, |
| 35 | // ntp=0xda8bd1fcdddda05a |
| 36 | 0xda, 0x8b, 0xd1, 0xfc, |
| 37 | 0xdd, 0xdd, 0xa0, 0x5a, |
| 38 | // rtp=0xaaf4edd5 |
| 39 | 0xaa, 0xf4, 0xed, 0xd5, |
| 40 | // packetCount=1 |
| 41 | 0x00, 0x00, 0x00, 0x01, |
| 42 | // octetCount=2 |
| 43 | 0x00, 0x00, 0x00, 0x02, |
| 44 | // ssrc=0xbc5e9a40 |
| 45 | 0xbc, 0x5e, 0x9a, 0x40, |
| 46 | // fracLost=0, totalLost=0 |
| 47 | 0x0, 0x0, 0x0, 0x0, |
| 48 | // lastSeq=0x46e1 |
| 49 | 0x0, 0x0, 0x46, 0xe1, |
| 50 | // jitter=273 |
| 51 | 0x0, 0x0, 0x1, 0x11, |
| 52 | // lsr=0x9f36432 |
| 53 | 0x9, 0xf3, 0x64, 0x32, |
| 54 | // delay=150137 |
| 55 | 0x0, 0x2, 0x4a, 0x79, |
| 56 | }, |
| 57 | Want: SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#{ |
| 58 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#SSRC.: 0x902f9e2e, |
| 59 | NTPTimescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#NTPTime.: 0xda8bd1fcdddda05a, |
| 60 | RTPTimescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#RTPTime.: 0xaaf4edd5, |
| 61 | PacketCountscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#PacketCount.: 1, |
| 62 | OctetCountscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#OctetCount.: 2, |
| 63 | Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Reports.: []ReceptionReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#{{ |
| 64 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#SSRC.: 0xbc5e9a40, |
| 65 | FractionLostscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#FractionLost.: 0, |
| 66 | TotalLostscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#TotalLost.: 0, |
| 67 | LastSequenceNumberscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#LastSequenceNumber.: 0x46e1, |
| 68 | Jitterscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#Jitter.: 273, |
| 69 | LastSenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#LastSenderReport.: 0x9f36432, |
| 70 | Delayscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#Delay.: 150137, |
| 71 | }}, |
| 72 | }, |
| 73 | }, |
| 74 | { |
| 75 | Name: "wrong type", |
| 76 | Data: []byte{ |
| 77 | // v=2, p=0, count=1, RR, len=7 |
| 78 | 0x81, 0xc9, 0x0, 0x7, |
| 79 | // ssrc=0x902f9e2e |
| 80 | 0x90, 0x2f, 0x9e, 0x2e, |
| 81 | // ntp=0xda8bd1fcdddda05a |
| 82 | 0xda, 0x8b, 0xd1, 0xfc, |
| 83 | 0xdd, 0xdd, 0xa0, 0x5a, |
| 84 | // rtp=0xaaf4edd5 |
| 85 | 0xaa, 0xf4, 0xed, 0xd5, |
| 86 | // packetCount=1 |
| 87 | 0x00, 0x00, 0x00, 0x01, |
| 88 | // octetCount=2 |
| 89 | 0x00, 0x00, 0x00, 0x02, |
| 90 | // ssrc=0xbc5e9a40 |
| 91 | 0xbc, 0x5e, 0x9a, 0x40, |
| 92 | // fracLost=0, totalLost=0 |
| 93 | 0x0, 0x0, 0x0, 0x0, |
| 94 | // lastSeq=0x46e1 |
| 95 | 0x0, 0x0, 0x46, 0xe1, |
| 96 | // jitter=273 |
| 97 | 0x0, 0x0, 0x1, 0x11, |
| 98 | // lsr=0x9f36432 |
| 99 | 0x9, 0xf3, 0x64, 0x32, |
| 100 | // delay=150137 |
| 101 | 0x0, 0x2, 0x4a, 0x79, |
| 102 | }, |
| 103 | WantError: errWrongTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/errWrongType., |
| 104 | }, |
| 105 | { |
| 106 | Name: "bad count in header", |
| 107 | Data: []byte{ |
| 108 | // v=2, p=0, count=1, SR, len=7 |
| 109 | 0x82, 0xc8, 0x0, 0x7, |
| 110 | // ssrc=0x902f9e2e |
| 111 | 0x90, 0x2f, 0x9e, 0x2e, |
| 112 | // ntp=0xda8bd1fcdddda05a |
| 113 | 0xda, 0x8b, 0xd1, 0xfc, |
| 114 | 0xdd, 0xdd, 0xa0, 0x5a, |
| 115 | // rtp=0xaaf4edd5 |
| 116 | 0xaa, 0xf4, 0xed, 0xd5, |
| 117 | // packetCount=1 |
| 118 | 0x00, 0x00, 0x00, 0x01, |
| 119 | // octetCount=2 |
| 120 | 0x00, 0x00, 0x00, 0x02, |
| 121 | // ssrc=0xbc5e9a40 |
| 122 | 0xbc, 0x5e, 0x9a, 0x40, |
| 123 | // fracLost=0, totalLost=0 |
| 124 | 0x0, 0x0, 0x0, 0x0, |
| 125 | // lastSeq=0x46e1 |
| 126 | 0x0, 0x0, 0x46, 0xe1, |
| 127 | // jitter=273 |
| 128 | 0x0, 0x0, 0x1, 0x11, |
| 129 | // lsr=0x9f36432 |
| 130 | 0x9, 0xf3, 0x64, 0x32, |
| 131 | // delay=150137 |
| 132 | 0x0, 0x2, 0x4a, 0x79, |
| 133 | }, |
| 134 | WantError: errPacketTooShortscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/errPacketTooShort., |
| 135 | }, |
| 136 | { |
| 137 | Name: "with extension", // issue #447 |
| 138 | Data: []byte{ |
| 139 | // v=2, p=0, count=0, SR, len=6 |
| 140 | 0x80, 0xc8, 0x0, 0x6, |
| 141 | // ssrc=0x2b7ec0c5 |
| 142 | 0x2b, 0x7e, 0xc0, 0xc5, |
| 143 | // ntp=0xe020a2a952a53fc0 |
| 144 | 0xe0, 0x20, 0xa2, 0xa9, |
| 145 | 0x52, 0xa5, 0x3f, 0xc0, |
| 146 | // rtp=0x2e48a552 |
| 147 | 0x2e, 0x48, 0xa5, 0x52, |
| 148 | // packetCount=70 |
| 149 | 0x0, 0x0, 0x0, 0x46, |
| 150 | // octetCount=4637 |
| 151 | 0x0, 0x0, 0x12, 0x1d, |
| 152 | // profile-specific extension |
| 153 | 0x81, 0xca, 0x0, 0x6, |
| 154 | 0x2b, 0x7e, 0xc0, 0xc5, |
| 155 | 0x1, 0x10, 0x4c, 0x63, |
| 156 | 0x49, 0x66, 0x7a, 0x58, |
| 157 | 0x6f, 0x6e, 0x44, 0x6f, |
| 158 | 0x72, 0x64, 0x53, 0x65, |
| 159 | 0x57, 0x36, 0x0, 0x0, |
| 160 | }, |
| 161 | Want: SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#{ |
| 162 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#SSRC.: 0x2b7ec0c5, |
| 163 | NTPTimescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#NTPTime.: 0xe020a2a952a53fc0, |
| 164 | RTPTimescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#RTPTime.: 0x2e48a552, |
| 165 | PacketCountscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#PacketCount.: 70, |
| 166 | OctetCountscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#OctetCount.: 4637, |
| 167 | ProfileExtensionsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#ProfileExtensions.: []byte{ |
| 168 | 0x81, 0xca, 0x0, 0x6, |
| 169 | 0x2b, 0x7e, 0xc0, 0xc5, |
| 170 | 0x1, 0x10, 0x4c, 0x63, |
| 171 | 0x49, 0x66, 0x7a, 0x58, |
| 172 | 0x6f, 0x6e, 0x44, 0x6f, |
| 173 | 0x72, 0x64, 0x53, 0x65, |
| 174 | 0x57, 0x36, 0x0, 0x0, |
| 175 | }, |
| 176 | }, |
| 177 | WantError: nil, |
| 178 | }, |
| 179 | } { |
| 180 | var sr SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport# |
| 181 | err := sr.Unmarshalscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Unmarshal().(test.Data) |
| 182 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.ErrorIsfscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/ErrorIsf().(t, err, test.WantError, "Unmarshal %q sr", test.Name) |
| 183 | if err != nil { |
| 184 | continue |
| 185 | } |
| 186 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalfscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equalf().(t, test.Want, sr, "Unmarshal %q sr", test.Name) |
| 187 | |
| 188 | var ssrcFound bool |
| 189 | dstSsrc := sr.DestinationSSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#DestinationSSRC().() |
| 190 | if slicesscip-go gomod github.com/golang/go/src go1.24.0 slices/.Containsscip-go gomod github.com/golang/go/src go1.24.0 slices/Contains().(dstSsrc, sr.SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#SSRC.) { |
| 191 | ssrcFound = true |
| 192 | } |
| 193 | |
| 194 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truefscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Truef().(t, ssrcFound, "Unmarshal %q sr: sr's DestinationSSRC should include it's SSRC field", test.Name) |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | func TestSenderReportRoundTripscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/TestSenderReportRoundTrip().(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 199 | for _, test := range []struct { |
| 200 | Name string |
| 201 | Report SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport# |
| 202 | WantError error |
| 203 | }{ |
| 204 | { |
| 205 | Name: "valid", |
| 206 | Report: SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#{ |
| 207 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#SSRC.: 1, |
| 208 | NTPTimescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#NTPTime.: 999, |
| 209 | RTPTimescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#RTPTime.: 555, |
| 210 | PacketCountscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#PacketCount.: 32, |
| 211 | OctetCountscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#OctetCount.: 11, |
| 212 | Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Reports.: []ReceptionReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#{ |
| 213 | { |
| 214 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#SSRC.: 2, |
| 215 | FractionLostscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#FractionLost.: 2, |
| 216 | TotalLostscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#TotalLost.: 3, |
| 217 | LastSequenceNumberscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#LastSequenceNumber.: 4, |
| 218 | Jitterscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#Jitter.: 5, |
| 219 | LastSenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#LastSenderReport.: 6, |
| 220 | Delayscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#Delay.: 7, |
| 221 | }, |
| 222 | { |
| 223 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#SSRC.: 0, |
| 224 | }, |
| 225 | }, |
| 226 | }, |
| 227 | }, |
| 228 | { |
| 229 | Name: "also valid", |
| 230 | Report: SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#{ |
| 231 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#SSRC.: 2, |
| 232 | Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Reports.: []ReceptionReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#{ |
| 233 | { |
| 234 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#SSRC.: 999, |
| 235 | FractionLostscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#FractionLost.: 30, |
| 236 | TotalLostscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#TotalLost.: 12345, |
| 237 | LastSequenceNumberscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#LastSequenceNumber.: 99, |
| 238 | Jitterscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#Jitter.: 22, |
| 239 | LastSenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#LastSenderReport.: 92, |
| 240 | Delayscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#Delay.: 46, |
| 241 | }, |
| 242 | }, |
| 243 | }, |
| 244 | }, |
| 245 | { |
| 246 | Name: "extension", |
| 247 | Report: SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#{ |
| 248 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#SSRC.: 2, |
| 249 | Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Reports.: []ReceptionReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#{ |
| 250 | { |
| 251 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#SSRC.: 999, |
| 252 | FractionLostscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#FractionLost.: 30, |
| 253 | TotalLostscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#TotalLost.: 12345, |
| 254 | LastSequenceNumberscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#LastSequenceNumber.: 99, |
| 255 | Jitterscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#Jitter.: 22, |
| 256 | LastSenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#LastSenderReport.: 92, |
| 257 | Delayscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#Delay.: 46, |
| 258 | }, |
| 259 | }, |
| 260 | ProfileExtensionsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#ProfileExtensions.: []byte{1, 2, 3, 4}, |
| 261 | }, |
| 262 | }, |
| 263 | { |
| 264 | Name: "count overflow", |
| 265 | Report: SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#{ |
| 266 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#SSRC.: 1, |
| 267 | Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Reports.: tooManyReportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/tooManyReports().(), |
| 268 | }, |
| 269 | WantError: errTooManyReportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/errTooManyReports., |
| 270 | }, |
| 271 | } { |
| 272 | data, err := test.Report.Marshalscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Marshal().() |
| 273 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.ErrorIsfscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/ErrorIsf().(t, err, test.WantError, "Marshal %q", test.Name) |
| 274 | if err != nil { |
| 275 | continue |
| 276 | } |
| 277 | |
| 278 | var decoded SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport# |
| 279 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NoErrorfscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NoErrorf().(t, decoded.Unmarshalscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Unmarshal().(data), "Unmarshal %q", test.Name) |
| 280 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalfscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equalf().(t, test.Report, decoded, "%q sr round trip", test.Name) |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | func TestSenderReportRoundTripMaxLengthscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/TestSenderReportRoundTripMaxLength().(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 285 | report := SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#{ |
| 286 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#SSRC.: 1, |
| 287 | NTPTimescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#NTPTime.: 2, |
| 288 | RTPTimescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#RTPTime.: 3, |
| 289 | PacketCountscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#PacketCount.: 4, |
| 290 | OctetCountscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#OctetCount.: 5, |
| 291 | Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Reports.: make([]ReceptionReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#, countMaxscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/countMax.), |
| 292 | } |
| 293 | |
| 294 | for i := range report.Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Reports. { |
| 295 | report.Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Reports.[i] = ReceptionReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#{SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceptionReport#SSRC.: uint32(i + 1)} |
| 296 | } |
| 297 | |
| 298 | baseSize := report.MarshalSizescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#MarshalSize().() |
| 299 | report.ProfileExtensionsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#ProfileExtensions. = bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Repeatscip-go gomod github.com/golang/go/src go1.24.0 bytes/Repeat().([]byte{0xab}, 4*(0xFFFF+1)-baseSize) |
| 300 | |
| 301 | data, err := report.Marshalscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Marshal().() |
| 302 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NoError().(t, err) |
| 303 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, data, 4*(0xFFFF+1)) |
| 304 | |
| 305 | var decoded SenderReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport# |
| 306 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NoError().(t, decoded.Unmarshalscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/SenderReport#Unmarshal().(data)) |
| 307 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, report, decoded) |
| 308 | } |