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

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

Issue 2484193002: Expose RtpCodecParameters to VideoMediaInfo stats. (Closed)
Patch Set: Addressed magjed's comments 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine2.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
index 3cacc7da82ba3ee32cdfa69abf271635df9ec98b..15c6f34bdb5e00ae9e6067b5e782c94b73410e36 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, std::move(codec_params)));
+ }
+ 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, std::move(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;
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698