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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/rtc_event_log_parser.cc
diff --git a/webrtc/call/rtc_event_log_parser.cc b/webrtc/call/rtc_event_log_parser.cc
index a2f95d0a75e2c833b695233489651a1cb57c08b2..c22b7beb9aecf47181cb932adf048924bb23d4b0 100644
--- a/webrtc/call/rtc_event_log_parser.cc
+++ b/webrtc/call/rtc_event_log_parser.cc
@@ -376,6 +376,56 @@ void ParsedRtcEventLog::GetVideoSendConfig(
sender_config.encoder().payload_type();
}
+void ParsedRtcEventLog::GetAudioReceiveConfig(
+ size_t index,
+ AudioReceiveStream::Config* config) const {
+ RTC_CHECK_LT(index, GetNumberOfEvents());
+ const rtclog::Event& event = events_[index];
+ RTC_CHECK(config != nullptr);
+ RTC_CHECK(event.has_type());
+ RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT);
+ RTC_CHECK(event.has_audio_receiver_config());
+ const rtclog::AudioReceiveConfig& receiver_config =
+ event.audio_receiver_config();
+ // Get SSRCs.
+ RTC_CHECK(receiver_config.has_remote_ssrc());
+ config->rtp.remote_ssrc = receiver_config.remote_ssrc();
+ RTC_CHECK(receiver_config.has_local_ssrc());
+ config->rtp.local_ssrc = receiver_config.local_ssrc();
+ // Get header extensions.
+ config->rtp.extensions.clear();
+ for (int i = 0; i < receiver_config.header_extensions_size(); i++) {
+ RTC_CHECK(receiver_config.header_extensions(i).has_name());
+ RTC_CHECK(receiver_config.header_extensions(i).has_id());
+ const std::string& name = receiver_config.header_extensions(i).name();
+ int id = receiver_config.header_extensions(i).id();
+ config->rtp.extensions.push_back(RtpExtension(name, id));
+ }
+}
+
+void ParsedRtcEventLog::GetAudioSendConfig(
+ size_t index,
+ AudioSendStream::Config* config) const {
+ RTC_CHECK_LT(index, GetNumberOfEvents());
+ const rtclog::Event& event = events_[index];
+ RTC_CHECK(config != nullptr);
+ RTC_CHECK(event.has_type());
+ RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_SENDER_CONFIG_EVENT);
+ RTC_CHECK(event.has_audio_sender_config());
+ const rtclog::AudioSendConfig& sender_config = event.audio_sender_config();
+ // Get SSRCs.
+ 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.
+ // Get header extensions.
+ config->rtp.extensions.clear();
+ 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
+ RTC_CHECK(sender_config.header_extensions(i).has_name());
+ RTC_CHECK(sender_config.header_extensions(i).has_id());
+ const std::string& name = sender_config.header_extensions(i).name();
+ int id = sender_config.header_extensions(i).id();
+ config->rtp.extensions.push_back(RtpExtension(name, id));
+ }
+}
+
void ParsedRtcEventLog::GetAudioPlayout(size_t index, uint32_t* ssrc) const {
RTC_CHECK_LT(index, GetNumberOfEvents());
const rtclog::Event& event = events_[index];
« 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