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

Side by Side Diff: webrtc/call/rtc_event_log_parser.cc

Issue 2353543003: Added logging for audio send/receive stream configs. (Closed)
Patch Set: Added code for parsing the audio send/receive configs. Created 4 years, 3 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 | « webrtc/call/rtc_event_log_parser.h ('k') | webrtc/tools/event_log_visualizer/analyzer.cc » ('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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } 369 }
370 // Get encoder. 370 // Get encoder.
371 RTC_CHECK(sender_config.has_encoder()); 371 RTC_CHECK(sender_config.has_encoder());
372 RTC_CHECK(sender_config.encoder().has_name()); 372 RTC_CHECK(sender_config.encoder().has_name());
373 RTC_CHECK(sender_config.encoder().has_payload_type()); 373 RTC_CHECK(sender_config.encoder().has_payload_type());
374 config->encoder_settings.payload_name = sender_config.encoder().name(); 374 config->encoder_settings.payload_name = sender_config.encoder().name();
375 config->encoder_settings.payload_type = 375 config->encoder_settings.payload_type =
376 sender_config.encoder().payload_type(); 376 sender_config.encoder().payload_type();
377 } 377 }
378 378
379 void ParsedRtcEventLog::GetAudioReceiveConfig(
380 size_t index,
381 AudioReceiveStream::Config* config) const {
382 RTC_CHECK_LT(index, GetNumberOfEvents());
383 const rtclog::Event& event = events_[index];
384 RTC_CHECK(config != nullptr);
385 RTC_CHECK(event.has_type());
386 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT);
387 RTC_CHECK(event.has_audio_receiver_config());
388 const rtclog::AudioReceiveConfig& receiver_config =
389 event.audio_receiver_config();
390 // Get SSRCs.
391 RTC_CHECK(receiver_config.has_remote_ssrc());
392 config->rtp.remote_ssrc = receiver_config.remote_ssrc();
393 RTC_CHECK(receiver_config.has_local_ssrc());
394 config->rtp.local_ssrc = receiver_config.local_ssrc();
395 // Get header extensions.
396 config->rtp.extensions.clear();
397 for (int i = 0; i < receiver_config.header_extensions_size(); i++) {
398 RTC_CHECK(receiver_config.header_extensions(i).has_name());
399 RTC_CHECK(receiver_config.header_extensions(i).has_id());
400 const std::string& name = receiver_config.header_extensions(i).name();
401 int id = receiver_config.header_extensions(i).id();
402 config->rtp.extensions.push_back(RtpExtension(name, id));
403 }
404 }
405
406 void ParsedRtcEventLog::GetAudioSendConfig(
407 size_t index,
408 AudioSendStream::Config* config) const {
409 RTC_CHECK_LT(index, GetNumberOfEvents());
410 const rtclog::Event& event = events_[index];
411 RTC_CHECK(config != nullptr);
412 RTC_CHECK(event.has_type());
413 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_SENDER_CONFIG_EVENT);
414 RTC_CHECK(event.has_audio_sender_config());
415 const rtclog::AudioSendConfig& sender_config = event.audio_sender_config();
416 // Get SSRCs.
417 config->rtp.ssrc = sender_config.ssrc();
terelius 2016/09/21 10:11:26 RTC_CHECK(sender_config.has_ssrc())
ivoc 2016/09/22 09:20:55 Good catch, added.
418 // Get header extensions.
419 config->rtp.extensions.clear();
420 for (int i = 0; i < sender_config.header_extensions_size(); i++) {
the sun 2016/09/22 06:51:02 Can we make a utility function out of this loop, o
ivoc 2016/09/22 09:20:55 It's not as simple as it seems, because the type o
the sun 2016/09/22 19:22:05 All the stream config objects store the extensions
ivoc 2016/09/23 12:40:27 Thanks for the suggestion, that's a really good id
421 RTC_CHECK(sender_config.header_extensions(i).has_name());
422 RTC_CHECK(sender_config.header_extensions(i).has_id());
423 const std::string& name = sender_config.header_extensions(i).name();
424 int id = sender_config.header_extensions(i).id();
425 config->rtp.extensions.push_back(RtpExtension(name, id));
426 }
427 }
428
379 void ParsedRtcEventLog::GetAudioPlayout(size_t index, uint32_t* ssrc) const { 429 void ParsedRtcEventLog::GetAudioPlayout(size_t index, uint32_t* ssrc) const {
380 RTC_CHECK_LT(index, GetNumberOfEvents()); 430 RTC_CHECK_LT(index, GetNumberOfEvents());
381 const rtclog::Event& event = events_[index]; 431 const rtclog::Event& event = events_[index];
382 RTC_CHECK(event.has_type()); 432 RTC_CHECK(event.has_type());
383 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_PLAYOUT_EVENT); 433 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_PLAYOUT_EVENT);
384 RTC_CHECK(event.has_audio_playout_event()); 434 RTC_CHECK(event.has_audio_playout_event());
385 const rtclog::AudioPlayoutEvent& loss_event = event.audio_playout_event(); 435 const rtclog::AudioPlayoutEvent& loss_event = event.audio_playout_event();
386 RTC_CHECK(loss_event.has_local_ssrc()); 436 RTC_CHECK(loss_event.has_local_ssrc());
387 if (ssrc != nullptr) { 437 if (ssrc != nullptr) {
388 *ssrc = loss_event.local_ssrc(); 438 *ssrc = loss_event.local_ssrc();
(...skipping 18 matching lines...) Expand all
407 if (fraction_loss != nullptr) { 457 if (fraction_loss != nullptr) {
408 *fraction_loss = loss_event.fraction_loss(); 458 *fraction_loss = loss_event.fraction_loss();
409 } 459 }
410 RTC_CHECK(loss_event.has_total_packets()); 460 RTC_CHECK(loss_event.has_total_packets());
411 if (total_packets != nullptr) { 461 if (total_packets != nullptr) {
412 *total_packets = loss_event.total_packets(); 462 *total_packets = loss_event.total_packets();
413 } 463 }
414 } 464 }
415 465
416 } // namespace webrtc 466 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/rtc_event_log_parser.h ('k') | webrtc/tools/event_log_visualizer/analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698