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

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

Issue 2503383002: Expose RtpCodecParameters to VoiceMediaInfo stats. (Closed)
Patch Set: Addressed comments, using 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
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvoiceengine.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index 9f544c18262d13e812186b46e9a8f79277077bf3..37fe2ddeb176299a0bbacd375ad04b53e6a111dc 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,18 @@ 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();
+ info->send_codecs.insert(
+ std::make_pair(codec_params.payload_type, std::move(codec_params)));
+ }
+ for (const AudioCodec& codec : recv_codecs_) {
+ webrtc::RtpCodecParameters codec_params = codec.ToCodecParameters();
+ info->receive_codecs.insert(
+ std::make_pair(codec_params.payload_type, std::move(codec_params)));
+ }
+
return true;
}
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698