From 4f1f5fa55d803fc0b7f3fd4f6a25a0f84c4e3280 Mon Sep 17 00:00:00 2001 From: "sprang@webrtc.org" Date: Thu, 19 Dec 2013 13:26:02 +0000 Subject: 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 --- video_engine/vie_rtp_rtcp_impl.cc | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'video_engine/vie_rtp_rtcp_impl.cc') 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( -- cgit v1.2.3