| 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 | "fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/" |
| 8 | "testingscip-go gomod github.com/golang/go/src go1.24.0 testing/" |
| 9 | |
| 10 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/" |
| 11 | ) |
| 12 | |
| 13 | // Assert that ExtendedReport is a Packet. |
| 14 | var _ Packetscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Packet# = (*ExtendedReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#)(nil) |
| 15 | |
| 16 | // Assert that all the extended report blocks implement the interface. |
| 17 | var ( |
| 18 | _ ReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock# = (*LossRLEReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/LossRLEReportBlock#)(nil) |
| 19 | _ ReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock# = (*DuplicateRLEReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DuplicateRLEReportBlock#)(nil) |
| 20 | _ ReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock# = (*PacketReceiptTimesReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/PacketReceiptTimesReportBlock#)(nil) |
| 21 | _ ReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock# = (*ReceiverReferenceTimeReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceiverReferenceTimeReportBlock#)(nil) |
| 22 | _ ReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock# = (*DLRRReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReportBlock#)(nil) |
| 23 | _ ReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock# = (*StatisticsSummaryReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/StatisticsSummaryReportBlock#)(nil) |
| 24 | _ ReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock# = (*VoIPMetricsReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/VoIPMetricsReportBlock#)(nil) |
| 25 | _ ReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock# = (*UnknownReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/UnknownReportBlock#)(nil) |
| 26 | ) |
| 27 | |
| 28 | func testPacketscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/testPacket().() Packetscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Packet# { |
| 29 | return &ExtendedReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#{ |
| 30 | SenderSSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#SenderSSRC.: 0x01020304, |
| 31 | Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#Reports.: []ReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock#{ |
| 32 | &LossRLEReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/LossRLEReportBlock#{ |
| 33 | XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#XRHeader.: XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#{ |
| 34 | BlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#BlockType.: LossRLEReportBlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/LossRLEReportBlockType., |
| 35 | }, |
| 36 | Tscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#T.: 12, |
| 37 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#SSRC.: 0x12345689, |
| 38 | BeginSeqscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#BeginSeq.: 5, |
| 39 | EndSeqscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#EndSeq.: 12, |
| 40 | Chunksscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#Chunks.: []Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#{ |
| 41 | Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#(0x4006), |
| 42 | Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#(0x0006), |
| 43 | Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#(0x8765), |
| 44 | Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#(0x0000), |
| 45 | }, |
| 46 | }, |
| 47 | &DuplicateRLEReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DuplicateRLEReportBlock#{ |
| 48 | XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#XRHeader.: XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#{ |
| 49 | BlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#BlockType.: DuplicateRLEReportBlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DuplicateRLEReportBlockType., |
| 50 | }, |
| 51 | Tscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#T.: 6, |
| 52 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#SSRC.: 0x12345689, |
| 53 | BeginSeqscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#BeginSeq.: 5, |
| 54 | EndSeqscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#EndSeq.: 12, |
| 55 | Chunksscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/rleReportBlock#Chunks.: []Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#{ |
| 56 | Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#(0x4123), |
| 57 | Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#(0x3FFF), |
| 58 | Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#(0xFFFF), |
| 59 | Chunkscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Chunk#(0x0000), |
| 60 | }, |
| 61 | }, |
| 62 | &PacketReceiptTimesReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/PacketReceiptTimesReportBlock#{ |
| 63 | XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/PacketReceiptTimesReportBlock#XRHeader.: XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#{ |
| 64 | BlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#BlockType.: PacketReceiptTimesReportBlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/PacketReceiptTimesReportBlockType., |
| 65 | }, |
| 66 | Tscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/PacketReceiptTimesReportBlock#T.: 3, |
| 67 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/PacketReceiptTimesReportBlock#SSRC.: 0x98765432, |
| 68 | BeginSeqscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/PacketReceiptTimesReportBlock#BeginSeq.: 15432, |
| 69 | EndSeqscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/PacketReceiptTimesReportBlock#EndSeq.: 15577, |
| 70 | ReceiptTimescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/PacketReceiptTimesReportBlock#ReceiptTime.: []uint32{ |
| 71 | 0x11111111, |
| 72 | 0x22222222, |
| 73 | 0x33333333, |
| 74 | 0x44444444, |
| 75 | 0x55555555, |
| 76 | }, |
| 77 | }, |
| 78 | &ReceiverReferenceTimeReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceiverReferenceTimeReportBlock#{ |
| 79 | XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceiverReferenceTimeReportBlock#XRHeader.: XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#{ |
| 80 | BlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#BlockType.: ReceiverReferenceTimeReportBlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceiverReferenceTimeReportBlockType., |
| 81 | }, |
| 82 | NTPTimestampscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReceiverReferenceTimeReportBlock#NTPTimestamp.: 0x0102030405060708, |
| 83 | }, |
| 84 | &DLRRReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReportBlock#{ |
| 85 | XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReportBlock#XRHeader.: XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#{ |
| 86 | BlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#BlockType.: DLRRReportBlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReportBlockType., |
| 87 | }, |
| 88 | Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReportBlock#Reports.: []DLRRReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#{ |
| 89 | { |
| 90 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#SSRC.: 0x88888888, |
| 91 | LastRRscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#LastRR.: 0x12345678, |
| 92 | DLRRscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#DLRR.: 0x99999999, |
| 93 | }, |
| 94 | { |
| 95 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#SSRC.: 0x09090909, |
| 96 | LastRRscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#LastRR.: 0x12345678, |
| 97 | DLRRscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#DLRR.: 0x99999999, |
| 98 | }, |
| 99 | { |
| 100 | SSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#SSRC.: 0x11223344, |
| 101 | LastRRscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#LastRR.: 0x12345678, |
| 102 | DLRRscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/DLRRReport#DLRR.: 0x99999999, |
| 103 | }, |
| 104 | }, |
| 105 | }, |
| 106 | &StatisticsSummaryReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/StatisticsSummaryReportBlock#{ |
| 107 | XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#{ |
| 108 | BlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#BlockType.: StatisticsSummaryReportBlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/StatisticsSummaryReportBlockType., |
| 109 | }, |
| 110 | true, true, true, ToHIPv4scip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ToHIPv4., |
| 111 | 0xFEDCBA98, |
| 112 | 0x1234, 0x5678, |
| 113 | 0x11111111, |
| 114 | 0x22222222, |
| 115 | 0x33333333, |
| 116 | 0x44444444, |
| 117 | 0x55555555, |
| 118 | 0x66666666, |
| 119 | 0x01, 0x02, 0x03, 0x04, |
| 120 | }, |
| 121 | &VoIPMetricsReportBlockscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/VoIPMetricsReportBlock#{ |
| 122 | XRHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#{ |
| 123 | BlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/XRHeader#BlockType.: VoIPMetricsReportBlockTypescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/VoIPMetricsReportBlockType., |
| 124 | }, |
| 125 | 0x89ABCDEF, |
| 126 | 0x05, 0x06, 0x07, 0x08, |
| 127 | 0x1111, 0x2222, 0x3333, 0x4444, |
| 128 | 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, |
| 129 | 0x00, |
| 130 | 0x1122, 0x3344, 0x5566, |
| 131 | }, |
| 132 | }, |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | func encodedPacketscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/encodedPacket().() []byte { |
| 137 | return []byte{ |
| 138 | // RTP Header |
| 139 | 0x80, 0xCF, 0x00, 0x33, // byte 0 - 3 |
| 140 | // Sender SSRC |
| 141 | 0x01, 0x02, 0x03, 0x04, |
| 142 | // Loss RLE Report Block |
| 143 | 0x01, 0x0C, 0x00, 0x04, // byte 8 - 11 |
| 144 | // Source SSRC |
| 145 | 0x12, 0x34, 0x56, 0x89, |
| 146 | // Begin & End Seq |
| 147 | 0x00, 0x05, 0x00, 0x0C, // byte 16 - 19 |
| 148 | // Chunks |
| 149 | 0x40, 0x06, 0x00, 0x06, |
| 150 | 0x87, 0x65, 0x00, 0x00, // byte 24 - 27 |
| 151 | // Duplicate RLE Report Block |
| 152 | 0x02, 0x06, 0x00, 0x04, |
| 153 | // Source SSRC |
| 154 | 0x12, 0x34, 0x56, 0x89, // byte 32 - 35 |
| 155 | // Begin & End Seq |
| 156 | 0x00, 0x05, 0x00, 0x0C, |
| 157 | // Chunks |
| 158 | 0x41, 0x23, 0x3F, 0xFF, // byte 40 - 43 |
| 159 | 0xFF, 0xFF, 0x00, 0x00, |
| 160 | // Packet Receipt Times Report Block |
| 161 | 0x03, 0x03, 0x00, 0x07, // byte 48 - 51 |
| 162 | // Source SSRC |
| 163 | 0x98, 0x76, 0x54, 0x32, |
| 164 | // Begin & End Seq |
| 165 | 0x3C, 0x48, 0x3C, 0xD9, // byte 56 - 59 |
| 166 | // Receipt times |
| 167 | 0x11, 0x11, 0x11, 0x11, |
| 168 | 0x22, 0x22, 0x22, 0x22, // byte 64 - 67 |
| 169 | 0x33, 0x33, 0x33, 0x33, |
| 170 | 0x44, 0x44, 0x44, 0x44, // byte 72 - 75 |
| 171 | 0x55, 0x55, 0x55, 0x55, |
| 172 | // Receiver Reference Time Report |
| 173 | 0x04, 0x00, 0x00, 0x02, // byte 80 - 83 |
| 174 | // Timestamp |
| 175 | 0x01, 0x02, 0x03, 0x04, |
| 176 | 0x05, 0x06, 0x07, 0x08, // byte 88 - 91 |
| 177 | // DLRR Report |
| 178 | 0x05, 0x00, 0x00, 0x09, |
| 179 | // SSRC 1 |
| 180 | 0x88, 0x88, 0x88, 0x88, // byte 96 - 99 |
| 181 | // LastRR 1 |
| 182 | 0x12, 0x34, 0x56, 0x78, |
| 183 | // DLRR 1 |
| 184 | 0x99, 0x99, 0x99, 0x99, // byte 104 - 107 |
| 185 | // SSRC 2 |
| 186 | 0x09, 0x09, 0x09, 0x09, |
| 187 | // LastRR 2 |
| 188 | 0x12, 0x34, 0x56, 0x78, // byte 112 - 115 |
| 189 | // DLRR 2 |
| 190 | 0x99, 0x99, 0x99, 0x99, |
| 191 | // SSRC 3 |
| 192 | 0x11, 0x22, 0x33, 0x44, // byte 120 - 123 |
| 193 | // LastRR 3 |
| 194 | 0x12, 0x34, 0x56, 0x78, |
| 195 | // DLRR 3 |
| 196 | 0x99, 0x99, 0x99, 0x99, // byte 128 - 131 |
| 197 | // Statistics Summary Report |
| 198 | 0x06, 0xE8, 0x00, 0x09, |
| 199 | // SSRC |
| 200 | 0xFE, 0xDC, 0xBA, 0x98, // byte 136 - 139 |
| 201 | // Various statistics |
| 202 | 0x12, 0x34, 0x56, 0x78, |
| 203 | 0x11, 0x11, 0x11, 0x11, // byte 144 - 147 |
| 204 | 0x22, 0x22, 0x22, 0x22, |
| 205 | 0x33, 0x33, 0x33, 0x33, // byte 152 - 155 |
| 206 | 0x44, 0x44, 0x44, 0x44, |
| 207 | 0x55, 0x55, 0x55, 0x55, // byte 160 - 163 |
| 208 | 0x66, 0x66, 0x66, 0x66, |
| 209 | 0x01, 0x02, 0x03, 0x04, // byte 168 - 171 |
| 210 | // VoIP Metrics Report |
| 211 | 0x07, 0x00, 0x00, 0x08, |
| 212 | // SSRC |
| 213 | 0x89, 0xAB, 0xCD, 0xEF, // byte 176 - 179 |
| 214 | // Various statistics |
| 215 | 0x05, 0x06, 0x07, 0x08, |
| 216 | 0x11, 0x11, 0x22, 0x22, // byte 184 - 187 |
| 217 | 0x33, 0x33, 0x44, 0x44, |
| 218 | 0x11, 0x22, 0x33, 0x44, // byte 192 - 195 |
| 219 | 0x55, 0x66, 0x77, 0x88, |
| 220 | 0x99, 0x00, 0x11, 0x22, // byte 200 - 203 |
| 221 | 0x33, 0x44, 0x55, 0x66, // byte 204 - 207 |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | func TestEncodescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/TestEncode().(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#) { |
| 226 | expected := encodedPacketscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/encodedPacket().() |
| 227 | packet := testPacketscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/testPacket().() |
| 228 | rawPacket, err := packet.Marshalscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/Packet#Marshal.() |
| 229 | 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) |
| 230 | 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, len(expected), len(rawPacket), "Encoded message length does not match expected length") |
| 231 | |
| 232 | for i := range rawPacket { |
| 233 | 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, expected[i], rawPacket[i], "Byte %d of encoded packet does not match", i) |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | func TestDecodescip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/TestDecode().(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#) { |
| 238 | encoded := encodedPacketscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/encodedPacket().() |
| 239 | expected := testPacketscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/testPacket().() |
| 240 | |
| 241 | // We need to make sure the header has been set up correctly |
| 242 | // before we test for equality |
| 243 | extendedReports, ok := expected.(*ExtendedReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#) |
| 244 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 245 | |
| 246 | for _, p := range extendedReports.Reportsscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#Reports. { |
| 247 | p.setupBlockHeaderscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ReportBlock#setupBlockHeader.() |
| 248 | } |
| 249 | |
| 250 | report := new(ExtendedReportscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#) |
| 251 | err := report.Unmarshalscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#Unmarshal().(encoded) |
| 252 | 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) |
| 253 | 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, expected, report) |
| 254 | |
| 255 | pktStringer, ok := expected.(fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Stringerscip-go gomod github.com/golang/go/src go1.24.0 fmt/Stringer#) |
| 256 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, ok) |
| 257 | 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.Stringscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#String().(), pktStringer.Stringscip-go gomod github.com/golang/go/src go1.24.0 fmt/Stringer#String().(), "Decoded packet does not match expected packet") |
| 258 | |
| 259 | var includeSenderSSRC bool |
| 260 | for _, ssrc := range report.DestinationSSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#DestinationSSRC().() { |
| 261 | if ssrc == report.SenderSSRCscip-go gomod github.com/pion/rtcp . `github.com/pion/rtcp`/ExtendedReport#SenderSSRC. { |
| 262 | includeSenderSSRC = true |
| 263 | } |
| 264 | } |
| 265 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, includeSenderSSRC, "DestinationSSRC does not include the SenderSSRC") |
| 266 | } |