So that we don't have to use assert(). Includes one sample call site.
NOTRY=true
BUG=chromium:617124
Review-Url: https://codereview.webrtc.org/2262173002
Cr-Commit-Position: refs/heads/master@{#13862}
The new method returns the current total delay (packet buffer and sync
buffer) in ms, with smoothing applied to even out short-time
fluctuations due to jitter. The packet buffer part of the delay is not
updated during DTX/CNG periods.
This CL also pipes the new metric through ACM and uses it in
VoiceEngine. It replaces the previous method of estimating the buffer
delay (where an inserted packet's RTP timestamp was compared with the
last played timestamp from NetEq). The new method works better under
periods of DTX/CNG.
Review-Url: https://codereview.webrtc.org/2262203002
Cr-Commit-Position: refs/heads/master@{#13855}
scale1 == 31 if and only if w10 == 0. So even though 1 << scale1
overflows, we know that the result of the multiplication should be 0.
Handle that case.
BUG=chromium:615818
Review-Url: https://codereview.webrtc.org/2258543002
Cr-Commit-Position: refs/heads/master@{#13847}
Take 'tools/neteq_quality_test.cc' and 'tools/neteq_quality_test.h' outside of neteq_test_support into their own target, neteq_quality_test_support.
BUG=webrtc:6228
NOTRY=True
Review-Url: https://codereview.webrtc.org/2252413002
Cr-Commit-Position: refs/heads/master@{#13831}
When the sanitizer bots are switched to GN, this needs to be included as a dependency so that the executables can be compiled.
BUG=webrtc:6215
NOTRY=True
Review-Url: https://codereview.webrtc.org/2250893003
Cr-Commit-Position: refs/heads/master@{#13829}
The cast involves packet_len_samp, which is derived from the timestamps
and sequence numbers of incoming packets. Being values from the outside,
these should be treated as if any value is possible, making a
checked_cast unsuitable. Changing instead to saturated_cast to avoid
overflow with out-of-bounds values.
Review-Url: https://codereview.webrtc.org/2243403007
Cr-Commit-Position: refs/heads/master@{#13815}
Reland of https://codereview.webrtc.org/2072753002/ which broke
chromium due to how their build was setup. This issue should now be
resolved.
Changed WebRtcVoiceEngine to present receive codecs from the formats
provided by its decoder factory. Added supported formats to
BuiltinAudioDecoderFactory. Added helper functions for creating some
simple decoder factories for mocking.
Created a PayloadTypeMapper for assigning payload types to formats. I
think we'll eventually want to use this further up, or possibly in
both the audio and video sides. It would be best if the engines didn't
have to talk payload types at all, but it might be more difficult to
get around when payload types depend on each-other, like the RTX
codecs for video.
BUG=webrtc:5805
TBR=ivoc@webrtc.org
Review-Url: https://codereview.webrtc.org/2250683002
Cr-Commit-Position: refs/heads/master@{#13793}
Additional changes I needed to make it work:
- Modified a header in RTPFile.cc. Every other file is
using "webrtc/engine_configurations.h" instead.
- Disabled flag 4373 for msvs because it was disabled
in build/common.gypi.
BUG=webrtc:6038
TBR=kwiberg@webrtc.org
NOTRY=True
Review-Url: https://codereview.webrtc.org/2187563005
Cr-Commit-Position: refs/heads/master@{#13628}
These tests will be reenabled and fixed after Opus 1.1.3 has landed in
Chromium and is rolled into WebRTC.
BUG=
Review-Url: https://codereview.webrtc.org/2185673002
Cr-Commit-Position: refs/heads/master@{#13534}
Reason for revert:
For some reason, payload_type_mapper.cc is not being picked up in Chrome builds, leading to undefined references. Reverting while investigating.
Original issue's description:
> WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs.
>
> Changed WebRtcVoiceEngine to present receive codecs from the formats
> provided by its decoder factory. Added supported formats to
> BuiltinAudioDecoderFactory. Added helper functions for creating some
> simple decoder factories for mocking.
>
> Created a PayloadTypeMapper for assigning payload types to formats. I
> think we'll eventually want to use this further up, or possibly in
> both the audio and video sides. It would be best if the engines didn't
> have to talk payload types at all, but it might be more difficult to
> get around when payload types depend on each-other, like the RTX
> codecs for video.
>
> This CL also includes some changes to rtc::Optional. I've put them in
> a separate CL that should (or should not) land first, making these
> changes void.
> See: https://codereview.webrtc.org/2072713002/
>
> BUG=webrtc:5805
>
> Committed: https://crrev.com/95eb1ba0db79d8fd134ae61b0a24648598684e8a
> Cr-Commit-Position: refs/heads/master@{#13459}
TBR=ivoc@webrtc.org,tina.legrand@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5805
Review-Url: https://codereview.webrtc.org/2151453002
Cr-Commit-Position: refs/heads/master@{#13460}
Changed WebRtcVoiceEngine to present receive codecs from the formats
provided by its decoder factory. Added supported formats to
BuiltinAudioDecoderFactory. Added helper functions for creating some
simple decoder factories for mocking.
Created a PayloadTypeMapper for assigning payload types to formats. I
think we'll eventually want to use this further up, or possibly in
both the audio and video sides. It would be best if the engines didn't
have to talk payload types at all, but it might be more difficult to
get around when payload types depend on each-other, like the RTX
codecs for video.
This CL also includes some changes to rtc::Optional. I've put them in
a separate CL that should (or should not) land first, making these
changes void.
See: https://codereview.webrtc.org/2072713002/
BUG=webrtc:5805
Review-Url: https://codereview.webrtc.org/2072753002
Cr-Commit-Position: refs/heads/master@{#13459}
I'll be rewriting AcmReceiver soon and am trying to reduce the amount of
old stuff that needs to be supported.
I've manually checked the outputs of the AcmReceiver bitexactness
tests with this change. A large part of the tests are still bitexact,
with one section only differing slightly in timings. Nothing audible
unless playing the old and new versions back simultaneously.
The output of NetEqDecoderTest were also changed due to this CL, although only on android. I built and ran the test locally and compared the audio output manually - the changes were the same as for the other tests; i.e. very slight timing changes for a part of the output.
I updated the network stats checksum for android without analyzing it further. I expect it goes hand-in-hand with the changes to the output; i.e. the changes in it are fine because the audio output is fine. Likely, the stats will show changes in the usage of CNG, since that is what the code changes.
BUG=webrtc:1361
Review-Url: https://codereview.webrtc.org/2117763002
Cr-Commit-Position: refs/heads/master@{#13415}
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}
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}
In some situation, typically when incoming packets were reordered, the
DelayPeakDetector::Update method may be called twice (or more) with
non-zero inter_arrival_time argument, but without the TickTimer object
being updated in between (i.e., packets coming in more or less at the
same time). In these situations, a delay peak may be registered with
zero peak period. This could eventually trigger the DCHECK in
DelayPeakDetector::MaxPeakPeriod().
With this fix, the problem is solved by not registering peaks for which
the TickTimer object has not moved since the last peak.
The problem was originally introduced with
https://codereview.webrtc.org/1921163003.
BUG=webrtc:6021
Review-Url: https://codereview.webrtc.org/2085233002
Cr-Commit-Position: refs/heads/master@{#13257}
This change is a major refactoring of the neteq_rtpplay tool. It
consists of the following parts:
- NetEqTest class: Breaks out the main simulation loop from
neteq_rtpplay into a separate class with well defined inputs and
outputs.
- NetEqInput: Interface class for the input to NetEqTest.
- NetEqPacketSourceInput: Implementation of NetEqInput that provides a
PacketSource objects with a NetEqInput interface. This has two
subclasses; one for RtpFileSource and one for RtcEventLogSource.
- NetEqReplacementInput: An object that modifies the packets provided by
another NetEqInput object, and replaces the packet payloads with meta
data readable by a FakeDecodeFromFile decoder.
- FakeDecodeFromFile: An AudioDecoder implementation that produces
"decoded" data by reading from an audio file.
BUG=webrtc:2692, webrtc:5447
Review-Url: https://codereview.webrtc.org/2020363003
Cr-Commit-Position: refs/heads/master@{#13252}
We didn't really want it; it was only necessary because we wanted to
use rtc::Optional<SdpAudioFormat>, and Optional used to require the
contained type to be default constructable. But as of May 9th
(https://codereview.webrtc.org/1896833004), it no longer does.
Review-Url: https://codereview.webrtc.org/2066233002
Cr-Commit-Position: refs/heads/master@{#13211}
AudioCodingModuleImpl is the only implementation of the
AudioCodingModule interface (except for test mocks). So it's a good
fit to put it in an anonymous namespace in the interface's .cc file,
to ensure that no one except AudioCodingModule::Create ever references
it.
Except for moving code, this CL introduces two other small changes:
* It cleans up the set of #includes in audio_coding_module.cc.
Specifically, I removed #includes that were already present in
audio_coding_module.h, and did not bring along any #includes from
audio_coding_module_impl.h and .cc except those that were
necessary to get it to compile.
* It moves AudioCodingModuleImpl from the webrtc::acm2 to the
webrtc::<anonymous> namespace. This means I had to qualify a few
things it references with acm2::.
Review-Url: https://codereview.webrtc.org/2069723003
Cr-Commit-Position: refs/heads/master@{#13191}
And implement SampleRateHz in a bunch of mocks.
BUG=webrtc:5801
NOTRY=true
Review-Url: https://codereview.webrtc.org/2029543002
Cr-Commit-Position: refs/heads/master@{#13161}