But keep #including scoped_ptr.h in .h files, so as not to break
WebRTC users who expect those .h files to give them rtc::scoped_ptr.
BUG=webrtc:5520
Review-Url: https://codereview.webrtc.org/1937693002
Cr-Commit-Position: refs/heads/master@{#12581}
This propagated into various other places. Also had to #include headers that
were implicitly pulled by "scoped_ptr.h".
BUG=webrtc:5520
Review URL: https://codereview.webrtc.org/1920043002
Cr-Commit-Position: refs/heads/master@{#12501}
CalculateFrequency() results in zero frequency (floating point) if the RTP timestamps in the RTCP list are equal.
Added check in UpdateRtcpList to not insert RTCP SR with the same RTP timestamp.
BUG=webrtc:5780
Review URL: https://codereview.webrtc.org/1891703002
Cr-Commit-Position: refs/heads/master@{#12429}
We can (and should) use std::vector<std::unique_ptr<T>> instead.
Because it's standard, and because it's safer since callers have to
manually wrap elements in std::unique_ptr before inserting them and
manually unwrap them after inserting them.
Review URL: https://codereview.webrtc.org/1839603002
Cr-Commit-Position: refs/heads/master@{#12182}
The intended signalling from StartTimer() to Process() is that
created_at_.tv_sec is set to 0, and timer_event_->Set() is then called
in order to wake the process thread from timer_event_->Wait(). When this
happens the process thread will return early and the run Process()
again. This time it will pick up created_at_.tv_sec = 0 and run a new
Wait() call with the desired end time.
However if the process thread was NOT blocking on timer_event_->Wait()
when timer_event_->Set() was called from StartTimer() it will mean that
the first call to timer_event_->Wait() from Process(), AFTER the new
time has been configured (count_ = 1), will return early.
If the timer is not periodic it means that Set() will never be called,
and any calls will Wait() will block until the time out.
The solution is to always reset the event in timer_event_ on the first
call to timerEvent_->Wait(), after a timer has started.
Also some general cleanup.
BUG=
Review URL: https://codereview.webrtc.org/1812533002
Cr-Commit-Position: refs/heads/master@{#12082}
"WebRTC.Video.AVSyncOffsetInMs"
The absolute value of the sync offset between a rendered video frame and the latest played audio frame is measured per video frame. The average offset per received video stream is recorded when a stream is removed.
Updated sync tests in call_perf_tests.cc to use this implementation.
BUG=webrtc:5493
Review URL: https://codereview.webrtc.org/1756193005
Cr-Commit-Position: refs/heads/master@{#11993}
Real time clock may cause problems as they can move (even backwards) if
the clock is changed, eg updated by NTP.
Non-monotonic clocks still in use on some platform (I'm looking at you,
Apple) for timed waits, but that should be less of an issue than actual
timestamps.
BUG=webrtc:5452
Review URL: https://codereview.webrtc.org/1613013002
Cr-Commit-Position: refs/heads/master@{#11375}
While transitioning over to rtc::CriticalSection completely, this gives perf benefits that rtc::CriticalSection has on Mac to current users of CriticalSectionWrapper.
BUG=
Review URL: https://codereview.webrtc.org/1614373002
Cr-Commit-Position: refs/heads/master@{#11356}
There's no need for this class to have a vtable since there exists only a single implementation (per platform). It's also not good for performance.
BUG=
R=pbos@webrtc.org
Review URL: https://codereview.webrtc.org/1601743004 .
Cr-Commit-Position: refs/heads/master@{#11306}
Since this is on Windows only, I'm also using the CriticalSectionWrapper and ConditionVariableWrapper Windows types directly which allows us to skip 3 extra heap allocations. It also helps with the removal of the 'friend' relationship between ConditionVariableWrapper and CriticalSectionWrapper, which is causing headaches on Mac.
BUG=
Review URL: https://codereview.webrtc.org/1595983002
Cr-Commit-Position: refs/heads/master@{#11300}
This removes dependency on ConditionVariableWrapper and CriticalSectionWrapper which currently have a 'friend' relationship that I'd like to get rid of.
BUG=
Review URL: https://codereview.webrtc.org/1590983005
Cr-Commit-Position: refs/heads/master@{#11292}
There's no reason not to use std::move instead now that we can use the
C++11 standard library.
BUG=webrtc:5373
Review URL: https://codereview.webrtc.org/1531013003
Cr-Commit-Position: refs/heads/master@{#11225}
* Better param names
* Avoid using negative values for (bogus) placeholder channel counts (mostly in tests). Since channels will be changing to size_t, negative values will be illegal; it's sufficient to use 0 in these cases.
* Use arraysize()
* Use size_t for counting frames, samples, blocks, buffers, and bytes -- most of these are already size_t in most places, this just fixes some stragglers
* reinterpret_cast<int64_t>(void*) is not necessarily safe; use uintptr_t instead
* Remove unnecessary code, e.g. dead code, needlessly long/repetitive code, or function overrides that exactly match the base definition
* Fix indenting
* Use uint32_t for timestamps (matching how it's already a uint32_t in most places)
* Spelling
* RTC_CHECK_EQ(expected, actual)
* Rewrap
* Use .empty()
* Be more pedantic about matching int/int32_t/
* Remove pointless consts on input parameters to functions
* Add missing sanity checks
All this was found in the course of constructing https://codereview.webrtc.org/1316523002/ , and is being landed separately first.
BUG=none
TEST=none
Review URL: https://codereview.webrtc.org/1534193008
Cr-Commit-Position: refs/heads/master@{#11191}
Update test implementation (test/histograms.h) to be more similar a real implementation (where histogram get functions return a Histogram pointer). Add check that the name of a histogram does not change.
BUG=webrtc:5283
Review URL: https://codereview.webrtc.org/1528403003
Cr-Commit-Position: refs/heads/master@{#11161}
Removes the global simulated time that affects (or breaks) following
tests in the same binary and replaces it with SimulatedClock.
BUG=webrtc:5318
R=mflodman@webrtc.org
Review URL: https://codereview.webrtc.org/1512853002 .
Cr-Commit-Position: refs/heads/master@{#10947}
Reason for revert:
Broke downstream compile step, possibly relandable when using a MSVC version that has constexpr, other than that I'm out of ideas.
.../webrtc/base/atomicops.h:71:8: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const rtc::AtomicInt&'
Original issue's description:
> Reland of "Create rtc::AtomicInt POD struct."
>
> Relands https://codereview.webrtc.org/1420043008/ with brace initializers
> instead of constructors hoping that they won't introduce static
> initializers.
>
> BUG=
> R=tommi@webrtc.org
>
> Committed: https://crrev.com/84f0970d100e67a1dc4fe9a1b16b7d293302044e
> Cr-Commit-Position: refs/heads/master@{#10920}
TBR=tommi@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=
Review URL: https://codereview.webrtc.org/1505053002
Cr-Commit-Position: refs/heads/master@{#10922}
Seconds and fractions parts of the ntp time presented with two values, but used as one.
This helper structure can make that use more clear.
(initially introduced into rtp_rtcp as https://codereview.webrtc.org/1435833003)
BUG=webrtc:5260
Review URL: https://codereview.webrtc.org/1482593002
Cr-Commit-Position: refs/heads/master@{#10814}
* Move PlatformThread to rtc::.
* Remove ::CreateThread factory method.
* Make non-scoped_ptr from a lot of invocations.
* Make Start/Stop void.
* Remove rtc::Thread priorities, which were unused and would collide.
* Add ::IsRunning() to PlatformThread.
BUG=
R=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1476453002 .
Cr-Commit-Position: refs/heads/master@{#10812}
Also removes all virtual methods. Permits using a thread from
rtc_base_approved (namely event tracing).
BUG=webrtc:5158
R=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1469013002
Cr-Commit-Position: refs/heads/master@{#10760}
Reason for revert:
Potentially breaks a threading test under DrMemory. Rolling back while I investigate.
Original issue's description:
> Several Tick counter improvements.
>
> Move logic into cc file
> Simplify interval calculation
> Remove unused QUERY_PERFORMANCE_COUNTER windows implementation
> Remove double divide on each ::Now() invocation on mac
>
> Move TickTime and TickInterval funcitons to cc file in prep for refactoring.
>
> BUG=
> R=mflodman@webrtc.org, pbos@webrtc.org
>
> Committed: https://crrev.com/4c27e4b62da2047063d88eedfeec3e939fea7843
> Cr-Commit-Position: refs/heads/master@{#10661}
TBR=pbos@webrtc.org,mflodman@webrtc.org,noahric@chromium.org,thaloun@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=
Review URL: https://codereview.webrtc.org/1450203002
Cr-Commit-Position: refs/heads/master@{#10663}
Move logic into cc file
Simplify interval calculation
Remove unused QUERY_PERFORMANCE_COUNTER windows implementation
Remove double divide on each ::Now() invocation on mac
Move TickTime and TickInterval funcitons to cc file in prep for refactoring.
BUG=
R=mflodman@webrtc.org, pbos@webrtc.org
Review URL: https://codereview.webrtc.org/1415923010 .
Cr-Commit-Position: refs/heads/master@{#10661}
Added a test that verifies that waiting for a condition variable
actually waits for a non-zero time.
This used to fail due to a TSAN / CLANG bug, but this failure
is supposed to have been fixed.
This was originally https://webrtc-codereview.appspot.com/2145004
BUG=2259
Review URL: https://codereview.webrtc.org/1416873002
Cr-Commit-Position: refs/heads/master@{#10341}
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.
Alternative solutions:
* Check if we already have defined e.g. CHECK, and don't define them in that case. This makes us depend on include order in Chromium, which is not acceptable.
* Don't allow using the macros in WebRTC headers. Error prone since if someone adds it there by mistake it may compile fine, but later break if a header in added or order is changed in Chromium. That will be confusing and hard to enforce.
* Ensure that headers that are included by an embedder don't include our macros. This would require some heavy refactoring to be maintainable and enforcable.
* Changes in Chromium for this is obviously not an option.
BUG=chromium:468375
NOTRY=true
Review URL: https://codereview.webrtc.org/1335923002
Cr-Commit-Position: refs/heads/master@{#9964}
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.
* DISALLOW_ASSIGN -> RTC_DISALLOW_ASSIGN
* DISALLOW_COPY_AND_ASSIGN -> RTC_DISALLOW_COPY_AND_ASSIGN
* DISALLOW_IMPLICIT_CONSTRUCTORS -> RTC_DISALLOW_IMPLICIT_CONSTRUCTORS
Related CL: https://codereview.webrtc.org/1335923002/
BUG=chromium:468375
NOTRY=true
Review URL: https://codereview.webrtc.org/1345433002
Cr-Commit-Position: refs/heads/master@{#9953}
base/logging.h dumped to stderr by default in debug mode, but webrtc
"trace" (via system_wrappers/../logging.h) has that feature disabled by
default. This makes the two consistent.
Bonus: log the filename:line in base/logging.h, which exists in the
system_wrappers variant.
TEST=neteq_impl.cc logs (which use base/logging.h) no longer appear in
debug mode, unless --logs=true is passed. Filenames appear correctly.
Review URL: https://codereview.webrtc.org/1331503002
Cr-Commit-Position: refs/heads/master@{#9868}
This cl removes a lot of unused functionality in SystemInfo and reduces dependencies.
There's duplicate functionality in this class and WebRTC's CpuInfo class, so I'm consolidating the two implementations.
The CpuInfo interface will still exist since it's being used from Chrome to initialize the core count before the sandbox is engaged.
With this change, the SystemInfo class will get the benefit too of this initialization.
NOTRY=true
(using no try due to a dead android try bot)
Review URL: https://codereview.webrtc.org/1286163003
Cr-Commit-Position: refs/heads/master@{#9743}
Using explicit atomic operations permits TSan to understand them and
prevents false positives.
Downgrading the atomic Load to acquire semantics. This reduces the
number of memory barriers inserted from two down to one at most.
Also renaming Load/Store to AcquireLoad/ReleaseStore.
BUG=chromium:512382
R=dvyukov@chromium.org, glider@chromium.orgTBR=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1246073002
Cr-Commit-Position: refs/heads/master@{#9613}
Clang warns if there are missing braces around a subobject
initializer. The most common idiom that triggers this is:
STRUCT s = {0};
if the first field of STRUCT is itself a struct. This can
be more simply written as:
STRUCT s = {};
which also prevents the warning from firing.
Other instances of the warning have been fixed by adding
braces where appropriate.
BUG=505297
TBR=jiayl@webrtc.org
Review URL: https://codereview.webrtc.org/1216353002
Cr-Commit-Position: refs/heads/master@{#9529}