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

Unified Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2503383002: Expose RtpCodecParameters to VoiceMediaInfo stats. (Closed)
Patch Set: Using uint32_t in RtpCodecParametersMap instead of int Created 4 years, 1 month 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
Index: webrtc/media/engine/webrtcvoiceengine.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index 9f544c18262d13e812186b46e9a8f79277077bf3..2f12bba4d8d3d56814900bc1a7bbf0f04c9d4e28 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -2475,7 +2475,7 @@ bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info) {
RTC_DCHECK(info);
// Get SSRC and stats for each sender.
- RTC_DCHECK(info->senders.size() == 0);
+ RTC_DCHECK_EQ(info->senders.size(), 0U);
for (const auto& stream : send_streams_) {
webrtc::AudioSendStream::Stats stats = stream.second->GetStats();
VoiceSenderInfo sinfo;
@@ -2485,6 +2485,7 @@ bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info) {
sinfo.packets_lost = stats.packets_lost;
sinfo.fraction_lost = stats.fraction_lost;
sinfo.codec_name = stats.codec_name;
+ sinfo.codec_payload_type = stats.codec_payload_type;
sinfo.ext_seqnum = stats.ext_seqnum;
sinfo.jitter_ms = stats.jitter_ms;
sinfo.rtt_ms = stats.rtt_ms;
@@ -2500,7 +2501,7 @@ bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info) {
}
// Get SSRC and stats for each receiver.
- RTC_DCHECK(info->receivers.size() == 0);
+ RTC_DCHECK_EQ(info->receivers.size(), 0U);
for (const auto& stream : recv_streams_) {
webrtc::AudioReceiveStream::Stats stats = stream.second->GetStats();
VoiceReceiverInfo rinfo;
@@ -2510,6 +2511,7 @@ bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info) {
rinfo.packets_lost = stats.packets_lost;
rinfo.fraction_lost = stats.fraction_lost;
rinfo.codec_name = stats.codec_name;
+ rinfo.codec_payload_type = stats.codec_payload_type;
rinfo.ext_seqnum = stats.ext_seqnum;
rinfo.jitter_ms = stats.jitter_ms;
rinfo.jitter_buffer_ms = stats.jitter_buffer_ms;
@@ -2533,6 +2535,22 @@ bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info) {
info->receivers.push_back(rinfo);
}
+ // Get codec info
+ for (const AudioCodec& codec : send_codecs_) {
+ webrtc::RtpCodecParameters codec_params = codec.ToCodecParameters();
+ RTC_DCHECK_GE(codec_params.payload_type, 0);
the sun 2016/11/16 19:41:07 Same comment as for video engine - can we avoid th
hbos 2016/11/17 14:14:48 Done.
+ info->send_codecs.insert(
+ std::make_pair(static_cast<uint32_t>(codec_params.payload_type),
+ std::move(codec_params)));
+ }
+ for (const AudioCodec& codec : recv_codecs_) {
+ webrtc::RtpCodecParameters codec_params = codec.ToCodecParameters();
+ RTC_DCHECK_GE(codec_params.payload_type, 0);
+ info->receive_codecs.insert(
+ std::make_pair(static_cast<uint32_t>(codec_params.payload_type),
+ std::move(codec_params)));
+ }
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698