Index: webrtc/media/engine/webrtcvideoengine2.cc |
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc |
index 3cacc7da82ba3ee32cdfa69abf271635df9ec98b..acb1bc34e88e330c795369b8be4dc05871948121 100644 |
--- a/webrtc/media/engine/webrtcvideoengine2.cc |
+++ b/webrtc/media/engine/webrtcvideoengine2.cc |
@@ -1342,6 +1342,7 @@ bool WebRtcVideoChannel2::GetStats(VideoMediaInfo* info) { |
info->Clear(); |
FillSenderStats(info, log_stats); |
FillReceiverStats(info, log_stats); |
+ FillSendAndReceiveCodecStats(info); |
webrtc::Call::Stats stats = call_->GetStats(); |
FillBandwidthEstimationStats(stats, info); |
if (stats.rtt_ms != -1) { |
@@ -1396,6 +1397,20 @@ void WebRtcVideoChannel2::FillBandwidthEstimationStats( |
video_media_info->bw_estimations.push_back(bwe_info); |
} |
+void WebRtcVideoChannel2::FillSendAndReceiveCodecStats( |
+ VideoMediaInfo* video_media_info) { |
+ for (const VideoCodec& codec : send_params_.codecs) { |
+ webrtc::RtpCodecParameters codec_params = codec.ToCodecParameters(); |
+ video_media_info->send_codecs.insert( |
+ std::make_pair(codec_params.payload_type, codec_params)); |
magjed_webrtc
2016/11/14 08:58:13
This webrtc::RtpCodecParameters looks heavy, you c
hbos
2016/11/14 09:16:02
Done.
Yes, type (audio/video) + direction (send/r
|
+ } |
+ for (const VideoCodec& codec : recv_params_.codecs) { |
+ webrtc::RtpCodecParameters codec_params = codec.ToCodecParameters(); |
+ video_media_info->receive_codecs.insert( |
+ std::make_pair(codec_params.payload_type, codec_params)); |
+ } |
+} |
+ |
void WebRtcVideoChannel2::OnPacketReceived( |
rtc::CopyOnWriteBuffer* packet, |
const rtc::PacketTime& packet_time) { |
@@ -2000,8 +2015,11 @@ VideoSenderInfo WebRtcVideoChannel2::WebRtcVideoSendStream::GetVideoSenderInfo( |
for (uint32_t ssrc : parameters_.config.rtp.ssrcs) |
info.add_ssrc(ssrc); |
- if (parameters_.codec_settings) |
+ if (parameters_.codec_settings) { |
info.codec_name = parameters_.codec_settings->codec.name; |
+ info.codec_payload_type = rtc::Optional<uint32_t>( |
+ static_cast<uint32_t>(parameters_.codec_settings->codec.id)); |
+ } |
if (stream_ == NULL) |
return info; |
@@ -2417,6 +2435,10 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetVideoReceiverInfo( |
info.add_ssrc(config_.rtp.remote_ssrc); |
webrtc::VideoReceiveStream::Stats stats = stream_->GetStats(); |
info.decoder_implementation_name = stats.decoder_implementation_name; |
+ if (stats.current_payload_type != -1) { |
+ info.codec_payload_type = rtc::Optional<uint32_t>( |
+ static_cast<uint32_t>(stats.current_payload_type)); |
+ } |
info.bytes_rcvd = stats.rtp_stats.transmitted.payload_bytes + |
stats.rtp_stats.transmitted.header_bytes + |
stats.rtp_stats.transmitted.padding_bytes; |