summaryrefslogtreecommitdiff
path: root/voice_engine
diff options
context:
space:
mode:
authorhenrike@webrtc.org <henrike@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-08-21 19:44:13 +0000
committerhenrike@webrtc.org <henrike@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-08-21 19:44:13 +0000
commitc0976d247fedbe48d703f1ef3d5fb0fd70fdab93 (patch)
tree8b1e0d2a2f9b8fb2102334113ad42e892f5cd4d7 /voice_engine
parentefe1f0f566a6a102bce8d961a1135b987b41d36d (diff)
downloadwebrtc-c0976d247fedbe48d703f1ef3d5fb0fd70fdab93.tar.gz
Revert 4582 "Reverts a second set of reverts caused by a bug in ..."
> Reverts a second set of reverts caused by a bug in a dependency. > > Revert "Revert r4328" > > Revert "Revert r4322 "Support sending multiple report blocks and keeping track > of statistics on" > > BUG=1811 > R=henrika@webrtc.org, pbos@webrtc.org, tina.legrand@webrtc.org > > Review URL: https://webrtc-codereview.appspot.com/2072004 TBR=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2087004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@4585 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine')
-rw-r--r--voice_engine/channel.cc41
-rw-r--r--voice_engine/channel.h4
2 files changed, 19 insertions, 26 deletions
diff --git a/voice_engine/channel.cc b/voice_engine/channel.cc
index 4671b6fd..f8f8bd2c 100644
--- a/voice_engine/channel.cc
+++ b/voice_engine/channel.cc
@@ -360,15 +360,20 @@ Channel::OnPlayTelephoneEvent(int32_t id,
}
void
-Channel::OnIncomingSSRCChanged(int32_t id, uint32_t ssrc)
+Channel::OnIncomingSSRCChanged(int32_t id,
+ uint32_t SSRC)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::OnIncomingSSRCChanged(id=%d, SSRC=%d)",
- id, ssrc);
+ id, SSRC);
int32_t channel = VoEChannelId(id);
assert(channel == _channelId);
+ // Reset RTP-module counters since a new incoming RTP stream is detected
+ rtp_receive_statistics_->ResetDataCounters();
+ rtp_receive_statistics_->ResetStatistics();
+
if (_rtpObserver)
{
CriticalSectionScoped cs(&_callbackCritSect);
@@ -376,7 +381,7 @@ Channel::OnIncomingSSRCChanged(int32_t id, uint32_t ssrc)
if (_rtpObserverPtr)
{
// Send new SSRC to registered observer using callback
- _rtpObserverPtr->OnIncomingSSRCChanged(channel, ssrc);
+ _rtpObserverPtr->OnIncomingSSRCChanged(channel, SSRC);
}
}
}
@@ -403,12 +408,8 @@ void Channel::OnIncomingCSRCChanged(int32_t id,
}
}
-void Channel::ResetStatistics(uint32_t ssrc) {
- StreamStatistician* statistician =
- rtp_receive_statistics_->GetStatistician(ssrc);
- if (statistician) {
- statistician->ResetStatistics();
- }
+void Channel::ResetStatistics() {
+ rtp_receive_statistics_->ResetStatistics();
}
void
@@ -2230,10 +2231,8 @@ bool Channel::IsPacketRetransmitted(const RTPHeader& header) const {
rtp_receiver_->RTXStatus(&rtx_enabled, &rtx_ssrc, &rtx_payload_type);
if (!rtx_enabled) {
// Check if this is a retransmission.
- StreamStatistician::Statistics stats;
- StreamStatistician* statistician =
- rtp_receive_statistics_->GetStatistician(header.ssrc);
- if (statistician && statistician->GetStatistics(&stats, false)) {
+ ReceiveStatistics::RtpReceiveStatistics stats;
+ if (rtp_receive_statistics_->Statistics(&stats, false)) {
uint16_t min_rtt = 0;
_rtpRtcpModule->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL);
return rtp_receiver_->RetransmitOfOldPacket(header, stats.jitter,
@@ -3922,10 +3921,8 @@ Channel::GetRTPStatistics(
{
// The jitter statistics is updated for each received RTP packet and is
// based on received packets.
- StreamStatistician::Statistics statistics;
- StreamStatistician* statistician =
- rtp_receive_statistics_->GetStatistician(rtp_receiver_->SSRC());
- if (!statistician || !statistician->GetStatistics(
+ ReceiveStatistics::RtpReceiveStatistics statistics;
+ if (!rtp_receive_statistics_->Statistics(
&statistics, _rtpRtcpModule->RTCP() == kRtcpOff)) {
_engineStatisticsPtr->SetLastError(
VE_CANNOT_RETRIEVE_RTP_STAT, kTraceWarning,
@@ -4019,10 +4016,8 @@ Channel::GetRTPStatistics(CallStatistics& stats)
// The jitter statistics is updated for each received RTP packet and is
// based on received packets.
- StreamStatistician::Statistics statistics;
- StreamStatistician* statistician =
- rtp_receive_statistics_->GetStatistician(rtp_receiver_->SSRC());
- if (!statistician || !statistician->GetStatistics(
+ ReceiveStatistics::RtpReceiveStatistics statistics;
+ if (!rtp_receive_statistics_->Statistics(
&statistics, _rtpRtcpModule->RTCP() == kRtcpOff)) {
_engineStatisticsPtr->SetLastError(
VE_CANNOT_RETRIEVE_RTP_STAT, kTraceWarning,
@@ -4092,9 +4087,7 @@ Channel::GetRTPStatistics(CallStatistics& stats)
uint32_t bytesReceived(0);
uint32_t packetsReceived(0);
- if (statistician) {
- statistician->GetDataCounters(&bytesReceived, &packetsReceived);
- }
+ rtp_receive_statistics_->GetDataCounters(&bytesReceived, &packetsReceived);
if (_rtpRtcpModule->DataCountersRTP(&bytesSent,
&packetsSent) != 0)
diff --git a/voice_engine/channel.h b/voice_engine/channel.h
index 34013069..f88dca47 100644
--- a/voice_engine/channel.h
+++ b/voice_engine/channel.h
@@ -329,12 +329,12 @@ public:
RTPAliveType alive);
void OnIncomingSSRCChanged(int32_t id,
- uint32_t ssrc);
+ uint32_t SSRC);
void OnIncomingCSRCChanged(int32_t id,
uint32_t CSRC, bool added);
- void ResetStatistics(uint32_t ssrc);
+ void ResetStatistics();
public:
// From RtcpFeedback in the RTP/RTCP module