Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: webrtc/modules/audio_coding/neteq/red_payload_splitter_unittest.cc

Issue 2425223002: NetEq now works with packets as values, rather than pointers. (Closed)
Patch Set: Compare packets better in test. One more const. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // Last RED header: 68 // Last RED header:
69 // 0 1 2 3 4 5 6 7 69 // 0 1 2 3 4 5 6 7
70 // +-+-+-+-+-+-+-+-+ 70 // +-+-+-+-+-+-+-+-+
71 // |0| Block PT | 71 // |0| Block PT |
72 // +-+-+-+-+-+-+-+-+ 72 // +-+-+-+-+-+-+-+-+
73 73
74 // Creates a RED packet, with |num_payloads| payloads, with payload types given 74 // Creates a RED packet, with |num_payloads| payloads, with payload types given
75 // by the values in array |payload_types| (which must be of length 75 // by the values in array |payload_types| (which must be of length
76 // |num_payloads|). Each redundant payload is |timestamp_offset| samples 76 // |num_payloads|). Each redundant payload is |timestamp_offset| samples
77 // "behind" the the previous payload. 77 // "behind" the the previous payload.
78 Packet* CreateRedPayload(size_t num_payloads, 78 Packet CreateRedPayload(size_t num_payloads,
79 uint8_t* payload_types, 79 uint8_t* payload_types,
80 int timestamp_offset, 80 int timestamp_offset,
81 bool embed_opus_fec = false) { 81 bool embed_opus_fec = false) {
82 Packet* packet = new Packet; 82 Packet packet;
83 packet->payload_type = kRedPayloadType; 83 packet.payload_type = kRedPayloadType;
84 packet->timestamp = kBaseTimestamp; 84 packet.timestamp = kBaseTimestamp;
85 packet->sequence_number = kSequenceNumber; 85 packet.sequence_number = kSequenceNumber;
86 packet->payload.SetSize((kPayloadLength + 1) + 86 packet.payload.SetSize((kPayloadLength + 1) +
87 (num_payloads - 1) * 87 (num_payloads - 1) *
88 (kPayloadLength + kRedHeaderLength)); 88 (kPayloadLength + kRedHeaderLength));
89 uint8_t* payload_ptr = packet->payload.data(); 89 uint8_t* payload_ptr = packet.payload.data();
90 for (size_t i = 0; i < num_payloads; ++i) { 90 for (size_t i = 0; i < num_payloads; ++i) {
91 // Write the RED headers. 91 // Write the RED headers.
92 if (i == num_payloads - 1) { 92 if (i == num_payloads - 1) {
93 // Special case for last payload. 93 // Special case for last payload.
94 *payload_ptr = payload_types[i] & 0x7F; // F = 0; 94 *payload_ptr = payload_types[i] & 0x7F; // F = 0;
95 ++payload_ptr; 95 ++payload_ptr;
96 break; 96 break;
97 } 97 }
98 *payload_ptr = payload_types[i] & 0x7F; 98 *payload_ptr = payload_types[i] & 0x7F;
99 // Not the last block; set F = 1. 99 // Not the last block; set F = 1.
(...skipping 15 matching lines...) Expand all
115 static_cast<uint8_t>(i)); 115 static_cast<uint8_t>(i));
116 } else { 116 } else {
117 memset(payload_ptr, static_cast<int>(i), kPayloadLength); 117 memset(payload_ptr, static_cast<int>(i), kPayloadLength);
118 } 118 }
119 payload_ptr += kPayloadLength; 119 payload_ptr += kPayloadLength;
120 } 120 }
121 return packet; 121 return packet;
122 } 122 }
123 123
124 // Create a packet with all payload bytes set to |payload_value|. 124 // Create a packet with all payload bytes set to |payload_value|.
125 Packet* CreatePacket(uint8_t payload_type, 125 Packet CreatePacket(uint8_t payload_type,
126 size_t payload_length, 126 size_t payload_length,
127 uint8_t payload_value, 127 uint8_t payload_value,
128 bool opus_fec = false) { 128 bool opus_fec = false) {
129 Packet* packet = new Packet; 129 Packet packet;
130 packet->payload_type = payload_type; 130 packet.payload_type = payload_type;
131 packet->timestamp = kBaseTimestamp; 131 packet.timestamp = kBaseTimestamp;
132 packet->sequence_number = kSequenceNumber; 132 packet.sequence_number = kSequenceNumber;
133 packet->payload.SetSize(payload_length); 133 packet.payload.SetSize(payload_length);
134 if (opus_fec) { 134 if (opus_fec) {
135 CreateOpusFecPayload(packet->payload.data(), packet->payload.size(), 135 CreateOpusFecPayload(packet.payload.data(), packet.payload.size(),
136 payload_value); 136 payload_value);
137 } else { 137 } else {
138 memset(packet->payload.data(), payload_value, packet->payload.size()); 138 memset(packet.payload.data(), payload_value, packet.payload.size());
139 } 139 }
140 return packet; 140 return packet;
141 } 141 }
142 142
143 // Checks that |packet| has the attributes given in the remaining parameters. 143 // Checks that |packet| has the attributes given in the remaining parameters.
144 void VerifyPacket(const Packet* packet, 144 void VerifyPacket(const Packet& packet,
145 size_t payload_length, 145 size_t payload_length,
146 uint8_t payload_type, 146 uint8_t payload_type,
147 uint16_t sequence_number, 147 uint16_t sequence_number,
148 uint32_t timestamp, 148 uint32_t timestamp,
149 uint8_t payload_value, 149 uint8_t payload_value,
150 Packet::Priority priority) { 150 Packet::Priority priority) {
151 EXPECT_EQ(payload_length, packet->payload.size()); 151 EXPECT_EQ(payload_length, packet.payload.size());
152 EXPECT_EQ(payload_type, packet->payload_type); 152 EXPECT_EQ(payload_type, packet.payload_type);
153 EXPECT_EQ(sequence_number, packet->sequence_number); 153 EXPECT_EQ(sequence_number, packet.sequence_number);
154 EXPECT_EQ(timestamp, packet->timestamp); 154 EXPECT_EQ(timestamp, packet.timestamp);
155 EXPECT_EQ(priority, packet->priority); 155 EXPECT_EQ(priority, packet.priority);
156 ASSERT_FALSE(packet->payload.empty()); 156 ASSERT_FALSE(packet.payload.empty());
157 for (size_t i = 0; i < packet->payload.size(); ++i) { 157 for (size_t i = 0; i < packet.payload.size(); ++i) {
158 ASSERT_EQ(payload_value, packet->payload.data()[i]); 158 ASSERT_EQ(payload_value, packet.payload.data()[i]);
159 } 159 }
160 } 160 }
161 161
162 void VerifyPacket(const Packet* packet, 162 void VerifyPacket(const Packet& packet,
163 size_t payload_length, 163 size_t payload_length,
164 uint8_t payload_type, 164 uint8_t payload_type,
165 uint16_t sequence_number, 165 uint16_t sequence_number,
166 uint32_t timestamp, 166 uint32_t timestamp,
167 uint8_t payload_value, 167 uint8_t payload_value,
168 bool primary) { 168 bool primary) {
169 return VerifyPacket(packet, payload_length, payload_type, sequence_number, 169 return VerifyPacket(packet, payload_length, payload_type, sequence_number,
170 timestamp, payload_value, 170 timestamp, payload_value,
171 Packet::Priority{0, primary ? 0 : 1}); 171 Packet::Priority{0, primary ? 0 : 1});
172 } 172 }
173 173
174 // Start of test definitions. 174 // Start of test definitions.
175 175
176 TEST(RedPayloadSplitter, CreateAndDestroy) { 176 TEST(RedPayloadSplitter, CreateAndDestroy) {
177 RedPayloadSplitter* splitter = new RedPayloadSplitter; 177 RedPayloadSplitter* splitter = new RedPayloadSplitter;
178 delete splitter; 178 delete splitter;
179 } 179 }
180 180
181 // Packet A is split into A1 and A2. 181 // Packet A is split into A1 and A2.
182 TEST(RedPayloadSplitter, OnePacketTwoPayloads) { 182 TEST(RedPayloadSplitter, OnePacketTwoPayloads) {
183 uint8_t payload_types[] = {0, 0}; 183 uint8_t payload_types[] = {0, 0};
184 const int kTimestampOffset = 160; 184 const int kTimestampOffset = 160;
185 Packet* packet = CreateRedPayload(2, payload_types, kTimestampOffset);
186 PacketList packet_list; 185 PacketList packet_list;
187 packet_list.push_back(packet); 186 packet_list.push_back(CreateRedPayload(2, payload_types, kTimestampOffset));
188 RedPayloadSplitter splitter; 187 RedPayloadSplitter splitter;
189 EXPECT_TRUE(splitter.SplitRed(&packet_list)); 188 EXPECT_TRUE(splitter.SplitRed(&packet_list));
190 ASSERT_EQ(2u, packet_list.size()); 189 ASSERT_EQ(2u, packet_list.size());
191 // Check first packet. The first in list should always be the primary payload. 190 // Check first packet. The first in list should always be the primary payload.
192 packet = packet_list.front(); 191 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[1],
193 VerifyPacket(packet, kPayloadLength, payload_types[1], kSequenceNumber, 192 kSequenceNumber, kBaseTimestamp, 1, true);
194 kBaseTimestamp, 1, true);
195 delete packet;
196 packet_list.pop_front(); 193 packet_list.pop_front();
197 // Check second packet. 194 // Check second packet.
198 packet = packet_list.front(); 195 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[0],
199 VerifyPacket(packet, kPayloadLength, payload_types[0], kSequenceNumber, 196 kSequenceNumber, kBaseTimestamp - kTimestampOffset, 0, false);
200 kBaseTimestamp - kTimestampOffset, 0, false);
201 delete packet;
202 } 197 }
203 198
204 // Packets A and B are not split at all. Only the RED header in each packet is 199 // Packets A and B are not split at all. Only the RED header in each packet is
205 // removed. 200 // removed.
206 TEST(RedPayloadSplitter, TwoPacketsOnePayload) { 201 TEST(RedPayloadSplitter, TwoPacketsOnePayload) {
207 uint8_t payload_types[] = {0}; 202 uint8_t payload_types[] = {0};
208 const int kTimestampOffset = 160; 203 const int kTimestampOffset = 160;
209 // Create first packet, with a single RED payload. 204 // Create first packet, with a single RED payload.
210 Packet* packet = CreateRedPayload(1, payload_types, kTimestampOffset);
211 PacketList packet_list; 205 PacketList packet_list;
212 packet_list.push_back(packet); 206 packet_list.push_back(CreateRedPayload(1, payload_types, kTimestampOffset));
213 // Create second packet, with a single RED payload. 207 // Create second packet, with a single RED payload.
214 packet = CreateRedPayload(1, payload_types, kTimestampOffset); 208 {
215 // Manually change timestamp and sequence number of second packet. 209 Packet packet = CreateRedPayload(1, payload_types, kTimestampOffset);
216 packet->timestamp += kTimestampOffset; 210 // Manually change timestamp and sequence number of second packet.
217 packet->sequence_number++; 211 packet.timestamp += kTimestampOffset;
218 packet_list.push_back(packet); 212 packet.sequence_number++;
213 packet_list.push_back(std::move(packet));
214 }
219 RedPayloadSplitter splitter; 215 RedPayloadSplitter splitter;
220 EXPECT_TRUE(splitter.SplitRed(&packet_list)); 216 EXPECT_TRUE(splitter.SplitRed(&packet_list));
221 ASSERT_EQ(2u, packet_list.size()); 217 ASSERT_EQ(2u, packet_list.size());
222 // Check first packet. 218 // Check first packet.
223 packet = packet_list.front(); 219 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[0],
224 VerifyPacket(packet, kPayloadLength, payload_types[0], kSequenceNumber, 220 kSequenceNumber, kBaseTimestamp, 0, true);
225 kBaseTimestamp, 0, true);
226 delete packet;
227 packet_list.pop_front(); 221 packet_list.pop_front();
228 // Check second packet. 222 // Check second packet.
229 packet = packet_list.front(); 223 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[0],
230 VerifyPacket(packet, kPayloadLength, payload_types[0], kSequenceNumber + 1, 224 kSequenceNumber + 1, kBaseTimestamp + kTimestampOffset, 0, true);
231 kBaseTimestamp + kTimestampOffset, 0, true);
232 delete packet;
233 } 225 }
234 226
235 // Packets A and B are split into packets A1, A2, A3, B1, B2, B3, with 227 // Packets A and B are split into packets A1, A2, A3, B1, B2, B3, with
236 // attributes as follows: 228 // attributes as follows:
237 // 229 //
238 // A1* A2 A3 B1* B2 B3 230 // A1* A2 A3 B1* B2 B3
239 // Payload type 0 1 2 0 1 2 231 // Payload type 0 1 2 0 1 2
240 // Timestamp b b-o b-2o b+o b b-o 232 // Timestamp b b-o b-2o b+o b b-o
241 // Sequence number 0 0 0 1 1 1 233 // Sequence number 0 0 0 1 1 1
242 // 234 //
243 // b = kBaseTimestamp, o = kTimestampOffset, * = primary. 235 // b = kBaseTimestamp, o = kTimestampOffset, * = primary.
244 TEST(RedPayloadSplitter, TwoPacketsThreePayloads) { 236 TEST(RedPayloadSplitter, TwoPacketsThreePayloads) {
245 uint8_t payload_types[] = {2, 1, 0}; // Primary is the last one. 237 uint8_t payload_types[] = {2, 1, 0}; // Primary is the last one.
246 const int kTimestampOffset = 160; 238 const int kTimestampOffset = 160;
247 // Create first packet, with 3 RED payloads. 239 // Create first packet, with 3 RED payloads.
248 Packet* packet = CreateRedPayload(3, payload_types, kTimestampOffset);
249 PacketList packet_list; 240 PacketList packet_list;
250 packet_list.push_back(packet); 241 packet_list.push_back(CreateRedPayload(3, payload_types, kTimestampOffset));
251 // Create first packet, with 3 RED payloads. 242 // Create first packet, with 3 RED payloads.
252 packet = CreateRedPayload(3, payload_types, kTimestampOffset); 243 {
253 // Manually change timestamp and sequence number of second packet. 244 Packet packet = CreateRedPayload(3, payload_types, kTimestampOffset);
254 packet->timestamp += kTimestampOffset; 245 // Manually change timestamp and sequence number of second packet.
255 packet->sequence_number++; 246 packet.timestamp += kTimestampOffset;
256 packet_list.push_back(packet); 247 packet.sequence_number++;
248 packet_list.push_back(std::move(packet));
249 }
257 RedPayloadSplitter splitter; 250 RedPayloadSplitter splitter;
258 EXPECT_TRUE(splitter.SplitRed(&packet_list)); 251 EXPECT_TRUE(splitter.SplitRed(&packet_list));
259 ASSERT_EQ(6u, packet_list.size()); 252 ASSERT_EQ(6u, packet_list.size());
260 // Check first packet, A1. 253 // Check first packet, A1.
261 packet = packet_list.front(); 254 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[2],
262 VerifyPacket(packet, kPayloadLength, payload_types[2], kSequenceNumber, 255 kSequenceNumber, kBaseTimestamp, 2, {0, 0});
263 kBaseTimestamp, 2, {0, 0});
264 delete packet;
265 packet_list.pop_front(); 256 packet_list.pop_front();
266 // Check second packet, A2. 257 // Check second packet, A2.
267 packet = packet_list.front(); 258 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[1],
268 VerifyPacket(packet, kPayloadLength, payload_types[1], kSequenceNumber, 259 kSequenceNumber, kBaseTimestamp - kTimestampOffset, 1, {0, 1});
269 kBaseTimestamp - kTimestampOffset, 1, {0, 1});
270 delete packet;
271 packet_list.pop_front(); 260 packet_list.pop_front();
272 // Check third packet, A3. 261 // Check third packet, A3.
273 packet = packet_list.front(); 262 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[0],
274 VerifyPacket(packet, kPayloadLength, payload_types[0], kSequenceNumber, 263 kSequenceNumber, kBaseTimestamp - 2 * kTimestampOffset, 0,
275 kBaseTimestamp - 2 * kTimestampOffset, 0, {0, 2}); 264 {0, 2});
276 delete packet;
277 packet_list.pop_front(); 265 packet_list.pop_front();
278 // Check fourth packet, B1. 266 // Check fourth packet, B1.
279 packet = packet_list.front(); 267 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[2],
280 VerifyPacket(packet, kPayloadLength, payload_types[2], kSequenceNumber + 1, 268 kSequenceNumber + 1, kBaseTimestamp + kTimestampOffset, 2,
281 kBaseTimestamp + kTimestampOffset, 2, {0, 0}); 269 {0, 0});
282 delete packet;
283 packet_list.pop_front(); 270 packet_list.pop_front();
284 // Check fifth packet, B2. 271 // Check fifth packet, B2.
285 packet = packet_list.front(); 272 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[1],
286 VerifyPacket(packet, kPayloadLength, payload_types[1], kSequenceNumber + 1, 273 kSequenceNumber + 1, kBaseTimestamp, 1, {0, 1});
287 kBaseTimestamp, 1, {0, 1});
288 delete packet;
289 packet_list.pop_front(); 274 packet_list.pop_front();
290 // Check sixth packet, B3. 275 // Check sixth packet, B3.
291 packet = packet_list.front(); 276 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[0],
292 VerifyPacket(packet, kPayloadLength, payload_types[0], kSequenceNumber + 1, 277 kSequenceNumber + 1, kBaseTimestamp - kTimestampOffset, 0,
293 kBaseTimestamp - kTimestampOffset, 0, {0, 2}); 278 {0, 2});
294 delete packet;
295 } 279 }
296 280
297 // Creates a list with 4 packets with these payload types: 281 // Creates a list with 4 packets with these payload types:
298 // 0 = CNGnb 282 // 0 = CNGnb
299 // 1 = PCMu 283 // 1 = PCMu
300 // 2 = DTMF (AVT) 284 // 2 = DTMF (AVT)
301 // 3 = iLBC 285 // 3 = iLBC
302 // We expect the method CheckRedPayloads to discard the iLBC packet, since it 286 // We expect the method CheckRedPayloads to discard the iLBC packet, since it
303 // is a non-CNG, non-DTMF payload of another type than the first speech payload 287 // is a non-CNG, non-DTMF payload of another type than the first speech payload
304 // found in the list (which is PCMu). 288 // found in the list (which is PCMu).
305 TEST(RedPayloadSplitter, CheckRedPayloads) { 289 TEST(RedPayloadSplitter, CheckRedPayloads) {
306 PacketList packet_list; 290 PacketList packet_list;
307 for (uint8_t i = 0; i <= 3; ++i) { 291 for (uint8_t i = 0; i <= 3; ++i) {
308 // Create packet with payload type |i|, payload length 10 bytes, all 0. 292 // Create packet with payload type |i|, payload length 10 bytes, all 0.
309 Packet* packet = CreatePacket(i, 10, 0); 293 packet_list.push_back(CreatePacket(i, 10, 0));
310 packet_list.push_back(packet);
311 } 294 }
312 295
313 // Use a real DecoderDatabase object here instead of a mock, since it is 296 // Use a real DecoderDatabase object here instead of a mock, since it is
314 // easier to just register the payload types and let the actual implementation 297 // easier to just register the payload types and let the actual implementation
315 // do its job. 298 // do its job.
316 DecoderDatabase decoder_database( 299 DecoderDatabase decoder_database(
317 new rtc::RefCountedObject<MockAudioDecoderFactory>); 300 new rtc::RefCountedObject<MockAudioDecoderFactory>);
318 decoder_database.RegisterPayload(0, NetEqDecoder::kDecoderCNGnb, "cng-nb"); 301 decoder_database.RegisterPayload(0, NetEqDecoder::kDecoderCNGnb, "cng-nb");
319 decoder_database.RegisterPayload(1, NetEqDecoder::kDecoderPCMu, "pcmu"); 302 decoder_database.RegisterPayload(1, NetEqDecoder::kDecoderPCMu, "pcmu");
320 decoder_database.RegisterPayload(2, NetEqDecoder::kDecoderAVT, "avt"); 303 decoder_database.RegisterPayload(2, NetEqDecoder::kDecoderAVT, "avt");
321 decoder_database.RegisterPayload(3, NetEqDecoder::kDecoderILBC, "ilbc"); 304 decoder_database.RegisterPayload(3, NetEqDecoder::kDecoderILBC, "ilbc");
322 305
323 RedPayloadSplitter splitter; 306 RedPayloadSplitter splitter;
324 splitter.CheckRedPayloads(&packet_list, decoder_database); 307 splitter.CheckRedPayloads(&packet_list, decoder_database);
325 308
326 ASSERT_EQ(3u, packet_list.size()); // Should have dropped the last packet. 309 ASSERT_EQ(3u, packet_list.size()); // Should have dropped the last packet.
327 // Verify packets. The loop verifies that payload types 0, 1, and 2 are in the 310 // Verify packets. The loop verifies that payload types 0, 1, and 2 are in the
328 // list. 311 // list.
329 for (int i = 0; i <= 2; ++i) { 312 for (int i = 0; i <= 2; ++i) {
330 Packet* packet = packet_list.front(); 313 VerifyPacket(packet_list.front(), 10, i, kSequenceNumber, kBaseTimestamp, 0,
331 VerifyPacket(packet, 10, i, kSequenceNumber, kBaseTimestamp, 0, true); 314 true);
332 delete packet;
333 packet_list.pop_front(); 315 packet_list.pop_front();
334 } 316 }
335 EXPECT_TRUE(packet_list.empty()); 317 EXPECT_TRUE(packet_list.empty());
336 } 318 }
337 319
338 // Packet A is split into A1, A2 and A3. But the length parameter is off, so 320 // Packet A is split into A1, A2 and A3. But the length parameter is off, so
339 // the last payloads should be discarded. 321 // the last payloads should be discarded.
340 TEST(RedPayloadSplitter, WrongPayloadLength) { 322 TEST(RedPayloadSplitter, WrongPayloadLength) {
341 uint8_t payload_types[] = {0, 0, 0}; 323 uint8_t payload_types[] = {0, 0, 0};
342 const int kTimestampOffset = 160; 324 const int kTimestampOffset = 160;
343 Packet* packet = CreateRedPayload(3, payload_types, kTimestampOffset);
344 // Manually tamper with the payload length of the packet.
345 // This is one byte too short for the second payload (out of three).
346 // We expect only the first payload to be returned.
347 packet->payload.SetSize(packet->payload.size() - (kPayloadLength + 1));
348 PacketList packet_list; 325 PacketList packet_list;
349 packet_list.push_back(packet); 326 {
327 Packet packet = CreateRedPayload(3, payload_types, kTimestampOffset);
328 // Manually tamper with the payload length of the packet.
329 // This is one byte too short for the second payload (out of three).
330 // We expect only the first payload to be returned.
331 packet.payload.SetSize(packet.payload.size() - (kPayloadLength + 1));
332 packet_list.push_back(std::move(packet));
333 }
350 RedPayloadSplitter splitter; 334 RedPayloadSplitter splitter;
351 EXPECT_FALSE(splitter.SplitRed(&packet_list)); 335 EXPECT_FALSE(splitter.SplitRed(&packet_list));
352 ASSERT_EQ(1u, packet_list.size()); 336 ASSERT_EQ(1u, packet_list.size());
353 // Check first packet. 337 // Check first packet.
354 packet = packet_list.front(); 338 VerifyPacket(packet_list.front(), kPayloadLength, payload_types[0],
355 VerifyPacket(packet, kPayloadLength, payload_types[0], kSequenceNumber, 339 kSequenceNumber, kBaseTimestamp - 2 * kTimestampOffset, 0,
356 kBaseTimestamp - 2 * kTimestampOffset, 0, {0, 2}); 340 {0, 2});
357 delete packet;
358 packet_list.pop_front(); 341 packet_list.pop_front();
359 } 342 }
360 343
361 } // namespace webrtc 344 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/red_payload_splitter.cc ('k') | webrtc/modules/audio_coding/neteq/timestamp_scaler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698