- Add histogram: "WebRTC.Video.RtpToNtpFreqOffsetInKhz"
The absolute value of the difference between the estimated frequency during RTP timestamp to NTP time conversion and the actual value (i.e. 90 kHz) is measured per received video frame. The max offset during 40 second intervals is stored. The average of these stored offsets per received video stream is recorded when a stream is removed.
Updated rtp_to_ntp.cc:
- Add validation for only inserting newer RTCP sender reports to the rtcp list.
- Move calculation of frequency/offset (from RTP/NTP timestamp pairs) to UpdateRtcpList. Calculated when a new RTCP SR in inserted (and not in RtpToNtpMs per packet).
BUG=webrtc:6579
Review-Url: https://codereview.webrtc.org/2385763002
Cr-Commit-Position: refs/heads/master@{#14891}
ClockTest.NtpTime was checking that the two methods for getting the
system time are returning a value that is within a fixed error margin
(100 ms) of each other. Unfortunately, even such a wide margin was
sometimes exceeded on heavily loaded machines
(https://build.chromium.org/p/client.webrtc/builders/Mac%20Asan/builds/9235/steps/system_wrappers_unittests/logs/stdio).
This CL changes the test to sandwich clock->CurrentNtp() between
clock->CurrentNtpTimeInMilliseconds(). This way the test will pass no
matter how much time elapses between the two method calls, as long as
the clock is monotonic.
Repeated test runs showed that there may be 1 ms worth of rounding error
between the two methods of getting time, so we have to allow that.
BUG=None.
Review-Url: https://codereview.webrtc.org/2393063002
Cr-Commit-Position: refs/heads/master@{#14520}
The capture time for a frame (capture_ms) is set later (in ViEEncoder::IncomingCapturedFrame) than the timestamp.
Could potentially cause the RTP timestamp in consecutive RTCP SR to decrease.
Example:
// Frame1 46371: timestamp:2732, capture_ms:46373, rtcp SR ms: 46423 -> estimated current RTP timestamp:2732+(46423-46373)*90 = 7232
// Frame2 46404: timestamp:5702, capture_ms:46412, rtcp SR ms: 46428 -> estimated current RTP timestamp:5702+(46428-46412)*90 = 7142
// Diff: 33 ms: 33 ms, 39 ms, 5 ms
BUG=b/31154867
Review-Url: https://codereview.webrtc.org/2354843003
Cr-Commit-Position: refs/heads/master@{#14454}
This changes most non-test related rtc_source_set targets to be
rtc_static_library instead. Targets without any .cc files are excluded.
This should bring back the build behavior we used to have with GYP
(i.e. same symbols exported in the libjingle_peerconnection.a file, which
are used by some downstream projects).
After doing an Android build with these changes:
$ nm --defined-only -g -C out/Release/lib.unstripped/libjingle_peerconnection_so.so | grep -i createpeerconnectionf
00077c51 T Java_org_webrtc_PeerConnectionFactory_nativeCreatePeerConnectionFactory
$ nm --defined-only -g -C out/Release/obj/webrtc/api/libjingle_peerconnection.a | grep -i createpeerconnectionf
00000001 T webrtc::CreatePeerConnectionFactory(rtc::Thread*, rtc::Thread*, rtc::Thread*, webrtc::AudioDeviceModule*, cricket::WebRtcVideoEncoderFactory*, cricket::WebRtcVideoDecoderFactory*)
00000001 T webrtc::CreatePeerConnectionFactory()
See https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/cookbook.md#Note-on-static-libraries
for more details on this.
NOTICE: This should be further cleaned up in the future, to reduce
binary bloat and unnecessary linking time. Right now it's more
important to restore the desired build output though.
BUG=webrtc:6410, chromium:630755
Review-Url: https://codereview.webrtc.org/2361623004
Cr-Commit-Position: refs/heads/master@{#14364}
This name is only used for a DCHECK. Having it as a parameter leads to unnecessary string copying even on release builds.
This CL instead adds a GetHistogramName function that is only called on debug builds.
Checking if pointer is null is also moved outside HistogramAdd function. Having it there is confusing since Chromium implementation doesn't have it there.
BUG=webrtc:6329
Review-Url: https://codereview.webrtc.org/2337883003
Cr-Commit-Position: refs/heads/master@{#14263}
Remove a large number of targets that are no longer built, to reduce maintenance.
Only targets that have a GN version were removed.
BUG=webrtc:6323
NOTRY=True
NOPRESUBMIT=True
Review-Url: https://codereview.webrtc.org/2340773003
Cr-Commit-Position: refs/heads/master@{#14231}
Only has counts stats right now but enumeration stats can easily be added in the future if needed.
BUG=webrtc:6313
Review-Url: https://codereview.webrtc.org/2320473002
Cr-Commit-Position: refs/heads/master@{#14146}
Remove common_inherited_config from the targets and add it to the
template instead.
BUG=webrtc:6187
NOTRY=True
Review-Url: https://codereview.webrtc.org/2311843002
Cr-Commit-Position: refs/heads/master@{#14069}
Remove common_config from the targets' config and add
it to the template instead.
BUG=webrtc:6187
NOTRY=True
Review-Url: https://codereview.webrtc.org/2300413002
Cr-Commit-Position: refs/heads/master@{#14063}
Defines the rtc_executable, rtc_source_set, rtc_test and
rtc_static_library templates.
These templates provide no functionality yet, but will enable common
configuration to be introduced, avoiding repetition in every target
Changes summary:
- Prepend rtc_ to test, source_set, executable and static_library targets
- Change "configs -= [" to "suppressed_configs += ["
- Include webrtc/build/webrtc.gni where it wasn't included yet
- Delete import("//testing/test.gni"), since rtc_test makes it unnecessary.
BUG=webrtc:6187
TBR=henrik.lundin@webrtc.org,tommi@webrtc.org
NOTRY=True
Review-Url: https://codereview.webrtc.org/2301053002
Cr-Commit-Position: refs/heads/master@{#14043}
We have RTC_CHECK and RTC_DCHECK for C now, so we should use it. It's
one fewer difference between our C and C++ code.
NOPRESUBMIT=true
Review-Url: https://codereview.webrtc.org/2274083002
Cr-Commit-Position: refs/heads/master@{#13930}
Move the webrtc/test/test_support/metrics sources into
test_support[_unittests] targets.
This is essentially reverting https://webrtc-codereview.appspot.com/5789004
and moving these sources back to the right target.
Add missing foreman_cif.yuv resource needed for these tests.
For MIPS, a compile error was surfacing for logcat_trace_context.h when
flipping bot to GN, which was fixed.
BUG=webrtc:5949
NOTRY=True
Review-Url: https://codereview.webrtc.org/2267113002
Cr-Commit-Position: refs/heads/master@{#13860}
This is a somewhat involved refactoring of this class. Here's an overview of the changes:
* FileWrapper can now be used as a regular class and instances allocated on the stack.
* The type now has support for move semantics and copy isn't allowed.
* New public ctor with FILE* that can be used instead of OpenFromFileHandle.
* New static Open() method. The intent of this is to allow opening a file and getting back a FileWrapper instance. Using this method instead of Create(), will allow us in the future to make the FILE* member pointer, to be const and simplify threading (get rid of the lock).
* Rename the Open() method to is_open() and make it inline.
* The FileWrapper interface is no longer a pure virtual interface. There's only one implementation so there's no need to go through a vtable for everything.
* Functionality offered by the class, is now reduced. No support for looping (not clear if that was actually useful to users of that flag), no need to implement the 'read_only_' functionality in the class, since file APIs implement that already, no support for *not* managing the file handle (this wasn't used). OpenFromFileHandle always "manages" the file.
* Delete the unused WriteText() method and don't support opening files in text mode. Text mode is only different on Windows and on Windows it translates \n to \r\n, which means that files such as log files, could have a slightly different format on Windows than other platforms. Besides, tools on Windows can handle UNIX line endings.
* Remove FileName(), change Trace code to manage its own path.
* Rename id_ member variable to file_.
* Removed the open_ member variable since the same functionality can be gotten from just checking the file pointer.
* Don't call CloseFile inside of Write. Write shouldn't be changing the state of the class beyond just attempting to write.
* Remove concept of looping from FileWrapper and never close inside of Read()
* Changed stream base classes to inherit from a common base class instead of both defining the Rewind method. Ultimately, Id' like to remove these interfaces and just have FileWrapper.
* Remove read_only param from OpenFromFileHandle
* Renamed size_in_bytes_ to position_, since it gets set to 0 when Rewind() is called (and the size actually does not change).
* Switch out rw lock for CriticalSection. The r/w lock was only used for reading when checking the open_ flag.
BUG=
Review-Url: https://codereview.webrtc.org/2054373002
Cr-Commit-Position: refs/heads/master@{#13155}
Using __builtin_clz on gcc/clang, and a fallback implementation
otherwise.
Also redefine WebRtcSpl_GetSizeInBits(x) as simply 32 - clz32(x).
BUG=chromium:601787
Review-Url: https://codereview.webrtc.org/2014023002
Cr-Commit-Position: refs/heads/master@{#13014}
BUG=webrtc:5949
TESTED=Built and ran the tests on Mac.
NOTRY=True
Review-Url: https://codereview.webrtc.org/2025343002
Cr-Commit-Position: refs/heads/master@{#13007}
This makes the GN configurations easier to read.
BUG=webrtc:5949
NOTRY=True
Review-Url: https://codereview.webrtc.org/2020343003
Cr-Commit-Position: refs/heads/master@{#13006}
We plan to add junit tests running with Robolectric
so naming these files "apk" is slightly confusing.
NOTRY=True
Review-Url: https://codereview.webrtc.org/2020213002
Cr-Commit-Position: refs/heads/master@{#12971}
Compile fixes for GN on iOS that finally gets our bots green.
Changes to system_wrappers:
* Updated to only use inclusive sources for maintainability
* Add a few missing GN headers.
* Cleanup GYP hack for atomic32_mac.cc
* Renamed changes sources to avoid problems with GYP/GN file
suffix rules:
- atomic32_mac.cc -> atomic32_darwin.cc
- atomic32_posix.cc -> atomic32_non_darwin_unix.cc
See https://code.google.com/p/chromium/codesearch#chromium/src/build/config/BUILDCONFIG.gn&l=325
for details on which extensions can/cannot be used.
BUG=webrtc:5586
NOTRY=True
Review-Url: https://codereview.webrtc.org/1999723002
Cr-Commit-Position: refs/heads/master@{#12897}
Consider follow up and use actual bucket count when storing samples.
BUG=
Review-Url: https://codereview.webrtc.org/2008483002
Cr-Commit-Position: refs/heads/master@{#12872}
Updated tests to use the default implementation and removed the test implementation (webrtc/test/histograms.h).
BUG=
Review-Url: https://codereview.webrtc.org/1915523002
Cr-Commit-Position: refs/heads/master@{#12829}
Reason for revert:
Breaks user code. Said code needs to stop using scoped_ptr!
Original issue's description:
> Remove webrtc/base/scoped_ptr.h
>
> BUG=webrtc:5520
>
> NOTRY=True
>
> Committed: https://crrev.com/65fc62e9dd8a8716db625aaef76ab92f542ecc5a
> Cr-Commit-Position: refs/heads/master@{#12684}
TBR=tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5520
Review-Url: https://codereview.webrtc.org/1965063003
Cr-Commit-Position: refs/heads/master@{#12686}
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}
Adds logging of:
- video stats that are recorded when a stream is removed
- bitrate stats that are recorded at the end of a call
- initial bwe rampup stats
BUG=
Review URL: https://codereview.webrtc.org/1788783002
Cr-Commit-Position: refs/heads/master@{#12133}