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

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

Issue 2916053002: Print configured header extensions and codecs in rtc_event_log2text. (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 | 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) 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 16 matching lines...) Expand all
27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h" 27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h"
28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h"
29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h"
30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.h" 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.h"
31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h" 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h"
32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
33 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" 33 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
34 34
35 namespace { 35 namespace {
36 36
37 DEFINE_bool(noconfig, true, "Excludes stream configurations."); 37 DEFINE_bool(noconfig, false, "Excludes stream configurations.");
38 DEFINE_bool(noincoming, false, "Excludes incoming packets."); 38 DEFINE_bool(noincoming, false, "Excludes incoming packets.");
39 DEFINE_bool(nooutgoing, false, "Excludes outgoing packets."); 39 DEFINE_bool(nooutgoing, false, "Excludes outgoing packets.");
40 // TODO(terelius): Note that the media type doesn't work with outgoing packets. 40 // TODO(terelius): Note that the media type doesn't work with outgoing packets.
41 DEFINE_bool(noaudio, false, "Excludes audio packets."); 41 DEFINE_bool(noaudio, false, "Excludes audio packets.");
42 // TODO(terelius): Note that the media type doesn't work with outgoing packets. 42 // TODO(terelius): Note that the media type doesn't work with outgoing packets.
43 DEFINE_bool(novideo, false, "Excludes video packets."); 43 DEFINE_bool(novideo, false, "Excludes video packets.");
44 // TODO(terelius): Note that the media type doesn't work with outgoing packets. 44 // TODO(terelius): Note that the media type doesn't work with outgoing packets.
45 DEFINE_bool(nodata, false, "Excludes data packets."); 45 DEFINE_bool(nodata, false, "Excludes data packets.");
46 DEFINE_bool(nortp, false, "Excludes RTP packets."); 46 DEFINE_bool(nortp, false, "Excludes RTP packets.");
47 DEFINE_bool(nortcp, false, "Excludes RTCP packets."); 47 DEFINE_bool(nortcp, false, "Excludes RTCP packets.");
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 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;
360 std::cout << "\textensions={";
361 for (const auto& extension : config.rtp_extensions) {
362 std::cout << extension.ToString() << ",";
363 }
364 std::cout << "}";
365 std::cout << "\tcodecs={";
366 for (const auto& codec : config.codecs) {
367 std::cout << "{name: " << codec.payload_name
368 << ", payload_type: " << codec.payload_type
369 << ", rtx_payload_type: " << codec.rtx_payload_type << "}";
370 }
371 std::cout << "}" << std::endl;
360 } 372 }
361 if (!FLAGS_noconfig && !FLAGS_novideo && !FLAGS_nooutgoing && 373 if (!FLAGS_noconfig && !FLAGS_novideo && !FLAGS_nooutgoing &&
362 parsed_stream.GetEventType(i) == 374 parsed_stream.GetEventType(i) ==
363 webrtc::ParsedRtcEventLog::VIDEO_SENDER_CONFIG_EVENT) { 375 webrtc::ParsedRtcEventLog::VIDEO_SENDER_CONFIG_EVENT) {
364 std::vector<webrtc::rtclog::StreamConfig> configs = 376 std::vector<webrtc::rtclog::StreamConfig> configs =
365 parsed_stream.GetVideoSendConfig(i); 377 parsed_stream.GetVideoSendConfig(i);
366 for (size_t j = 0; j < configs.size(); j++) { 378 for (const auto& config : configs) {
367 std::cout << parsed_stream.GetTimestamp(i) << "\tVIDEO_SEND_CONFIG"; 379 std::cout << parsed_stream.GetTimestamp(i) << "\tVIDEO_SEND_CONFIG";
368 std::cout << "\tssrcs=" << configs[j].local_ssrc; 380 std::cout << "\tssrcs=" << config.local_ssrc;
369 std::cout << "\trtx_ssrcs=" << configs[j].rtx_ssrc; 381 std::cout << "\trtx_ssrcs=" << config.rtx_ssrc;
370 std::cout << std::endl; 382 std::cout << "\textensions={";
383 for (const auto& extension : config.rtp_extensions) {
384 std::cout << extension.ToString() << ",";
385 }
386 std::cout << "}";
387 std::cout << "\tcodecs={";
388 for (const auto& codec : config.codecs) {
389 std::cout << "{name: " << codec.payload_name
390 << ", payload_type: " << codec.payload_type
391 << ", rtx_payload_type: " << codec.rtx_payload_type << "}";
392 }
393 std::cout << "}" << std::endl;
371 } 394 }
372 } 395 }
373 if (!FLAGS_noconfig && !FLAGS_noaudio && !FLAGS_noincoming && 396 if (!FLAGS_noconfig && !FLAGS_noaudio && !FLAGS_noincoming &&
374 parsed_stream.GetEventType(i) == 397 parsed_stream.GetEventType(i) ==
375 webrtc::ParsedRtcEventLog::AUDIO_RECEIVER_CONFIG_EVENT) { 398 webrtc::ParsedRtcEventLog::AUDIO_RECEIVER_CONFIG_EVENT) {
376 webrtc::rtclog::StreamConfig config = 399 webrtc::rtclog::StreamConfig config =
377 parsed_stream.GetAudioReceiveConfig(i); 400 parsed_stream.GetAudioReceiveConfig(i);
378 std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_RECV_CONFIG" 401 std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_RECV_CONFIG"
379 << "\tssrc=" << config.remote_ssrc 402 << "\tssrc=" << config.remote_ssrc
380 << "\tfeedback_ssrc=" << config.local_ssrc << std::endl; 403 << "\tfeedback_ssrc=" << config.local_ssrc;
404 std::cout << "\textensions={";
405 for (const auto& extension : config.rtp_extensions) {
406 std::cout << extension.ToString() << ",";
407 }
408 std::cout << "}";
409 std::cout << "\tcodecs={";
410 for (const auto& codec : config.codecs) {
411 std::cout << "{name: " << codec.payload_name
412 << ", payload_type: " << codec.payload_type
413 << ", rtx_payload_type: " << codec.rtx_payload_type << "}";
414 }
415 std::cout << "}" << std::endl;
381 } 416 }
382 if (!FLAGS_noconfig && !FLAGS_noaudio && !FLAGS_nooutgoing && 417 if (!FLAGS_noconfig && !FLAGS_noaudio && !FLAGS_nooutgoing &&
383 parsed_stream.GetEventType(i) == 418 parsed_stream.GetEventType(i) ==
384 webrtc::ParsedRtcEventLog::AUDIO_SENDER_CONFIG_EVENT) { 419 webrtc::ParsedRtcEventLog::AUDIO_SENDER_CONFIG_EVENT) {
385 webrtc::rtclog::StreamConfig config = parsed_stream.GetAudioSendConfig(i); 420 webrtc::rtclog::StreamConfig config = parsed_stream.GetAudioSendConfig(i);
386 std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_SEND_CONFIG" 421 std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_SEND_CONFIG"
387 << "\tssrc=" << config.local_ssrc << std::endl; 422 << "\tssrc=" << config.local_ssrc;
423 std::cout << "\textensions={";
424 for (const auto& extension : config.rtp_extensions) {
425 std::cout << extension.ToString() << ",";
426 }
427 std::cout << "}";
428 std::cout << "\tcodecs={";
429 for (const auto& codec : config.codecs) {
430 std::cout << "{name: " << codec.payload_name
431 << ", payload_type: " << codec.payload_type
432 << ", rtx_payload_type: " << codec.rtx_payload_type << "}";
433 }
434 std::cout << "}" << std::endl;
388 } 435 }
389 if (!FLAGS_nortp && 436 if (!FLAGS_nortp &&
390 parsed_stream.GetEventType(i) == webrtc::ParsedRtcEventLog::RTP_EVENT) { 437 parsed_stream.GetEventType(i) == webrtc::ParsedRtcEventLog::RTP_EVENT) {
391 size_t header_length; 438 size_t header_length;
392 size_t total_length; 439 size_t total_length;
393 uint8_t header[IP_PACKET_SIZE]; 440 uint8_t header[IP_PACKET_SIZE];
394 webrtc::PacketDirection direction; 441 webrtc::PacketDirection direction;
395 442
396 parsed_stream.GetRtpHeader(i, &direction, header, &header_length, 443 parsed_stream.GetRtpHeader(i, &direction, header, &header_length,
397 &total_length); 444 &total_length);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 direction); 504 direction);
458 break; 505 break;
459 default: 506 default:
460 break; 507 break;
461 } 508 }
462 } 509 }
463 } 510 }
464 } 511 }
465 return 0; 512 return 0;
466 } 513 }
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