diff options
author | sprang@webrtc.org <sprang@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-12-19 13:26:02 +0000 |
---|---|---|
committer | sprang@webrtc.org <sprang@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-12-19 13:26:02 +0000 |
commit | 4f1f5fa55d803fc0b7f3fd4f6a25a0f84c4e3280 (patch) | |
tree | 4b747f7e8e3d0ccaca810c674c91a7912efa628d /video_engine/vie_rtp_rtcp_impl.cc | |
parent | 9edcdb013de0f88f9db2eff233968cebbfddeb4c (diff) | |
download | webrtc-4f1f5fa55d803fc0b7f3fd4f6a25a0f84c4e3280.tar.gz |
Add callbacks for receive channel RTCP statistics.
This allows a listener to receive new statistics 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=henrika@webrtc.org, pbos@webrtc.org, stefan@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/5089004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5323 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'video_engine/vie_rtp_rtcp_impl.cc')
-rw-r--r-- | video_engine/vie_rtp_rtcp_impl.cc | 32 |
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 2bd47bec..d9f2211d 100644 --- a/video_engine/vie_rtp_rtcp_impl.cc +++ b/video_engine/vie_rtp_rtcp_impl.cc @@ -1168,15 +1168,35 @@ int ViERTP_RTCPImpl::DeregisterSendChannelRtcpStatisticsCallback( } int ViERTP_RTCPImpl::RegisterReceiveChannelRtcpStatisticsCallback( - int channel, RtcpStatisticsCallback* callback) { - // TODO(sprang): Implement - return -1; + const int video_channel, + RtcpStatisticsCallback* 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->RegisterReceiveChannelRtcpStatisticsCallback(callback); + return 0; } int ViERTP_RTCPImpl::DeregisterReceiveChannelRtcpStatisticsCallback( - int channel, RtcpStatisticsCallback* callback) { - // TODO(sprang): Implement - return -1; + const int video_channel, + RtcpStatisticsCallback* 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->RegisterReceiveChannelRtcpStatisticsCallback(NULL); + return 0; } int ViERTP_RTCPImpl::RegisterSendChannelRtpStatisticsCallback( |