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

Side by Side Diff: webrtc/logging/rtc_event_log/rtc_event_log2text.cc

Issue 2912113002: Ensure the RtcEventLog parser is backwards compatible (Closed)
Patch Set: Created 3 years, 6 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 | webrtc/logging/rtc_event_log/rtc_event_log_parser.h » ('j') | 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) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 webrtc::ParsedRtcEventLog parsed_stream; 345 webrtc::ParsedRtcEventLog parsed_stream;
346 if (!parsed_stream.ParseFile(input_file)) { 346 if (!parsed_stream.ParseFile(input_file)) {
347 std::cerr << "Error while parsing input file: " << input_file << std::endl; 347 std::cerr << "Error while parsing input file: " << input_file << std::endl;
348 return -1; 348 return -1;
349 } 349 }
350 350
351 for (size_t i = 0; i < parsed_stream.GetNumberOfEvents(); i++) { 351 for (size_t i = 0; i < parsed_stream.GetNumberOfEvents(); i++) {
352 if (!FLAGS_noconfig && !FLAGS_novideo && !FLAGS_noincoming && 352 if (!FLAGS_noconfig && !FLAGS_novideo && !FLAGS_noincoming &&
353 parsed_stream.GetEventType(i) == 353 parsed_stream.GetEventType(i) ==
354 webrtc::ParsedRtcEventLog::VIDEO_RECEIVER_CONFIG_EVENT) { 354 webrtc::ParsedRtcEventLog::VIDEO_RECEIVER_CONFIG_EVENT) {
355 webrtc::rtclog::StreamConfig config; 355 webrtc::rtclog::StreamConfig config =
356 parsed_stream.GetVideoReceiveConfig(i, &config); 356 parsed_stream.GetVideoReceiveConfig(i);
357 std::cout << parsed_stream.GetTimestamp(i) << "\tVIDEO_RECV_CONFIG" 357 std::cout << parsed_stream.GetTimestamp(i) << "\tVIDEO_RECV_CONFIG"
358 << "\tssrc=" << config.remote_ssrc 358 << "\tssrc=" << config.remote_ssrc
359 << "\tfeedback_ssrc=" << config.local_ssrc << std::endl; 359 << "\tfeedback_ssrc=" << config.local_ssrc << std::endl;
360 } 360 }
361 if (!FLAGS_noconfig && !FLAGS_novideo && !FLAGS_nooutgoing && 361 if (!FLAGS_noconfig && !FLAGS_novideo && !FLAGS_nooutgoing &&
362 parsed_stream.GetEventType(i) == 362 parsed_stream.GetEventType(i) ==
363 webrtc::ParsedRtcEventLog::VIDEO_SENDER_CONFIG_EVENT) { 363 webrtc::ParsedRtcEventLog::VIDEO_SENDER_CONFIG_EVENT) {
364 webrtc::rtclog::StreamConfig config; 364 std::vector<webrtc::rtclog::StreamConfig> configs =
365 parsed_stream.GetVideoSendConfig(i, &config); 365 parsed_stream.GetVideoSendConfig(i);
366 for (size_t j = 0; j < configs.size(); j++) {
366 std::cout << parsed_stream.GetTimestamp(i) << "\tVIDEO_SEND_CONFIG"; 367 std::cout << parsed_stream.GetTimestamp(i) << "\tVIDEO_SEND_CONFIG";
367 std::cout << "\tssrcs=" << config.local_ssrc; 368 std::cout << "\tssrcs=" << configs[j].local_ssrc;
368 std::cout << "\trtx_ssrcs=" << config.rtx_ssrc; 369 std::cout << "\trtx_ssrcs=" << configs[j].rtx_ssrc;
369 std::cout << std::endl; 370 std::cout << std::endl;
371 }
370 } 372 }
371 if (!FLAGS_noconfig && !FLAGS_noaudio && !FLAGS_noincoming && 373 if (!FLAGS_noconfig && !FLAGS_noaudio && !FLAGS_noincoming &&
372 parsed_stream.GetEventType(i) == 374 parsed_stream.GetEventType(i) ==
373 webrtc::ParsedRtcEventLog::AUDIO_RECEIVER_CONFIG_EVENT) { 375 webrtc::ParsedRtcEventLog::AUDIO_RECEIVER_CONFIG_EVENT) {
374 webrtc::rtclog::StreamConfig config; 376 webrtc::rtclog::StreamConfig config =
375 parsed_stream.GetAudioReceiveConfig(i, &config); 377 parsed_stream.GetAudioReceiveConfig(i);
376 std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_RECV_CONFIG" 378 std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_RECV_CONFIG"
377 << "\tssrc=" << config.remote_ssrc 379 << "\tssrc=" << config.remote_ssrc
378 << "\tfeedback_ssrc=" << config.local_ssrc << std::endl; 380 << "\tfeedback_ssrc=" << config.local_ssrc << std::endl;
379 } 381 }
380 if (!FLAGS_noconfig && !FLAGS_noaudio && !FLAGS_nooutgoing && 382 if (!FLAGS_noconfig && !FLAGS_noaudio && !FLAGS_nooutgoing &&
381 parsed_stream.GetEventType(i) == 383 parsed_stream.GetEventType(i) ==
382 webrtc::ParsedRtcEventLog::AUDIO_SENDER_CONFIG_EVENT) { 384 webrtc::ParsedRtcEventLog::AUDIO_SENDER_CONFIG_EVENT) {
383 webrtc::rtclog::StreamConfig config; 385 webrtc::rtclog::StreamConfig config = parsed_stream.GetAudioSendConfig(i);
384 parsed_stream.GetAudioSendConfig(i, &config);
385 std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_SEND_CONFIG" 386 std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_SEND_CONFIG"
386 << "\tssrc=" << config.local_ssrc << std::endl; 387 << "\tssrc=" << config.local_ssrc << std::endl;
387 } 388 }
388 if (!FLAGS_nortp && 389 if (!FLAGS_nortp &&
389 parsed_stream.GetEventType(i) == webrtc::ParsedRtcEventLog::RTP_EVENT) { 390 parsed_stream.GetEventType(i) == webrtc::ParsedRtcEventLog::RTP_EVENT) {
390 size_t header_length; 391 size_t header_length;
391 size_t total_length; 392 size_t total_length;
392 uint8_t header[IP_PACKET_SIZE]; 393 uint8_t header[IP_PACKET_SIZE];
393 webrtc::PacketDirection direction; 394 webrtc::PacketDirection direction;
394 395
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 direction); 457 direction);
457 break; 458 break;
458 default: 459 default:
459 break; 460 break;
460 } 461 }
461 } 462 }
462 } 463 }
463 } 464 }
464 return 0; 465 return 0;
465 } 466 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/logging/rtc_event_log/rtc_event_log_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698