889 Commits

Author SHA1 Message Date
Erik Språng
05ce4ae31f Reland Issue 2061423003: Refactor NACK bitrate allocation
This is a reland of https://codereview.webrtc.org/2061423003/
Which was reverted in https://codereview.webrtc.org/2131913003/

The reason for the revert was that some upstream code used
RtpSender::SetTargetBitrate(). I've added that back as a no-op until we
it's been brought up to date.

TBR=tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13418}
2016-07-08 17:11:23 +00:00
sprang
e5dd44101e Revert of Refactor NACK bitrate allocation (patchset #16 id:300001 of https://codereview.webrtc.org/2061423003/ )
Reason for revert:
Breaks upstream code.

Original issue's description:
> Refactor NACK bitrate allocation
>
> Nack bitrate allocation should not be done on a per-rtp-module basis,
> but rather shared bitrate pool per call. This CL moves allocation to the
> pacer and cleans up a bunch if bitrate stats handling.
>
> BUG=
> R=danilchap@webrtc.org, stefan@webrtc.org, tommi@webrtc.org
>
> Committed: 5fc59e810b

TBR=tommi@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.webrtc.org/2131913003
Cr-Commit-Position: refs/heads/master@{#13417}
2016-07-08 16:39:02 +00:00
Erik Språng
5fc59e810b Refactor NACK bitrate allocation
Nack bitrate allocation should not be done on a per-rtp-module basis,
but rather shared bitrate pool per call. This CL moves allocation to the
pacer and cleans up a bunch if bitrate stats handling.

BUG=
R=danilchap@webrtc.org, stefan@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13416}
2016-07-08 16:15:29 +00:00
andresp
cdf6172b7f Replace reentrant ASSERT checks in MessageQueueManager with a non-racy version.
ASSERT(!crit_.CurrentThreadIsOwner()) was racy due to use of a rtc::IsThreadRefEqual which cannot compare the thread handlers without a lock unless one is already sure it is the thread owning the crit.

Review-Url: https://codereview.webrtc.org/2131503002
Cr-Commit-Position: refs/heads/master@{#13411}
2016-07-08 09:45:47 +00:00
andresp
388d8e92b8 Remove unused CriticalSection::IsLocked()
Review-Url: https://codereview.webrtc.org/2128583003
Cr-Commit-Position: refs/heads/master@{#13409}
2016-07-08 08:19:41 +00:00
thakis
d7d3e05ca6 mac: Remove unused GetQuickTimeVersion().
The function uses a deprecated function and is unused, so delete it.

BUG=6027
NOTRY=true

Review-Url: https://codereview.webrtc.org/2114013002
Cr-Commit-Position: refs/heads/master@{#13400}
2016-07-06 18:03:20 +00:00
thakis
0cf208aa28 mac: Make GetOSVersion() private to a cc file.
Everything calls GetOSVersionName() instead, so no need to expose that.
Since it uses deprecated functions, this will make it easier to rewrite
it in a future change.

BUG=webrtc:6027
NOTRY=true

Review-Url: https://codereview.webrtc.org/2117823002
Cr-Commit-Position: refs/heads/master@{#13399}
2016-07-06 17:46:49 +00:00
ossu
63fb95a68d Fixed time moving backwards in the AudioCodingModule.
There was a fast path in PreprocessToAddData that would just use the
input timestamps if the input format was equal to the required format of
the encoder. This works well as long as the codec never changes. If we
are first doing resampling (specifically upsampling) and then change to
a codec that does not require resampling, we'll need to stick to
whatever input timestamp we left off at, rather than silently accepting
whatever we're sent.

BUG=622435

Review-Url: https://codereview.webrtc.org/2119393002
Cr-Commit-Position: refs/heads/master@{#13398}
2016-07-06 16:34:31 +00:00
Honghai Zhang
5622c5eae5 If continual gathering is enabled,
we will periodically check if any network does not have any connection on it and if yes, attempt to re-gather on those networks.

BUG=
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13367}
2016-07-01 20:59:39 +00:00
Peter Boström
02bafc6379 Add a race-checking mechanism.
Permits CHECKing/DCHECKing that methods are being accessed in a
thread-safe manner, even if they are not used by one single thread
(thread pools such as VideoToolbox OK).

BUG=
R=danilchap@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13358}
2016-07-01 10:45:29 +00:00
ossu
ea41694e08 Added an empty member to the union of rtc::Optional, so that it is always initializable.
Added notry due to flaky android_dbg bot.

NOTRY=true
BUG=webrtc:6033

Review-Url: https://codereview.webrtc.org/2090223003
Cr-Commit-Position: refs/heads/master@{#13343}
2016-06-30 09:15:00 +00:00
skvlad
4c4cb5b984 Separate the JNI function that controls logging levels into two.
The parameters for Logging.enableTracing() were creating the impression
that they control level and severity of one tracing system and they are
meant to be used together. In fact the "levels" parameter controlled one
tracing system (WEBRTC_TRACE), and the "severity" parameter was
responsible for a completely different one: setting the severity level
above which log messages from LOG() will be directed to the
platform-specific debug output (logcat on Android).

The method signature suggested that the "path" parameter applied to both
systems - while it was only meaningful for the WEBRTC_TRACE; LOG
messages were directed to ADB logcat no matter what the Path value was.
It is possible to redirect LOG messages to a file, but that is done
using a completely different set of APIs
 - PeerConnectionFactory.startInternalTracingCapture().

I've separated these two methods to make it more clear which of the
parameters controls which system.

NOTRY=true

Review-Url: https://codereview.webrtc.org/2110853003
Cr-Commit-Position: refs/heads/master@{#13334}
2016-06-29 22:30:48 +00:00
Taylor Brandstetter
54433e72aa Fixing flakiness of TestDetectUnresolvedProxy.
If the AutoDetectProxy timed out resolving one address, it was
attempting to use the same resolver to resolve the next address,
which would always result in an assertion. This happened recently
a couple times on the Windows DrMemory bot because of its slowness.

TBR=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13326}
2016-06-29 17:10:38 +00:00
Sami Kalliomaki
9c0c75bd6e Add GN targets for AppRTC Demo on Android.
Adds GN equivalents for following targets:
AppRTCDemo          -> //webrtc/examples:AppRTCDemo
AppRTCDemo_apk      -> //webrtc/examples:AppRTCDemo_lib (kind of)
AppRTCDemoJUnitTest -> //webrtc/examples:AppRTCDemoJUnitTest
AppRTCDemoTest      -> //webrtc/examples:AppRTCDemoTest
libjingle_peerconnection_java -> //webrtc/api/libjingle_peerconnection_java
libjingle_peerconnection_so   -> //webrtc/api/libjingle_peerconnection_so

New GN targets:
//webrtc/base:base_java
//webrtc/examples:AppRTCDemo_resources
//webrtc/examples/androidapp/third_party/autobanh:autobanh_java

BUG=webrtc:6035
R=magjed@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13322}
2016-06-29 12:55:12 +00:00
Taylor Brandstetter
f8e65779a7 Add virtual Initialize methods to PortAllocator and NetworkManager.
This will allow PeerConnection to handle hopping to the right thread
and doing thread-specific initialization for the PortAllocator.
This eliminates a required thread-hop for whatever is passing the
PortAllocator into CreatePeerConnection.

BUG=617648
R=pthatcher@webrtc.org, skvlad@webrtc.org

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

Committed: https://crrev.com/a6bdb0990a659ff9e7c4374f5033a6bcc4fbfb21
Cr-Original-Commit-Position: refs/heads/master@{#13283}
Cr-Commit-Position: refs/heads/master@{#13306}
2016-06-28 00:20:25 +00:00
Taylor Brandstetter
716d07a241 Using fake clock for TURN port tests and un-disabling some tests.
The fake clock has a few advantages:
1. It lets use verify that operations take the expected number of
   round trips.
2. It makes the tests faster by letting us remove the equivalent
   of "Sleep(500)" all over the tests.
3. It makes the tests less flaky, because sometimes sleeping for
   500ms or waiting for 1s is not enough.

R=honghaiz@webrtc.org, pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13304}
2016-06-27 21:07:51 +00:00
Honghai Zhang
56c0b20490 Return both IPv6 and IPv4 address from the lookup.
We currently only return IPv4 address, which may cause issues in IPv6 networks
if we provide host name as the turn servers.

BUG=webrt:5871
R=juberti@google.com, pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13291}
2016-06-27 05:11:24 +00:00
deadbeef
ba8d4337b7 Revert of Add virtual Initialize methods to PortAllocator and NetworkManager. (patchset #4 id:60001 of https://codereview.webrtc.org/2097653002/ )
Reason for revert:
Didn't intend to land yet. Chromium CL still needed.

Original issue's description:
> Add virtual Initialize methods to PortAllocator and NetworkManager.
>
> This will allow PeerConnection to handle hopping to the right thread
> and doing thread-specific initialization for the PortAllocator.
> This eliminates a required thread-hop for whatever is passing the
> PortAllocator into CreatePeerConnection.
>
> BUG=617648
> R=pthatcher@webrtc.org, skvlad@webrtc.org
>
> Committed: https://crrev.com/a6bdb0990a659ff9e7c4374f5033a6bcc4fbfb21
> Cr-Commit-Position: refs/heads/master@{#13283}

TBR=pthatcher@webrtc.org,skvlad@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=617648

Review-Url: https://codereview.webrtc.org/2092023004
Cr-Commit-Position: refs/heads/master@{#13284}
2016-06-24 21:05:19 +00:00
Taylor Brandstetter
a6bdb0990a Add virtual Initialize methods to PortAllocator and NetworkManager.
This will allow PeerConnection to handle hopping to the right thread
and doing thread-specific initialization for the PortAllocator.
This eliminates a required thread-hop for whatever is passing the
PortAllocator into CreatePeerConnection.

BUG=617648
R=pthatcher@webrtc.org, skvlad@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13283}
2016-06-24 21:04:11 +00:00
honghaiz
059e183419 Reland of "Revert of Update the BWE when the network route changes. (patchset #5 id:180001 of https://… (patchset #1 id:1 of https://codereview.webrtc.org/2098703004/ )
Reason for revert:
It turns out this revert was not necessary because the connection-state mapping for turn-turn connections was not done in connection.

Original issue's description:
> Revert of Revert "Revert of Update the BWE when the network route changes. (patchset #5 id:180001 of https://… (patchset #5 id:120001 of https://codereview.webrtc.org/2041593002/ )
>
> Reason for revert:
> ReadyToSendMedia did not consider the new presumed_writable state.
>
> Original issue's description:
> > Revert "Revert of Update the BWE when the network route changes. (patchset #5 id:180001 of https://codereview.webrtc.org/2000063003/ )"
> >
> > This reverts commit 72d41aa6da94dacb8a8464d1abd4ca7d1afffc65.
> >
> > New change made:
> > Do not reset the BWE when the new network route is not ready to send media.
> >
> > BUG=
> > R=pthatcher@webrtc.org, stefan@webrtc.org
> >

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

Review-Url: https://codereview.webrtc.org/2094863003
Cr-Commit-Position: refs/heads/master@{#13282}
2016-06-24 18:04:00 +00:00
honghaiz
ae4d0d922b Revert of Revert "Revert of Update the BWE when the network route changes. (patchset #5 id:180001 of https://… (patchset #5 id:120001 of https://codereview.webrtc.org/2041593002/ )
Reason for revert:
ReadyToSendMedia did not consider the new presumed_writable state.

Original issue's description:
> Revert "Revert of Update the BWE when the network route changes. (patchset #5 id:180001 of https://codereview.webrtc.org/2000063003/ )"
>
> This reverts commit 72d41aa6da94dacb8a8464d1abd4ca7d1afffc65.
>
> New change made:
> Do not reset the BWE when the new network route is not ready to send media.
>
> BUG=
> R=pthatcher@webrtc.org, stefan@webrtc.org
>
> Committed: https://crrev.com/5b5d2cdad7018993272525a723ef34f7da5c45f2
> Cr-Commit-Position: refs/heads/master@{#13280}

TBR=pthatcher@webrtc.org,stefan@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.webrtc.org/2098703004
Cr-Commit-Position: refs/heads/master@{#13281}
2016-06-24 17:06:25 +00:00
Honghai Zhang
5b5d2cdad7 Revert "Revert of Update the BWE when the network route changes. (patchset #5 id:180001 of https://codereview.webrtc.org/2000063003/ )"
This reverts commit 72d41aa6da94dacb8a8464d1abd4ca7d1afffc65.

New change made:
Do not reset the BWE when the new network route is not ready to send media.

BUG=
R=pthatcher@webrtc.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13280}
2016-06-24 17:01:01 +00:00
kwiberg
3f81fcd2e8 Don't recreate the speech encoder if we don't have to
If the specification for the speech encoder hasn't changed, we should
reuse it instead of recreating it. Otherwise, we lose its state. (This
problem was originally discovered because AudioEncoderOpus instances
would forget that they were supposed to be using DTX.)

BUG=webrtc:6020, chromium:622647

Review-Url: https://codereview.webrtc.org/2089183002
Cr-Commit-Position: refs/heads/master@{#13273}
2016-06-23 10:58:45 +00:00
honghaiz
079a7a197f Reland of Do not delete a connection in the turn port with permission error or refresh error. (patchset #1 id:1 of https://codereview.webrtc.org/2090833002/ )
Reason for revert:
The Webrtc waterfall indicates that this revert is not necessary.

Original issue's description:
> Revert of Do not delete a connection in the turn port with permission error or refresh error. (patchset #6 id:260001 of https://codereview.webrtc.org/2068263003/ )
>
> Reason for revert:
> It broke webrtc builds.
>
> Original issue's description:
> > Do not delete a connection in the turn port with permission error,  refresh error, or binding error.
> >
> > Even if those error happened, the connection may still be able to receive packets for a while.
> > If we delete the connections, all packets arriving will be dropped.
> >
> > BUG=webrtc:6007
> > R=deadbeef@webrtc.org, pthatcher@webrtc.org
> >
> > Committed: https://crrev.com/3d77deb29c15bfb8f794ef3413837a0ec0f0c131
> > Cr-Commit-Position: refs/heads/master@{#13262}
>
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:6007
>
> Committed: https://crrev.com/3159ffae6b1d5cba2ad972bd3d8074ac85f2c7f9
> Cr-Commit-Position: refs/heads/master@{#13265}

TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6007

Review-Url: https://codereview.webrtc.org/2090073003
Cr-Commit-Position: refs/heads/master@{#13266}
2016-06-22 23:27:08 +00:00
honghaiz
3159ffae6b Revert of Do not delete a connection in the turn port with permission error or refresh error. (patchset #6 id:260001 of https://codereview.webrtc.org/2068263003/ )
Reason for revert:
It broke webrtc builds.

Original issue's description:
> Do not delete a connection in the turn port with permission error,  refresh error, or binding error.
>
> Even if those error happened, the connection may still be able to receive packets for a while.
> If we delete the connections, all packets arriving will be dropped.
>
> BUG=webrtc:6007
> R=deadbeef@webrtc.org, pthatcher@webrtc.org
>
> Committed: https://crrev.com/3d77deb29c15bfb8f794ef3413837a0ec0f0c131
> Cr-Commit-Position: refs/heads/master@{#13262}

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6007

Review-Url: https://codereview.webrtc.org/2090833002
Cr-Commit-Position: refs/heads/master@{#13265}
2016-06-22 23:18:37 +00:00
Honghai Zhang
3d77deb29c Do not delete a connection in the turn port with permission error, refresh error, or binding error.
Even if those error happened, the connection may still be able to receive packets for a while.
If we delete the connections, all packets arriving will be dropped.

BUG=webrtc:6007
R=deadbeef@webrtc.org, pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13262}
2016-06-22 23:01:55 +00:00
nisse
191b359d0d Implement timestamp translation/filter in VideoCapturer.
Use in AndroidVideoCapturer.

BUG=webrtc:5740

Review-Url: https://codereview.webrtc.org/2017443003
Cr-Commit-Position: refs/heads/master@{#13254}
2016-06-22 15:36:58 +00:00
deadbeef
d685fef94c Use the new API to set the BoringSSL time callback.
Review-Url: https://codereview.webrtc.org/2070693003
Cr-Commit-Position: refs/heads/master@{#13224}
2016-06-20 19:00:48 +00:00
kwiberg
c853597598 rtc::Buffer: Grow capacity by at least 1.5x to prevent quadratic behavior
BUG=webrtc:6009

Review-Url: https://codereview.webrtc.org/2078873005
Cr-Commit-Position: refs/heads/master@{#13214}
2016-06-20 11:47:46 +00:00
sakal
e6c9e88c18 Android: Add Size class.
The Camera1 and Camera2 API use different size types. Camera1 uses
android.hardware.Camera.Size while Camera2 uses android.util.Size.
android.util.Size is only available from Lollipop forward so this CL
adds a similar Size class in CaptureFormat.

The purpose of this CL is to have a common size type that can be reused
from both Camera1 and Camera2 helper functions such as
CameraEnumerationAndroid.getClosestSupportedSize().

BUG=webrtc:5519

Review-Url: https://codereview.webrtc.org/2066773002
Cr-Commit-Position: refs/heads/master@{#13181}
2016-06-17 08:02:10 +00:00
Erik Språng
1642620a7d Performance fix for H264 RBSP parsing.
An rtc::Buffer is used to write output of RBSP parsing, usually one byte
at a time. It turns out that container will then expand its capacity one
byte at a time, for each byte reallocating the whole buffer and copying
the contents over, turning this into an O(n^2) operation.

Fix is for now only to preallocate the container storage. Longer term, I
think we should mull over if we really need custom containers...

R=pbos@webrtc.org
TBR=mflodman@webrtc.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#13167}
2016-06-16 13:54:58 +00:00
Niels Möller
b00dc386d3 Delete GetExecutablePath and related unused code.
The function GetExecutablePath is a hack with poor portability. Delete
it and its caller GetTestFilePath. The latter was used in
videoframe_unittest.h, where it is replaced by
webrtc::test::ResourcePath.

Delete unused functions declared in base/testutils.h: ReadFile,
GetSiblingDirectory, GetGoogle3Directory, GetTalkDirectory,
CmpHelperFileEq, EXPECT_FILEEQ, ASSERT_FILEEQ.

Delete unused functions declared in media/base/testutils.h:
GetTestFilePath (see above), LoadPlanarYuvTestImage,
DumpPlanarYuvTestImage, ComputePSNR, ComputeSumSquareError.

The functions LoadPlanarYuvTestImage, DumpPlanarYuvTestImage were used
in yuvscaler_unittests.cc and planarfunctions_unittests.cc, under
webrtc/pc. However, these tests are never compiled or run, and appear
not to have been for the last few years, and are therefore deleted
rather than updated. It might make sense to check if libyuv have
comparable tests, and if not, resurrect them as part of libyuv
unittests.

BUG=
R=perkj@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13163}
2016-06-16 10:44:44 +00:00
Taylor Brandstetter
4f0dfbd213 Change initial DTLS retransmission timer from 1 second to 50ms.
This will help ensure a timely DTLS handshake when there's packet
loss. It will likely result in spurious retransmissions (since the
RTT is usually > 50ms), but since exponential backoff is still used,
there will at most be ~4 extra retransmissions. For a time-sensitive
application like WebRTC this seems like a reasonable tradeoff.

R=pthatcher@webrtc.org, juberti@chromium.org, juberti@webrtc.org

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

Committed: https://crrev.com/1e435628366fb9fed71632369f05928ed857d8ef
Cr-Original-Commit-Position: refs/heads/master@{#12853}
Cr-Commit-Position: refs/heads/master@{#13159}
2016-06-16 00:15:35 +00:00
tommi
42883f8b85 Revert of Attempt to figure out what the issue is on the Win10 FYI build bot in content_browsertests. (patchset #1 id:1 of https://codereview.webrtc.org/2063313003/ )
Reason for revert:
Reverting after experiment.  What seems to happen is that the thread can't be stopped when PostThreadMessage fails with this error code (or lack thereof).

Original issue's description:
> Attempt to figure out what the issue is on the Win10 FYI build bot in content_browsertests.
> Check for the case when PostThreadMessage returns false but GetLastError returns ERROR_SUCCESS.
>
> TBR=olka
> NOTRY=true
>
> Committed: https://crrev.com/e11041159d6e66fb25c2e045ad1558fc99d2d6cd
> Cr-Commit-Position: refs/heads/master@{#13143}

TBR=olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.webrtc.org/2067013003
Cr-Commit-Position: refs/heads/master@{#13147}
2016-06-14 23:06:35 +00:00
tommi
e11041159d Attempt to figure out what the issue is on the Win10 FYI build bot in content_browsertests.
Check for the case when PostThreadMessage returns false but GetLastError returns ERROR_SUCCESS.

TBR=olka
NOTRY=true

Review-Url: https://codereview.webrtc.org/2063313003
Cr-Commit-Position: refs/heads/master@{#13143}
2016-06-14 21:38:04 +00:00
honghaiz
4deba9adf1 Add SigslotTester0 for testing signals without argument.
BUG=

Review-Url: https://codereview.webrtc.org/2066443003
Cr-Commit-Position: refs/heads/master@{#13141}
2016-06-14 19:49:54 +00:00
tommi
8b06ec0b71 Change RTC_CHECK to RTC_CHECK_EQ for improved printout of GetLastError.
TBR=olka@webrtc.org
NOTRY=true

Review-Url: https://codereview.webrtc.org/2061923004
Cr-Commit-Position: refs/heads/master@{#13134}
2016-06-14 15:38:14 +00:00
nisse
7336225505 Delete left-over files.
References from Chrome's build files are gone with
https://codereview.chromium.org/2054763002/ and
https://codereview.chromium.org/2056243003/

BUG=

Review-Url: https://codereview.webrtc.org/2063703002
Cr-Commit-Position: refs/heads/master@{#13123}
2016-06-14 08:54:52 +00:00
kjellander
781e0c03a2 GN: Fix 32-bit Mac library error
The error hasn't been noticed since we don't really do
(or support) Mac 32-bit builds.

BUG=webrtc:5949
NOTRY=True

Review-Url: https://codereview.webrtc.org/2065583002
Cr-Commit-Position: refs/heads/master@{#13111}
2016-06-13 12:41:20 +00:00
kjellander
82a94494b1 GN: Add rtc_media_unittests
Changes:
* Set WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE on a global scope
  to match GYP.
* Enable sctpdataengine_unittest.cc for iOS, which should have
  been done in https://codereview.webrtc.org/1587193006
* Renamed GN target rtc_base_test_utils -> rtc_base_tests_utils
  to match GYP.
* Added dependencies on call, modules/video_coding and video for
  rtc_media.
* Added dependency on audio for rtc_media_unitttests (couldn't be
  added to rtc_media due to circular dependency problem).

BUG=webrtc:5949
TESTED=Built and ran the tests on Mac.
NOTRY=True

Review-Url: https://codereview.webrtc.org/2050313002
Cr-Commit-Position: refs/heads/master@{#13106}
2016-06-13 05:12:10 +00:00
skvlad
979c268830 Do not reconnect the network change signal each time the network manager is started
Due to a bug, the NetworkManager was reconnecting to the NetworkMonitor's NetworkChanged signal every time the network manager is stopped and restarted. After each calls, one more listener was added to the signal and never removed - which caused OnNetworksChanged to be called multiple times on each actual network change.

Not sure if this had any negative effect other than the extraneous "Network changed" lines in WebRTC logs, but it wasn't working correctly either way.
The fix is to only subscribe to the signal once, when the NetworkMonitor is created.

TBR=pthatcher
BUG=
NOTRY=True

Review-Url: https://codereview.webrtc.org/2054583002
Cr-Commit-Position: refs/heads/master@{#13105}
2016-06-10 22:26:24 +00:00
Taylor Brandstetter
5d97a9a05b Adding more detail to MessageQueue::Dispatch logging.
Every message will now be traced with the location from which it was
posted, including function name, file and line number.

This CL also writes a normal LOG message when the dispatch took more
than a certain amount of time (currently 50ms).

This logging should help us identify messages that are taking
longer than expected to be dispatched.

R=pthatcher@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13104}
2016-06-10 21:17:33 +00:00
Erik Språng
51e60305e6 Update RateStatistics to handle too-little-data case.
To avoid the case where a single data point or too short window is used,
causing bad behavior due to bad stats, update RateStatistics to return
an Optional rather than a plain rate.

There was also a strange off by one bug where the rate was slightly
overestimated (N + 1 buckets, N ms time window).

These changes requires updates to a number of places, and may very well
cause seeming perf regressions (but the stats were probablty more wrong
previously).

BUG=
R=mflodman@webrtc.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13103}
2016-06-10 20:13:33 +00:00
danilchap
8e85b3c349 Moves macros ACCESS_ON/RUN_ON from thread_annotations to thread_checker
to be compatible with projects that has own base/thread_annotation.h

NOTRY=TRUE

Review-Url: https://codereview.webrtc.org/2055473002
Cr-Commit-Position: refs/heads/master@{#13090}
2016-06-09 14:55:32 +00:00
sergeyu
f2a1c89241 Add r-value constructor for RefCountedObject.
Previously RefCountedObject was passing all parameters by value.
This meant that it was hard to use it with movable types, such
as unique_ptr<>. Now there is a constructor that takes r-value,
which means that RefCountedObject<std::unique_ptr<foo>> can be
initialized by passing std::unique_ptr<foo> to the constructor.

Review-Url: https://codereview.webrtc.org/2036123002
Cr-Commit-Position: refs/heads/master@{#13079}
2016-06-08 22:52:28 +00:00
kjellander
3bcedd3595 GN: Add SDK tests to rtc_unittests.
In https://codereview.webrtc.org/2034923003 it was discovered
that a test binary rtc_sdk_peerconnection_objc_tests was
a dependency to rtc_unittests. Unfortunately gtest doesn't
include dependent executables into the same test executable;
only libraries (so theses tests weren't run).

This CL incorporates those tests into rtc_unittests and
does the same changes to the GN build.

BUG=webrtc:5949
TESTED=Built and ran rtc_unittests locally on Mac.
NOTRY=True

Review-Url: https://codereview.webrtc.org/2041743003
Cr-Commit-Position: refs/heads/master@{#13060}
2016-06-08 08:14:22 +00:00
kjellander@webrtc.org
aff499c9bf GN: Fix errors in rtc_include_tests conditions
https://codereview.webrtc.org/2043873003 forgot to flip the
logic.

BUG=webrtc:5949
TBR=phoglund@webrtc.org
NOTRY=True

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

Cr-Commit-Position: refs/heads/master@{#13055}
2016-06-06 21:04:16 +00:00
kjellander
e72db17556 GN: Use rtc_include_tests variable to exclude tests.
This is closer to what the GYP build does, and is more readable.

BUG=webrtc:5949
TBR=phoglund@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2043873003
Cr-Commit-Position: refs/heads/master@{#13054}
2016-06-06 21:00:09 +00:00
deadbeef
f5f03e823c Reland of: Improving the fake clock and using it to fix a flaky STUN timeout test.
When the fake clock's time is advanced, it now ensures all pending
queued messages have been dispatched. This allows us to write a
"SIMULATED_WAIT" macro that ticks the simulated clock by milliseconds up
until the target time.

Useful in this case, where we know the STUN timeout should take a total
of 9500ms, but it would be overly complex to write test code that waits
for each individual timeout, ensures a STUN packet has been
retransmited, etc.

(The test described above *should* be written, but it belongs in
p2ptransportchannel_unittest.cc, not webrtcsession_unittest.cc).

Review-Url: https://codereview.webrtc.org/2024813004
Cr-Commit-Position: refs/heads/master@{#13052}
2016-06-06 18:16:13 +00:00
deadbeef
f83a94a41e Revert of Improving the fake clock and using it to fix a flaky STUN timeout test. (patchset #10 id:180001 of https://codereview.webrtc.org/2024813004/ )
Reason for revert:
There seems to be a TSan warning that wasn't caught by the trybot: https://build.chromium.org/p/client.webrtc/builders/Linux%20Tsan%20v2/builds/6732/steps/peerconnection_unittests/logs/stdio

Apparently a thread is still alive even after destroying WebRTCSession. Need to think of a way to fix this, without adding a critical section around g_clock (since that would hurt performance).

Original issue's description:
> Improving the fake clock and using it to fix a flaky STUN timeout test.
>
> When the fake clock's time is advanced, it now ensures all pending
> queued messages have been dispatched. This allows us to write a
> "SIMULATED_WAIT" macro that ticks the simulated clock by milliseconds up
> until the target time.
>
> Useful in this case, where we know the STUN timeout should take a total
> of 9500ms, but it would be overly complex to write test code that waits
> for each individual timeout, ensures a STUN packet has been
> retransmited, etc.
>
> (The test described above *should* be written, but it belongs in
> p2ptransportchannel_unittest.cc, not webrtcsession_unittest.cc).
>
> Committed: https://crrev.com/ffbe0e17e2c9b7fe101023acf40574dc0c95631a
> Cr-Commit-Position: refs/heads/master@{#13043}

TBR=pthatcher@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.webrtc.org/2038213002
Cr-Commit-Position: refs/heads/master@{#13045}
2016-06-03 23:05:30 +00:00