Bug 970686: Undo extensions to wrong rtcp methods in webrtc.org r=jesup
authorJan-Ivar Bruaroey <jib@mozilla.com>
Thu, 13 Mar 2014 22:28:12 -0400
changeset 190920 80fad01e53bbafade244f1f2124d11a628788456
parent 190919 c8e80efab6fb0e88c4b607b548fc970498920426
child 190921 f19c420744bd384e599a2029e95919f84c07eff4
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs970686
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 970686: Undo extensions to wrong rtcp methods in webrtc.org r=jesup
media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
media/webrtc/trunk/webrtc/video_engine/include/vie_rtp_rtcp.h
media/webrtc/trunk/webrtc/video_engine/vie_channel.cc
media/webrtc/trunk/webrtc/video_engine/vie_channel.h
media/webrtc/trunk/webrtc/video_engine/vie_rtp_rtcp_impl.cc
media/webrtc/trunk/webrtc/video_engine/vie_rtp_rtcp_impl.h
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -136,25 +136,21 @@ bool WebrtcVideoConduit::GetRemoteSSRC(u
 bool WebrtcVideoConduit::GetAVStats(int32_t* jitterBufferDelayMs,
                                     int32_t* playoutBufferDelayMs,
                                     int32_t* avSyncOffsetMs) {
   return false;
 }
 
 bool WebrtcVideoConduit::GetRTPStats(unsigned int* jitterMs,
                                      unsigned int* cumulativeLost) {
-  unsigned int ntpHigh, ntpLow;
-  unsigned int packetsSent, bytesSent;
   unsigned short fractionLost;
   unsigned extendedMax;
   int rttMs;
   // GetReceivedRTCPStatistics is a poorly named GetRTPStatistics variant
-  return !mPtrRTP->GetReceivedRTCPStatistics(mChannel, ntpHigh, ntpLow,
-                                             packetsSent, bytesSent,
-                                             fractionLost,
+  return !mPtrRTP->GetReceivedRTCPStatistics(mChannel, fractionLost,
                                              *cumulativeLost,
                                              extendedMax,
                                              *jitterMs,
                                              rttMs);
 }
 
 bool WebrtcVideoConduit::GetRTCPReceiverReport(DOMHighResTimeStamp* timestamp,
                                                uint32_t* jitterMs,
--- a/media/webrtc/trunk/webrtc/video_engine/include/vie_rtp_rtcp.h
+++ b/media/webrtc/trunk/webrtc/video_engine/include/vie_rtp_rtcp.h
@@ -271,33 +271,25 @@ class WEBRTC_DLLEXPORT ViERTP_RTCP {
   // back-to-back.
   virtual int SetTransmissionSmoothingStatus(int video_channel,
                                              bool enable) = 0;
 
   // This function returns our locally created statistics of the received RTP
   // stream.
   virtual int GetReceivedRTCPStatistics(
       const int video_channel,
-      unsigned int& ntpHigh,
-      unsigned int& ntpLow,
-      unsigned int& bytes_sent,
-      unsigned int& packets_sent,
       unsigned short& fraction_lost,
       unsigned int& cumulative_lost,
       unsigned int& extended_max,
       unsigned int& jitter,
       int& rtt_ms) const = 0;
 
   // This function returns statistics reported by the remote client in a RTCP
   // packet.
   virtual int GetSentRTCPStatistics(const int video_channel,
-                                    unsigned int& ntpHigh,
-                                    unsigned int& ntpLow,
-                                    unsigned int& bytes_sent,
-                                    unsigned int& packets_sent,
                                     unsigned short& fraction_lost,
                                     unsigned int& cumulative_lost,
                                     unsigned int& extended_max,
                                     unsigned int& jitter,
                                     int& rtt_ms) const = 0;
 
   // The function gets statistics from the sent and received RTP streams.
   virtual int GetRTPStatistics(const int video_channel,
--- a/media/webrtc/trunk/webrtc/video_engine/vie_channel.cc
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_channel.cc
@@ -1248,21 +1248,17 @@ int32_t ViEChannel::GetRemoteRTCPReceive
     WEBRTC_TRACE(kTraceWarning, kTraceVideo, ViEId(engine_id_, channel_id_),
                  "%s: Could not get RTT", __FUNCTION__);
     return -1;
   }
   *rttMs = rtt;
   return 0;
 }
 
-int32_t ViEChannel::GetSendRtcpStatistics(uint32_t* ntp_high,
-                                          uint32_t* ntp_low,
-                                          uint32_t* bytes_sent,
-                                          uint32_t* packets_sent,
-                                          uint16_t* fraction_lost,
+int32_t ViEChannel::GetSendRtcpStatistics(uint16_t* fraction_lost,
                                           uint32_t* cumulative_lost,
                                           uint32_t* extended_max,
                                           uint32_t* jitter_samples,
                                           int32_t* rtt_ms) {
   WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s",
                __FUNCTION__);
 
   // TODO(pwestin) how do we do this for simulcast ? average for all
@@ -1271,30 +1267,16 @@ int32_t ViEChannel::GetSendRtcpStatistic
 
   // for (std::list<RtpRtcp*>::const_iterator it = simulcast_rtp_rtcp_.begin();
   //      it != simulcast_rtp_rtcp_.end();
   //      it++) {
   //   RtpRtcp* rtp_rtcp = *it;
   // }
   uint32_t remote_ssrc = vie_receiver_.GetRemoteSsrc();
 
-  // --- Information from sender info in received RTCP Sender Reports
-
-  RTCPSenderInfo sender_info;
-  if (rtp_rtcp_->RemoteRTCPStat(&sender_info) != 0) {
-    WEBRTC_TRACE(kTraceWarning, kTraceVideo, ViEId(engine_id_, channel_id_),
-                 "%s: Could not get sender info for remote side", __FUNCTION__);
-    return -1;
-  }
-
-  *ntp_high = sender_info.NTPseconds;
-  *ntp_low = sender_info.NTPfraction;
-  *bytes_sent = sender_info.sendOctetCount;
-  *packets_sent = sender_info.sendPacketCount;
-
   // Get all RTCP receiver report blocks that have been received on this
   // channel. If we receive RTP packets from a remote source we know the
   // remote SSRC and use the report block from him.
   // Otherwise use the first report block.
   std::vector<RTCPReportBlock> remote_stats;
   if (rtp_rtcp_->RemoteRTCPStat(&remote_stats) != 0 || remote_stats.empty()) {
     WEBRTC_TRACE(kTraceWarning, kTraceVideo, ViEId(engine_id_, channel_id_),
                  "%s: Could not get remote stats", __FUNCTION__);
@@ -1329,44 +1311,24 @@ int32_t ViEChannel::GetSendRtcpStatistic
   }
   *rtt_ms = rtt;
   return 0;
 }
 
 // TODO(holmer): This is a bad function name as it implies that it returns the
 // received RTCP, while it actually returns the statistics which will be sent
 // in the RTCP.
-int32_t ViEChannel::GetReceivedRtcpStatistics(uint32_t* ntp_high,
-                                              uint32_t* ntp_low,
-                                              uint32_t* bytes_sent,
-                                              uint32_t* packets_sent,
-                                              uint16_t* fraction_lost,
+int32_t ViEChannel::GetReceivedRtcpStatistics(uint16_t* fraction_lost,
                                               uint32_t* cumulative_lost,
                                               uint32_t* extended_max,
                                               uint32_t* jitter_samples,
                                               int32_t* rtt_ms) {
   WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_),
                "%s", __FUNCTION__);
 
-  // --- Information from sender info in received RTCP Sender Reports
-
-  RTCPSenderInfo sender_info;
-  if (rtp_rtcp_->RemoteRTCPStat(&sender_info) != 0) {
-    WEBRTC_TRACE(kTraceWarning, kTraceVideo, ViEId(engine_id_, channel_id_),
-                 "%s: Could not get sender info for remote side", __FUNCTION__);
-    return -1;
-  }
-
-  *ntp_high = sender_info.NTPseconds;
-  *ntp_low = sender_info.NTPfraction;
-  *bytes_sent = sender_info.sendOctetCount;
-  *packets_sent = sender_info.sendPacketCount;
-
-  // --- Locally derived information
-
   uint32_t remote_ssrc = vie_receiver_.GetRemoteSsrc();
   uint8_t frac_lost = 0;
   StreamStatistician* statistician =
       vie_receiver_.GetReceiveStatistics()->GetStatistician(remote_ssrc);
   StreamStatistician::Statistics receive_stats;
   if (!statistician || !statistician->GetStatistics(
       &receive_stats, rtp_rtcp_->RTCP() == kRtcpOff)) {
     WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_),
--- a/media/webrtc/trunk/webrtc/video_engine/vie_channel.h
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_channel.h
@@ -172,32 +172,24 @@ class ViEChannel
                                     uint32_t& receivedPacketCount,
                                     uint64_t& receivedOctetCount,
                                     uint32_t* jitterSamples,
                                     uint16_t* fractionLost,
                                     uint32_t* cumulativeLost,
                                     int32_t* rttMs);
 
   // Returns statistics reported by the remote client in an RTCP packet.
-  int32_t GetSendRtcpStatistics(uint32_t* ntp_high,
-                                uint32_t* ntp_low,
-                                uint32_t* bytes_sent,
-                                uint32_t* packets_sent,
-                                uint16_t* fraction_lost,
+  int32_t GetSendRtcpStatistics(uint16_t* fraction_lost,
                                 uint32_t* cumulative_lost,
                                 uint32_t* extended_max,
                                 uint32_t* jitter_samples,
                                 int32_t* rtt_ms);
 
-  // Returns RTCP sender report + locally created stats of received RTP stream
-  int32_t GetReceivedRtcpStatistics(uint32_t* ntp_high,
-                                    uint32_t* ntp_low,
-                                    uint32_t* bytes_sent,
-                                    uint32_t* packets_sent,
-                                    uint16_t* fraction_lost,
+  // Returns our localy created statistics of the received RTP stream.
+  int32_t GetReceivedRtcpStatistics(uint16_t* fraction_lost,
                                     uint32_t* cumulative_lost,
                                     uint32_t* extended_max,
                                     uint32_t* jitter_samples,
                                     int32_t* rtt_ms);
 
   // Gets sent/received packets statistics.
   int32_t GetRtpStatistics(uint32_t* bytes_sent,
                            uint32_t* packets_sent,
--- a/media/webrtc/trunk/webrtc/video_engine/vie_rtp_rtcp_impl.cc
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_rtp_rtcp_impl.cc
@@ -854,20 +854,16 @@ int ViERTP_RTCPImpl::SetTransmissionSmoo
     shared_data_->SetLastError(kViERtpRtcpInvalidChannelId);
     return -1;
   }
   vie_channel->SetTransmissionSmoothingStatus(enable);
   return 0;
 }
 
 int ViERTP_RTCPImpl::GetReceivedRTCPStatistics(const int video_channel,
-                                               unsigned int& ntp_high,
-                                               unsigned int& ntp_low,
-                                               unsigned int& bytes_sent,
-                                               unsigned int& packets_sent,
                                                uint16_t& fraction_lost,
                                                unsigned int& cumulative_lost,
                                                unsigned int& extended_max,
                                                unsigned int& jitter,
                                                int& rtt_ms) const {
   WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
                ViEId(shared_data_->instance_id(), video_channel),
                "%s(channel: %d)", __FUNCTION__, video_channel);
@@ -875,36 +871,28 @@ int ViERTP_RTCPImpl::GetReceivedRTCPStat
   ViEChannel* vie_channel = cs.Channel(video_channel);
   if (!vie_channel) {
     WEBRTC_TRACE(kTraceError, kTraceVideo,
                  ViEId(shared_data_->instance_id(), video_channel),
                  "%s: Channel %d doesn't exist", __FUNCTION__, video_channel);
     shared_data_->SetLastError(kViERtpRtcpInvalidChannelId);
     return -1;
   }
-  if (vie_channel->GetReceivedRtcpStatistics(&ntp_high,
-                                             &ntp_low,
-                                             &bytes_sent,
-                                             &packets_sent,
-                                             &fraction_lost,
+  if (vie_channel->GetReceivedRtcpStatistics(&fraction_lost,
                                              &cumulative_lost,
                                              &extended_max,
                                              &jitter,
                                              &rtt_ms) != 0) {
     shared_data_->SetLastError(kViERtpRtcpUnknownError);
     return -1;
   }
   return 0;
 }
 
 int ViERTP_RTCPImpl::GetSentRTCPStatistics(const int video_channel,
-                                           unsigned int& ntp_high,
-                                           unsigned int& ntp_low,
-                                           unsigned int& bytes_sent,
-                                           unsigned int& packets_sent,
                                            uint16_t& fraction_lost,
                                            unsigned int& cumulative_lost,
                                            unsigned int& extended_max,
                                            unsigned int& jitter,
                                            int& rtt_ms) const {
   WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
                ViEId(shared_data_->instance_id(), video_channel),
                "%s(channel: %d)", __FUNCTION__, video_channel);
@@ -913,19 +901,17 @@ int ViERTP_RTCPImpl::GetSentRTCPStatisti
   if (!vie_channel) {
     WEBRTC_TRACE(kTraceError, kTraceVideo,
                  ViEId(shared_data_->instance_id(), video_channel),
                  "%s: Channel %d doesn't exist", __FUNCTION__, video_channel);
     shared_data_->SetLastError(kViERtpRtcpInvalidChannelId);
     return -1;
   }
 
-  if (vie_channel->GetSendRtcpStatistics(&ntp_high, &ntp_low,
-                                         &bytes_sent, &packets_sent,
-                                         &fraction_lost, &cumulative_lost,
+  if (vie_channel->GetSendRtcpStatistics(&fraction_lost, &cumulative_lost,
                                          &extended_max, &jitter,
                                          &rtt_ms) != 0) {
     shared_data_->SetLastError(kViERtpRtcpUnknownError);
     return -1;
   }
   return 0;
 }
 
--- a/media/webrtc/trunk/webrtc/video_engine/vie_rtp_rtcp_impl.h
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_rtp_rtcp_impl.h
@@ -94,30 +94,22 @@ class ViERTP_RTCPImpl
   virtual int SetSendAbsoluteSendTimeStatus(int video_channel,
                                             bool enable,
                                             int id);
   virtual int SetReceiveAbsoluteSendTimeStatus(int video_channel,
                                                bool enable,
                                                int id);
   virtual int SetTransmissionSmoothingStatus(int video_channel, bool enable);
   virtual int GetReceivedRTCPStatistics(const int video_channel,
-                                        unsigned int& ntpHigh,
-                                        unsigned int& ntpLow,
-                                        unsigned int& bytes_sent,
-                                        unsigned int& packets_sent,
                                         uint16_t& fraction_lost,
                                         unsigned int& cumulative_lost,
                                         unsigned int& extended_max,
                                         unsigned int& jitter,
                                         int& rtt_ms) const;
   virtual int GetSentRTCPStatistics(const int video_channel,
-                                    unsigned int& ntpHigh,
-                                    unsigned int& ntpLow,
-                                    unsigned int& bytes_sent,
-                                    unsigned int& packets_sent,
                                     uint16_t& fraction_lost,
                                     unsigned int& cumulative_lost,
                                     unsigned int& extended_max,
                                     unsigned int& jitter, int& rtt_ms) const;
   virtual int GetRTPStatistics(const int video_channel,
                                unsigned int& bytes_sent,
                                unsigned int& packets_sent,
                                unsigned int& bytes_received,