Revert of Add experiment on weak ping delay during call set up time (patchset #1 id:1 of https://codereview.webrtc.org/1406153005/ )

Reason for revert:
Still cause break on mac. reverting it again.

Original issue's description:
> Reland of Add experiment on weak ping delay during call set up time (patchset #1 id:1 of https://codereview.webrtc.org/1423443002/ )
>
> Reason for revert:
> This should be safe to land now.
>
> Original issue's description:
> > Revert of Add experiment on weak ping delay during call set up time (patchset #4 id:60001 of https://codereview.webrtc.org/1411883002/ )
> >
> > Reason for revert:
> > guoweis - Here's the target that's failing:
> > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/libjingle/libjingle_nacl.gyp&l=17
> >
> > This has unfortunately been causing problems repeatedly for us since libjingle_nacl is maintained separately from libjingle (I don't know the history).
> >
> > The way this works for Chrome in general is that the FindFullName method is implemented in init_webrtc.cc in the overrides folder in Chrome and that hooks WebRTC up with Chrome's implementation.  I'm not sure if that's the right thing to do for nacl, how webrtc is initialized there etc.  I'll ping the nacl team for some help too offline and include you.  Reverting this change for now.
> >
> > Original issue's description:
> > > Add experiment on weak ping delay during call set up time
> > >
> > > BUG=
> > > R=pthatcher@webrtc.org
> > >
> > > Committed: https://crrev.com/3bf69b15f4c0c0ca4ab17c237084684a37bb8279
> > > Cr-Commit-Position: refs/heads/master@{#10343}
> >
> > TBR=pthatcher@webrtc.org,juberti@webrtc.org,guoweis@webrtc.org
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=
> >
> > Committed: https://crrev.com/a01d44022355796d4fd86d00aae6d3263573b6f1
> > Cr-Commit-Position: refs/heads/master@{#10350}
>
> TBR=pthatcher@webrtc.org,juberti@webrtc.org,tommi@webrtc.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=
>
> Committed: https://crrev.com/e26ce1b7a4644942b239ed788a737200762db3b3
> Cr-Commit-Position: refs/heads/master@{#10379}

TBR=pthatcher@webrtc.org,juberti@webrtc.org,tommi@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.webrtc.org/1413843003

Cr-Commit-Position: refs/heads/master@{#10380}
This commit is contained in:
guoweis 2015-10-22 18:00:39 -07:00 committed by Commit bot
parent e26ce1b7a4
commit 4f6a8b5f55
2 changed files with 22 additions and 34 deletions

View File

@ -19,13 +19,32 @@
#include "webrtc/base/crc32.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/stringencode.h"
#include "webrtc/system_wrappers/interface/field_trial.h"
namespace {
// messages for queuing up work for ourselves
enum { MSG_SORT = 1, MSG_CHECK_AND_PING };
// When the socket is unwritable, we will use 10 Kbps (ignoring IP+UDP headers)
// for pinging. When the socket is writable, we will use only 1 Kbps because
// we don't want to degrade the quality on a modem. These numbers should work
// well on a 28.8K modem, which is the slowest connection on which the voice
// quality is reasonable at all.
static const uint32_t PING_PACKET_SIZE = 60 * 8;
// STRONG_PING_DELAY (480ms) is applied when the best connection is both
// writable and receiving.
static const uint32_t STRONG_PING_DELAY = 1000 * PING_PACKET_SIZE / 1000;
// WEAK_PING_DELAY (48ms) is applied when the best connection is either not
// writable or not receiving.
static const uint32_t WEAK_PING_DELAY = 1000 * PING_PACKET_SIZE / 10000;
// If the current best connection is both writable and receiving, then we will
// also try hard to make sure it is pinged at this rate (a little less than
// 2 * STRONG_PING_DELAY).
static const uint32_t MAX_CURRENT_STRONG_DELAY = 900;
static const int MIN_CHECK_RECEIVING_DELAY = 50; // ms
// The minimum improvement in RTT that justifies a switch.
static const double kMinImprovement = 10;
@ -181,27 +200,6 @@ bool ShouldSwitch(cricket::Connection* a_conn,
namespace cricket {
// When the socket is unwritable, we will use 10 Kbps (ignoring IP+UDP headers)
// for pinging. When the socket is writable, we will use only 1 Kbps because
// we don't want to degrade the quality on a modem. These numbers should work
// well on a 28.8K modem, which is the slowest connection on which the voice
// quality is reasonable at all.
static const uint32_t PING_PACKET_SIZE = 60 * 8;
// STRONG_PING_DELAY (480ms) is applied when the best connection is both
// writable and receiving.
static const uint32_t STRONG_PING_DELAY = 1000 * PING_PACKET_SIZE / 1000;
// WEAK_PING_DELAY (48ms) is applied when the best connection is either not
// writable or not receiving.
const uint32_t WEAK_PING_DELAY = 1000 * PING_PACKET_SIZE / 10000;
// If the current best connection is both writable and receiving, then we will
// also try hard to make sure it is pinged at this rate (a little less than
// 2 * STRONG_PING_DELAY).
static const uint32_t MAX_CURRENT_STRONG_DELAY = 900;
static const int MIN_CHECK_RECEIVING_DELAY = 50; // ms
P2PTransportChannel::P2PTransportChannel(const std::string& transport_name,
int component,
P2PTransport* transport,
@ -222,14 +220,7 @@ P2PTransportChannel::P2PTransportChannel(const std::string& transport_name,
remote_candidate_generation_(0),
gathering_state_(kIceGatheringNew),
check_receiving_delay_(MIN_CHECK_RECEIVING_DELAY * 5),
receiving_timeout_(MIN_CHECK_RECEIVING_DELAY * 50) {
uint32_t weak_ping_delay = ::strtoul(
webrtc::field_trial::FindFullName("WebRTC-StunInterPacketDelay").c_str(),
nullptr, 10);
if (weak_ping_delay) {
weak_ping_delay_ = weak_ping_delay;
}
}
receiving_timeout_(MIN_CHECK_RECEIVING_DELAY * 50) {}
P2PTransportChannel::~P2PTransportChannel() {
ASSERT(worker_thread_ == rtc::Thread::Current());
@ -1166,7 +1157,7 @@ void P2PTransportChannel::OnCheckAndPing() {
UpdateConnectionStates();
// When the best connection is either not receiving or not writable,
// switch to weak ping delay.
int ping_delay = weak() ? weak_ping_delay_ : STRONG_PING_DELAY;
int ping_delay = weak() ? WEAK_PING_DELAY : STRONG_PING_DELAY;
if (rtc::Time() >= last_ping_sent_ms_ + ping_delay) {
Connection* conn = FindNextPingableConnection();
if (conn) {

View File

@ -34,8 +34,6 @@
namespace cricket {
extern const uint32_t WEAK_PING_DELAY;
// Adds the port on which the candidate originated.
class RemoteCandidate : public Candidate {
public:
@ -254,7 +252,6 @@ class P2PTransportChannel : public TransportChannelImpl,
int receiving_timeout_;
uint32_t last_ping_sent_ms_ = 0;
bool gather_continually_ = false;
int weak_ping_delay_ = WEAK_PING_DELAY;
RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
};