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

Side by Side Diff: webrtc/video/replay.cc

Issue 2621163006: replay: output rtp header elements for errors (Closed)
Patch Set: output more header elements Created 3 years, 11 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 break; 289 break;
290 case PacketReceiver::DELIVERY_UNKNOWN_SSRC: { 290 case PacketReceiver::DELIVERY_UNKNOWN_SSRC: {
291 RTPHeader header; 291 RTPHeader header;
292 std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create()); 292 std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
293 parser->Parse(packet.data, packet.length, &header); 293 parser->Parse(packet.data, packet.length, &header);
294 if (unknown_packets[header.ssrc] == 0) 294 if (unknown_packets[header.ssrc] == 0)
295 fprintf(stderr, "Unknown SSRC: %u!\n", header.ssrc); 295 fprintf(stderr, "Unknown SSRC: %u!\n", header.ssrc);
296 ++unknown_packets[header.ssrc]; 296 ++unknown_packets[header.ssrc];
297 break; 297 break;
298 } 298 }
299 case PacketReceiver::DELIVERY_PACKET_ERROR: 299 case PacketReceiver::DELIVERY_PACKET_ERROR: {
300 fprintf(stderr, "Packet error, corrupt packets or incorrect setup?\n"); 300 fprintf(stderr, "Packet error, corrupt packets or incorrect setup?\n");
301 RTPHeader header;
302 std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
303 parser->Parse(packet.data, packet.length, &header);
304 fprintf(stderr, "Packet len=%ld pt=%u seq=%u ts=%u ssrc=0x%8x\n",
305 packet.length, header.payloadType, header.sequenceNumber,
306 header.timestamp, header.ssrc);
301 break; 307 break;
308 }
302 } 309 }
303 if (last_time_ms != 0 && last_time_ms != packet.time_ms) { 310 if (last_time_ms != 0 && last_time_ms != packet.time_ms) {
304 SleepMs(packet.time_ms - last_time_ms); 311 SleepMs(packet.time_ms - last_time_ms);
305 } 312 }
306 last_time_ms = packet.time_ms; 313 last_time_ms = packet.time_ms;
307 } 314 }
308 fprintf(stderr, "num_packets: %d\n", num_packets); 315 fprintf(stderr, "num_packets: %d\n", num_packets);
309 316
310 for (std::map<uint32_t, int>::const_iterator it = unknown_packets.begin(); 317 for (std::map<uint32_t, int>::const_iterator it = unknown_packets.begin();
311 it != unknown_packets.end(); 318 it != unknown_packets.end();
312 ++it) { 319 ++it) {
313 fprintf( 320 fprintf(
314 stderr, "Packets for unknown ssrc '%u': %d\n", it->first, it->second); 321 stderr, "Packets for unknown ssrc '%u': %d\n", it->first, it->second);
315 } 322 }
316 323
317 call->DestroyVideoReceiveStream(receive_stream); 324 call->DestroyVideoReceiveStream(receive_stream);
318 325
319 delete decoder.decoder; 326 delete decoder.decoder;
320 } 327 }
321 } // namespace webrtc 328 } // namespace webrtc
322 329
323 int main(int argc, char* argv[]) { 330 int main(int argc, char* argv[]) {
324 ::testing::InitGoogleTest(&argc, argv); 331 ::testing::InitGoogleTest(&argc, argv);
325 google::ParseCommandLineFlags(&argc, &argv, true); 332 google::ParseCommandLineFlags(&argc, &argv, true);
326 333
327 webrtc::test::RunTest(webrtc::RtpReplay); 334 webrtc::test::RunTest(webrtc::RtpReplay);
328 return 0; 335 return 0;
329 } 336 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698