summaryrefslogtreecommitdiff
path: root/video_engine/vie_rtp_rtcp_impl.cc
diff options
context:
space:
mode:
authorsprang@webrtc.org <sprang@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-01-23 10:00:39 +0000
committersprang@webrtc.org <sprang@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-01-23 10:00:39 +0000
commit7d99cd47d8055ec6815f2862b75a0bdf53304199 (patch)
tree9d728eef0146843e32026ca810b6f8452a932c14 /video_engine/vie_rtp_rtcp_impl.cc
parent888b83915670de04072eed82cfa766dad92faf73 (diff)
downloadwebrtc-7d99cd47d8055ec6815f2862b75a0bdf53304199.tar.gz
Add callbacks for receive channel RTP statistics
This allows a listener to receive new statistics (byte/packet counts, etc) as it is generated - avoiding the need to poll. This also makes handling stats from multiple RTP streams more tractable. The change is primarily targeted at the new video engine API. TEST=Unit test in ReceiveStatisticsTest. Integration tests to follow as call tests when fully wired up. BUG=2235 R=mflodman@webrtc.org, pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/6259004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5416 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'video_engine/vie_rtp_rtcp_impl.cc')
-rw-r--r--video_engine/vie_rtp_rtcp_impl.cc32
1 files changed, 26 insertions, 6 deletions
diff --git a/video_engine/vie_rtp_rtcp_impl.cc b/video_engine/vie_rtp_rtcp_impl.cc
index d9f2211d..b655349d 100644
--- a/video_engine/vie_rtp_rtcp_impl.cc
+++ b/video_engine/vie_rtp_rtcp_impl.cc
@@ -1224,15 +1224,35 @@ int ViERTP_RTCPImpl::DeregisterSendChannelRtpStatisticsCallback(
}
int ViERTP_RTCPImpl::RegisterReceiveChannelRtpStatisticsCallback(
- int channel, StreamDataCountersCallback* callback) {
- // TODO(sprang): Implement
- return -1;
+ const int video_channel,
+ StreamDataCountersCallback* callback) {
+ WEBRTC_TRACE(kTraceApiCall,
+ kTraceVideo,
+ ViEId(shared_data_->instance_id(), video_channel),
+ "%s(channel: %d)",
+ __FUNCTION__,
+ video_channel);
+ ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
+ ViEChannel* vie_channel = cs.Channel(video_channel);
+ assert(vie_channel != NULL);
+ vie_channel->RegisterReceiveChannelRtpStatisticsCallback(callback);
+ return 0;
}
int ViERTP_RTCPImpl::DeregisterReceiveChannelRtpStatisticsCallback(
- int channel, StreamDataCountersCallback* callback) {
- // TODO(sprang): Implement
- return -1;
+ const int video_channel,
+ StreamDataCountersCallback* callback) {
+ WEBRTC_TRACE(kTraceApiCall,
+ kTraceVideo,
+ ViEId(shared_data_->instance_id(), video_channel),
+ "%s(channel: %d)",
+ __FUNCTION__,
+ video_channel);
+ ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
+ ViEChannel* vie_channel = cs.Channel(video_channel);
+ assert(vie_channel != NULL);
+ vie_channel->RegisterReceiveChannelRtpStatisticsCallback(NULL);
+ return 0;
}
// Called whenever the send bitrate is updated.