tests.
Note: The webrtc/base/test/ folder is new.
Currently not used, I intend to use this in another CL.
BUG=chromium:627816
NOPRESUBMIT=TRUE
NOTRY=TRUE
Review-Url: https://codereview.webrtc.org/2238073003
Cr-Commit-Position: refs/heads/master@{#13750}
The test worked by sleeping a certain time, then checking that the
difference between recv timestamps before and after the sleep was
within some margin of the requested sleep time.
However, this means that imprecision of SleepMs makes the test flaky.
This source of flakiness can be removed by comparing to the actual
time slept instead of the requested time.
Also making the margin larger, to further reduce the likelihood of
flakiness.
R=pthatcher@webrtc.org, stefan@webrtc.org
Review URL: https://codereview.webrtc.org/2111043004 .
Cr-Commit-Position: refs/heads/master@{#13733}
magjed@ is the author of two out of three files in webrtc/base/java
(ThreadUtils.java and Size.java). They were originally created in
webrtc/api/android/java, but were moved to base/ in order to be
accessible from e.g. webrtc/modules/audio_device/android/java.
TBR=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/2233793002 .
Cr-Commit-Position: refs/heads/master@{#13707}
This prevents biased modulo arithmetic when selecting a character for a
random value from the provided table.
BUG=webrtc:5870
Review-Url: https://codereview.webrtc.org/2115793003
Cr-Commit-Position: refs/heads/master@{#13683}
RTC_CHECK in functions that return the random value.
BUG=webrtc:6072
Review-Url: https://codereview.webrtc.org/2119003002
Cr-Commit-Position: refs/heads/master@{#13682}
GCM cipher suites are optional (disabled by default) and can be enabled
through "PeerConnectionFactoryInterface::Options".
If compiled with Chromium (i.e. "ENABLE_EXTERNAL_AUTH" is defined), no
GCM ciphers can be used yet (see https://crbug.com/628400).
BUG=webrtc:5222, 628400
Review-Url: https://codereview.webrtc.org/1528843005
Cr-Commit-Position: refs/heads/master@{#13635}
This change makes WebRTC no longer stop sending video when we receive an
EWOULDBLOCK error from the operating system. This was previously
causing calls on a slow link (where the first hop is slow) to rapidly
oscillate between starting and stopping video.
We still do need to stop sending packets if there is no known good
connection we can use for that. We used to generate a synthetic
EWOULDBLOCK error in that case. This CL replaces it with a different
code (ENOTCONN); EWOULDBLOCK no longer stops the stream but ENOTCONN
does.
I've updated all the places where we seemed to be generating EWOULDBLOCK
for reasons other than some buffer been full; please give it a thorough
look in case I missed something.
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2192963002 .
Cr-Commit-Position: refs/heads/master@{#13566}
This CL fixes a crash that could happen when JSON event tracing is
shutting down. The cause of the crash was the fact that the logger
thread function was returning 'true', causing the platform thread to run
it repeatedly even though that wasn't the intention.
Usually the EventLogger::Stop() function would set the event requesting
the logging thread to clean up and close the file, and then immediately
call PlatformThread::Stop() which would stop the outer loop. The Log()
function would only run once and everything behaves as expected.
However, if a context switch happens between the shutdown_event_.Set()
and logging_thread_.Stop() calls in EventLogger::Stop(), the logger
thread function would close the file and exit the Log() method, while
PlatformThread will rerun it again. So the Log() function runs twice,
and the second time output_file_ is NULL which either causes the DCHECK
to fail (in debug builds) or the fprintf() to crash with SIGSEGV (in
release builds).
The fix simply changes the return value of the thread function to false
so it never runs twice.
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2168283002 .
Cr-Commit-Position: refs/heads/master@{#13510}
Necessary when compiling this file on a case-sensitive file system.
BUG=chromium:495204,chromium:617318
Review-Url: https://codereview.webrtc.org/2145373004
Cr-Commit-Position: refs/heads/master@{#13488}
After disabling all of these, the rest of the tests pass, at least on
my Nexus 7 device.
BUG=webrtc:4364
Review-Url: https://codereview.webrtc.org/2151823002
Cr-Commit-Position: refs/heads/master@{#13485}
This it to avoid requiring targets that include header files that in turn use SequenceTaskedChecker, to also have to define the macros needed by TaskQueue.
BUG=webrtc:5687
Review-Url: https://codereview.webrtc.org/2145393003
Cr-Commit-Position: refs/heads/master@{#13482}
It causes an asan initialization-order-fiasco in trying to read the
names of other globally constructed data:
==21449==ERROR: AddressSanitizer: initialization-order-fiasco on address 0x7f6f297bc5e8 at pc 0x7f6f26b332a7 bp 0x7ffd479f8cb0 sp 0x7ffd479f8ca8
READ of size 8 at 0x7f6f297bc5e8 thread T0
#0 0x7f6f26b332a6 in name
webrtc/base/flags.h:83:38
#1 0x7f6f26b332a6 in Lookup
webrtc/base/flags.cc:133
#2 0x7f6f26b332a6 in rtc::FlagList::Register(rtc::Flag*)
webrtc/base/flags.cc:260
#3 0x7f6f2529972b in __cxx_global_var_init.1
BUG=
Review-Url: https://codereview.webrtc.org/2110963004
Cr-Commit-Position: refs/heads/master@{#13479}
This updates how we initialize timer events to be the same way as we initialize non-timer events.
BUG=
Review-Url: https://codereview.webrtc.org/2147973002
Cr-Commit-Position: refs/heads/master@{#13468}
Reason for revert:
Upstream fixes in place, should be OK now.
Original issue's description:
> 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=
>
> Committed: https://crrev.com/e5dd44101eca485f5ad12e5f7ce6f6b0d204116b
> Cr-Commit-Position: refs/heads/master@{#13417}
TBR=tommi@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=
Review-Url: https://codereview.webrtc.org/2146013002
Cr-Commit-Position: refs/heads/master@{#13465}
event_set() has been deprecated and doesn't allow passing the main loop to be passed to initialize the event. event_assign() is the method to call in Event2 when available. However, we still need to be compatible with Chromium's version of libevent, so there's an #ifdef check in the meantime.
BUG=
Review-Url: https://codereview.webrtc.org/2141193002
Cr-Commit-Position: refs/heads/master@{#13454}
SequencedTaskChecker is a helper class used to help verify that some methods
of a class are called on the same task queue or thread. A
SequencedTaskChecker is bound to a a task queue if the object is
created on a task queue, or a thread otherwise.
BUG=webrtc:5687
Review-Url: https://codereview.webrtc.org/2125113003
Cr-Commit-Position: refs/heads/master@{#13452}
The issue was that if the main entry routine of the thread would get called before the first APC, the thread would hang on a GetMessage() call and the APC sent to initialize the thread, would never run.
BUG=
Review-Url: https://codereview.webrtc.org/2139723003
Cr-Commit-Position: refs/heads/master@{#13438}
Reason for revert:
It keeps breaking upstream.
Original issue's description:
> 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
>
> Committed: 05ce4ae31fTBR=tommi@webrtc.org,sprang@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/2130423002
Cr-Commit-Position: refs/heads/master@{#13419}
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: 5fc59e810bTBR=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}
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}
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}
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}
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}
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}
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}
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}