Commit Graph

82 Commits

Author SHA1 Message Date
1e4d8b574c AcmReceiver: Look up last decoder in NetEq's table of decoders
AcmReceiver::decoders_ is now one step closer to being unused.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2339953002
Cr-Commit-Position: refs/heads/master@{#14274}
2016-09-17 15:40:17 +00:00
65fc8b9138 Fix Chromium clang plugin warnings
NOTRY=true
BUG=webrtc:163

Review-Url: https://codereview.webrtc.org/2291503002
Cr-Commit-Position: refs/heads/master@{#13959}
2016-08-29 17:05:34 +00:00
b8e56ee320 Fix Chromium clang plugin warnings
This adds a new file, webrtc/modules/audio_coding/neteq/tools/packet_source.cc, so that I'll have somewhere to put the new non-inlined methods.

NOTRY=true
BUG=webrtc:163

Review-Url: https://codereview.webrtc.org/2290593002
Cr-Commit-Position: refs/heads/master@{#13956}
2016-08-29 13:37:42 +00:00
36a43887f3 Fix Chromium clang plugin warnings
NOTRY=true
BUG=webrtc:163

Review-Url: https://codereview.webrtc.org/2286063005
Cr-Commit-Position: refs/heads/master@{#13955}
2016-08-29 12:33:36 +00:00
c76680419e NetEq: Update CNG code to accommodate 48 kHz sample rate
Checksums were updated for NetEq and ACM bitexactness tests (after
verifying the audio quality).

BUG=webrtc:5447

Review-Url: https://codereview.webrtc.org/2266293005
Cr-Commit-Position: refs/heads/master@{#13928}
2016-08-26 06:53:43 +00:00
fcada90485 Fixing timestamp comparison assert.
Wasn't handling wrap-around properly. Noticed this because a test
failed.

TBR=henrik.lundin@webrtc.org

Review-Url: https://codereview.webrtc.org/2271203003
Cr-Commit-Position: refs/heads/master@{#13905}
2016-08-24 19:45:18 +00:00
b3f1c5d2fe Add NetEq::FilteredCurrentDelayMs() and use it in VoiceEngine
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}
2016-08-22 22:40:00 +00:00
64a7eab891 Update tests and DTX check for Opus 1.1.3.
DTX is now indicated by packets that may have a size of up to 2 bytes.
Ref: https://git.xiph.org/?p=opus.git;a=commit;h=1c311423c86b89eba27a494e17c79fefd7d75ab0

BUG=

Review-Url: https://codereview.webrtc.org/2158293003
Cr-Commit-Position: refs/heads/master@{#13736}
2016-08-12 11:36:14 +00:00
85228d6af6 Regression test for issue where Opus DTX status was being forgotten.
BUG=webrtc:6020

Review-Url: https://codereview.webrtc.org/2177263002
Cr-Commit-Position: refs/heads/master@{#13539}
2016-07-27 11:53:52 +00:00
1cd46643d7 Disable some Opus tests pending an update
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}
2016-07-26 16:01:45 +00:00
108ecec51c Removed LEGACY_BITEXACT from neteq_impl.cc and updated the ACM unit tests.
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}
2016-07-08 15:45:26 +00:00
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
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
c13ded54ca Move AudioCodingModuleImpl to anonymous namespace in audio_coding_module.cc
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}
2016-06-17 13:00:52 +00:00
342f74005f NetEq: Ask AudioDecoder for sample rate instead of passing it as an argument
BUG=webrtc:5801
NOTRY=true

Review-Url: https://codereview.webrtc.org/2027993002
Cr-Commit-Position: refs/heads/master@{#13162}
2016-06-16 10:18:09 +00:00
abe95ba323 AudioDecoderIsacT: Require caller to always specify sample rate
This gets rid of the complex & icky state where the sample rate is not
yet determined.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2020353003
Cr-Commit-Position: refs/heads/master@{#13011}
2016-06-02 09:59:02 +00:00
90edc65929 Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2018553002/ )
Adding a some checks and switching out a few assert for RTC_[D]CHECK.
These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled.  I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.

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

Committed: https://crrev.com/60c4e0ae8f124f08372645a95042f4a1246d7aa3
Cr-Commit-Position: refs/heads/master@{#12925}

Committed: https://crrev.com/5771beb265129082d31736259b7dc6ca037cff4d
Cr-Commit-Position: refs/heads/master@{#12926}

Committed: https://crrev.com/54e1c6a500e390e543bce7b78fae65eb9bb14ab6
Cr-Commit-Position: refs/heads/master@{#12927}

Committed: https://crrev.com/f9d2fe983fe196373850c55acd3dc3824add480e
Cr-Commit-Position: refs/heads/master@{#12928}

Committed: f4fc0ff6f9

Committed: https://crrev.com/c47f0099eee08e8b6731a359563ba09dfe453ded
Cr-Commit-Position: refs/heads/master@{#12930}

Committed: https://crrev.com/0ad72ead67ce848b45541af6aba0a15486b5e0a7
Cr-Commit-Position: refs/heads/master@{#12931}

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

Cr-Commit-Position: refs/heads/master@{#12933}
2016-05-26 21:48:27 +00:00
5771beb265 Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2018553002/ )
Adding a some checks and switching out a few assert for RTC_[D]CHECK.
These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled.  I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.

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

Committed: https://crrev.com/60c4e0ae8f124f08372645a95042f4a1246d7aa3
Cr-Commit-Position: refs/heads/master@{#12925}

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

Cr-Commit-Position: refs/heads/master@{#12926}
2016-05-26 19:51:41 +00:00
b4ff7a7a8b Revert of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2014183003/ )
Reason for revert:
Alas, the bot magically fails again.  Looks like indeed it's a Clang bug :(

https://build.chromium.org/p/client.webrtc/builders/Win64%20Debug%20%28Clang%29/builds/1687

Original issue's description:
> Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2006313009/ )
>
> Reason for revert:
> Relanding.  The errors look like legit disk space problems so I'm going to watch the bots this time.
>
> Original issue's description:
> > Revert of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2009253004/ )
> >
> > Reason for revert:
> > Fails unexpectedly on multiple commit bots:
> > https://build.chromium.org/p/client.webrtc/builders/Win32%20Debug%20%28Clang%29/builds/1748
> > https://build.chromium.org/p/client.webrtc/builders/Win64%20Debug%20%28Clang%29/builds/1683
> >
> > I filed https://bugs.chromium.org/p/chromium/issues/detail?id=614967 to track the problem. I'll reland if it doesn't solve the problem.
> >
> > Original issue's description:
> > > Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2006243002/ )
> > >
> > > Original issue's description:
> > > > Adding a some checks and switching out a few assert for RTC_[D]CHECK.
> > > > These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled.  I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.
> > > >
> > > > BUG=chromium:613482
> > > > NOTRY=true
> > > > (using notry due to offline android_arm64_rel bot)
> > > >
> > > > Committed: https://crrev.com/d36df89d40bde3c62ee5cbff841933e50b3c007b
> > > > Cr-Commit-Position: refs/heads/master@{#12870}
> > >
> > > TBR=henrik.lundin@webrtc.org
> > > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > > BUG=chromium:613482
> > >
> > > Committed: https://crrev.com/ba189cc4f4f6fe311a815646059e8011ffa53894
> > > Cr-Commit-Position: refs/heads/master@{#12907}
> >
> > TBR=henrik.lundin@webrtc.org,tommi@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=chromium:613482
> >
> > Committed: https://crrev.com/6895d8ca788df29f4d3a4b97fe891f0fb3a6dbec
> > Cr-Commit-Position: refs/heads/master@{#12909}
>
> TBR=henrik.lundin@webrtc.org,kjellander@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=chromium:613482
>
> Committed: https://crrev.com/b7318f1293453d8d319e27473c5bfb72292ebfd2
> Cr-Commit-Position: refs/heads/master@{#12920}

TBR=henrik.lundin@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:613482

Review-Url: https://codereview.webrtc.org/2018553002
Cr-Commit-Position: refs/heads/master@{#12921}
2016-05-26 15:27:43 +00:00
b7318f1293 Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2006313009/ )
Reason for revert:
Relanding.  The errors look like legit disk space problems so I'm going to watch the bots this time.

Original issue's description:
> Revert of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2009253004/ )
>
> Reason for revert:
> Fails unexpectedly on multiple commit bots:
> https://build.chromium.org/p/client.webrtc/builders/Win32%20Debug%20%28Clang%29/builds/1748
> https://build.chromium.org/p/client.webrtc/builders/Win64%20Debug%20%28Clang%29/builds/1683
>
> I filed https://bugs.chromium.org/p/chromium/issues/detail?id=614967 to track the problem. I'll reland if it doesn't solve the problem.
>
> Original issue's description:
> > Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2006243002/ )
> >
> > Original issue's description:
> > > Adding a some checks and switching out a few assert for RTC_[D]CHECK.
> > > These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled.  I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.
> > >
> > > BUG=chromium:613482
> > > NOTRY=true
> > > (using notry due to offline android_arm64_rel bot)
> > >
> > > Committed: https://crrev.com/d36df89d40bde3c62ee5cbff841933e50b3c007b
> > > Cr-Commit-Position: refs/heads/master@{#12870}
> >
> > TBR=henrik.lundin@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=chromium:613482
> >
> > Committed: https://crrev.com/ba189cc4f4f6fe311a815646059e8011ffa53894
> > Cr-Commit-Position: refs/heads/master@{#12907}
>
> TBR=henrik.lundin@webrtc.org,tommi@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=chromium:613482
>
> Committed: https://crrev.com/6895d8ca788df29f4d3a4b97fe891f0fb3a6dbec
> Cr-Commit-Position: refs/heads/master@{#12909}

TBR=henrik.lundin@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:613482

Review-Url: https://codereview.webrtc.org/2014183003
Cr-Commit-Position: refs/heads/master@{#12920}
2016-05-26 15:17:29 +00:00
6895d8ca78 Revert of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2009253004/ )
Reason for revert:
Fails unexpectedly on multiple commit bots:
https://build.chromium.org/p/client.webrtc/builders/Win32%20Debug%20%28Clang%29/builds/1748
https://build.chromium.org/p/client.webrtc/builders/Win64%20Debug%20%28Clang%29/builds/1683

I filed https://bugs.chromium.org/p/chromium/issues/detail?id=614967 to track the problem. I'll reland if it doesn't solve the problem.

Original issue's description:
> Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2006243002/ )
>
> Original issue's description:
> > Adding a some checks and switching out a few assert for RTC_[D]CHECK.
> > These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled.  I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.
> >
> > BUG=chromium:613482
> > NOTRY=true
> > (using notry due to offline android_arm64_rel bot)
> >
> > Committed: https://crrev.com/d36df89d40bde3c62ee5cbff841933e50b3c007b
> > Cr-Commit-Position: refs/heads/master@{#12870}
>
> TBR=henrik.lundin@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:613482
>
> Committed: https://crrev.com/ba189cc4f4f6fe311a815646059e8011ffa53894
> Cr-Commit-Position: refs/heads/master@{#12907}

TBR=henrik.lundin@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:613482

Review-Url: https://codereview.webrtc.org/2006313009
Cr-Commit-Position: refs/heads/master@{#12909}
2016-05-26 09:46:59 +00:00
ba189cc4f4 Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2006243002/ )
Original issue's description:
> Adding a some checks and switching out a few assert for RTC_[D]CHECK.
> These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled.  I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.
>
> BUG=chromium:613482
> NOTRY=true
> (using notry due to offline android_arm64_rel bot)
>
> Committed: https://crrev.com/d36df89d40bde3c62ee5cbff841933e50b3c007b
> Cr-Commit-Position: refs/heads/master@{#12870}

TBR=henrik.lundin@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:613482

Review-Url: https://codereview.webrtc.org/2009253004
Cr-Commit-Position: refs/heads/master@{#12907}
2016-05-26 09:13:14 +00:00
e352578bc8 Moved injection of AudioDecoderFactory into voe::Channel.
Channel's API remains unchanged, but the creation of a BuiltinAudioDecoderFactory is now in Channel. The next step would be to amend Channel's API (through CreateChannel, I believe) to allow an AudioDecoderFactory to be sent along.

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/1992763002
Cr-Commit-Position: refs/heads/master@{#12893}
2016-05-25 14:37:47 +00:00
46ba49c622 Let PacketSource::NextPacket() return an std::unique_ptr
The return type of PacketSource::NextPacket() is changed from a naked
pointer to an std::uniqe_ptr. The interface contract was and still is
that the ownership is passed from the callee to the caller, but a
unique_ptr makes this explicit.

BUG=webrtc:2692

Review-Url: https://codereview.webrtc.org/2005873002
Cr-Commit-Position: refs/heads/master@{#12884}
2016-05-25 05:50:54 +00:00
fb98b9edb4 Revert of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #6 id:100001 of https://codereview.webrtc.org/2007563002/ )
Reason for revert:
Reverting temporarily.  Need to fix tests downstream that pass invalid arguments.

Original issue's description:
> Adding a some checks and switching out a few assert for RTC_[D]CHECK.
> These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled.  I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.
>
> BUG=chromium:613482
> NOTRY=true
> (using notry due to offline android_arm64_rel bot)
>
> Committed: https://crrev.com/d36df89d40bde3c62ee5cbff841933e50b3c007b
> Cr-Commit-Position: refs/heads/master@{#12870}

TBR=henrik.lundin@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:613482

Review-Url: https://codereview.webrtc.org/2006243002
Cr-Commit-Position: refs/heads/master@{#12874}
2016-05-24 13:44:36 +00:00
d36df89d40 Adding a some checks and switching out a few assert for RTC_[D]CHECK.
These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled.  I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.

BUG=chromium:613482
NOTRY=true
(using notry due to offline android_arm64_rel bot)

Review-Url: https://codereview.webrtc.org/2007563002
Cr-Commit-Position: refs/heads/master@{#12870}
2016-05-24 12:49:10 +00:00
d4ccb00b9e Propagate muted parameter to VoE::Channel
Deleted the temporary ACM method without the muted parameter, and had
to modify several tests for this. The muted parameter is not yet propagated to the AudioConferenceMixer; this is the next step.

BUG=webrtc:5609
TBR=perkj@webrtc.org

Review-Url: https://codereview.webrtc.org/1985743002
Cr-Commit-Position: refs/heads/master@{#12779}
2016-05-17 19:22:03 +00:00
8bce67b745 Added UMA logging for audio codec usage. A histogram statistic named "WebRTC.Audio.Encoder.CodecType" has been created.
Review-Url: https://codereview.webrtc.org/1967503002
Cr-Commit-Position: refs/heads/master@{#12760}
2016-05-16 14:34:31 +00:00
834a6ea12b Add muted_output parameter to ACM
The new parameter indicates if the output in the AudioFrame is muted. If
so, the output samples are not written, but should be interpreted as all
zero.

A version of AudioCodingModule::PlayoutData10Ms() without the new
parameter is maintained while waiting for downstream dependencies to
conform.

BUG=webrtc:5609

Review-Url: https://codereview.webrtc.org/1976913002
Cr-Commit-Position: refs/heads/master@{#12719}
2016-05-13 10:45:31 +00:00
7a926812d8 NetEq: Implement muted output
This CL implements the muted output functionality in NetEq. Tests are
added. The feature is currently off by default, and AcmReceiver makes
sure that the muted state is not engaged.

BUG=webrtc:5608

Review-Url: https://codereview.webrtc.org/1965733002
Cr-Commit-Position: refs/heads/master@{#12711}
2016-05-12 20:51:37 +00:00
d28db7fd65 Delete all use of tick_util.h.
Depends on Chrome cl https://codereview.chromium.org/1888003002/, which was landed some time ago.

BUG=webrtc:5740
R=stefan@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12674}
2016-05-10 14:31:58 +00:00
5178ee86ba NetEq: Use a BuiltinAudioDecoderFactory to create decoders
Later steps in the refactoring will have the factory injected from the
outside rather than owned by NetEq.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/1928293002
Cr-Commit-Position: refs/heads/master@{#12604}
2016-05-03 08:39:08 +00:00
53ff70f582 Reland "Avoiding overflow in cross correlation in NetEq."
The original CL is https://codereview.webrtc.org/1908623002/

An error was caused by that and this CL fix that problem and reland the CL.

BUG=

Review-Url: https://codereview.webrtc.org/1931933004
Cr-Commit-Position: refs/heads/master@{#12589}
2016-05-02 08:50:34 +00:00
ef8b61e110 Enable -Winconsistent-missing-override flag.
The problem with gmock is worked around by commenting out any other override declarations in classes using gmock.

NOPRESUBMIT=True
BUG=webrtc:3970

Review-Url: https://codereview.webrtc.org/1921653002
Cr-Commit-Position: refs/heads/master@{#12563}
2016-04-29 13:09:23 +00:00
8c22962474 Revert of Avoiding overflow in cross correlation in NetEq. (patchset #6 id:180001 of https://codereview.webrtc.org/1908623002/ )
Reason for revert:
There seems an error made in this patch.

Hi Henrik,

I think the bit shift returned by CrossCorrelationWithAutoShift may be wrongly used by DotProduct.

We'd better revert this CL.

Doing another fix (and future fixes) will be paintful. I will work on a easy-to-modify bitexactness test first.

Original issue's description:
> Avoiding overflow in cross correlation in NetEq.
>
> BUG=

TBR=henrik.lundin@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/1925053002
Cr-Commit-Position: refs/heads/master@{#12543}
2016-04-28 09:16:54 +00:00
3d09dfdbba Avoiding overflow in cross correlation in NetEq.
BUG=

Review-Url: https://codereview.webrtc.org/1908623002
Cr-Commit-Position: refs/heads/master@{#12538}
2016-04-27 22:06:18 +00:00
bfde543f73 Audio Coding Module: Use separate instances for 16 kHz and 32 kHz iSAC decoder
This will allow us to fix the sample rate of each AudioDecoder at
instantiation time.

This change results in different checksums for the following tests:

AcmReceiverBitExactnessOldApi.8kHzOutput
AcmReceiverBitExactnessOldApi.16kHzOutput
AcmReceiverBitExactnessOldApi.32kHzOutput
AcmReceiverBitExactnessOldApi.48kHzOutputExternalDecoder
AcmReceiverBitExactnessOldApi.48kHzOutput

Because they make an ACM and then ask it to decode both 16 kHz and 32
kHz iSAC. (The arm32 and arm64 checksums didn't change, because the
tests skip 32 kHz iSAC on arm.)

BUG=webrtc:5801

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

Cr-Commit-Position: refs/heads/master@{#12463}
2016-04-22 07:32:06 +00:00
2903ba5ff3 Reland Remove the deprecated EncodeInternal interface from AudioEncoder
Remove the deprecated EncodeInternal interface from AudioEncoder

Also hid MaxEncodedBytes by making it private. It will get removed as soon as subclasses have had time to remove their overrides.

BUG=webrtc:5591

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

Cr-Commit-Position: refs/heads/master@{#12409}
2016-04-18 13:14:42 +00:00
164bc4bbd3 Revert of Remove the deprecated EncodeInternal interface from AudioEncoder (patchset #4 id:60001 of https://codereview.webrtc.org/1864993002/ )
Reason for revert:
Broke import. Implementations of the old interface still exists somewhere.

Original issue's description:
> Remove the deprecated EncodeInternal interface from AudioEncoder
>
> Also hid MaxEncodedBytes by making it private. It will get removed as soon as subclasses have had time to remove their overrides.
>
> BUG=webrtc:5591
>
> Committed: https://crrev.com/5222d315dbea8f3563c100cc9f2451907f70b05f
> Cr-Commit-Position: refs/heads/master@{#12329}

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

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

Cr-Commit-Position: refs/heads/master@{#12330}
2016-04-12 10:58:10 +00:00
5222d315db Remove the deprecated EncodeInternal interface from AudioEncoder
Also hid MaxEncodedBytes by making it private. It will get removed as soon as subclasses have had time to remove their overrides.

BUG=webrtc:5591

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

Cr-Commit-Position: refs/heads/master@{#12329}
2016-04-12 10:31:03 +00:00
c8d071e4e0 Switch to using new ACM methods for encoder management
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#12267}
2016-04-06 19:22:45 +00:00
15c51e355f Move setting of AudioFrame::timestamp_ into NetEq
This was previously done in AcmReceiver, but belongs in NetEq where the
rest of the AudioFrame fields are populated.

BUG=webrtc:5669,webrtc:5607

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

Cr-Commit-Position: refs/heads/master@{#12265}
2016-04-06 15:39:01 +00:00
9a410dd082 Change NetEq::GetPlayoutTimestamp to return an rtc::Optional<uint32_t>
This is in preparation for changes to when the playout timestamp is
valid.

BUG=webrtc:5669

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

Cr-Commit-Position: refs/heads/master@{#12256}
2016-04-06 08:39:30 +00:00
7dc68897d3 Unit test for AudioFrame output from AcmReceiver::GetAudio
This new unit test verifies the parameter fields (not the audio data
itself) written to the AudioFrame output by AcmReceiver::GetAudio.

Also corrected a few comments reflecting recent changes in the code.

BUG=webrtc:5669

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

Cr-Commit-Position: refs/heads/master@{#12253}
2016-04-06 08:03:07 +00:00
0d05da7ee6 Rent-A-Codec: Reference count the shared iSAC bandwidth estimation state
Now that the Rent-A-Codec no longer owns the encoders and decoders it
produces, they may outlive it. It's thus no longer correct for the
Rent-A-Codec to own the bandwidth estimation state; all of the
involved objects need to share ownership.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#12159}
2016-03-30 11:10:18 +00:00
4cdbd57fe3 AudioCodingModule: Add methods for injecting external encoder stacks
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#12158}
2016-03-30 10:10:15 +00:00
22feaa3d15 Replace scoped_ptr with unique_ptr in webrtc/modules/
Except in places where this would break out-of-tree code,
such as Chromium.

BUG=webrtc:5520

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

Cr-Commit-Position: refs/heads/master@{#12037}
2016-03-17 16:17:49 +00:00
b4855cc366 Delete file acm_neteq_unittest.cc
The file was essentially empty, and not used.

TBR=kwiberg@webrtc.org
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#12013}
2016-03-16 09:34:33 +00:00
d44c077dce Revert of Safe numeric library: base/numerics (copied from Chromium) (patchset #11 id:250001 of https://codereview.webrtc.org/1753293002/ )
Reason for revert:
Looks like the Chrome iOS build is broken because of these two changes.  So I'm going to have to revert.  Here's the error:

https://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/185624/steps/compile/logs/stdio

FAILED: rm -f arch/libsafe_numerics.arm64.a && ./gyp-mac-tool filter-libtool libtool  -static -o arch/libsafe_numerics.arm64.a
error: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no files specified
Usage: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
FAILED: rm -f arch/libsafe_numerics.armv7.a && ./gyp-mac-tool filter-libtool libtool  -static -o arch/libsafe_numerics.armv7.a
error: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no files specified
Usage: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
ninja: build stopped: subcommand failed.

Original issue's description:
> Safe numeric library added: base/numerics (copied from Chromium)
>
> This copies the contents (unittest excluded) of base/numerics in
> chromium to base/numerics in webrtc. Files added:
> - safe_conversions.h
> - safe_conversions_impl.h
> - safe_math.h
> - safe_math_impl.h
>
> A really old version of safe_conversions[_impl].h previously existed in
> base/, this has been deleted and sources using it have been updated
> to include the new base/numerics/safe_converions.h.
>
> This CL also adds a DEPS file to webrtc/base.
>
> NOPRESUBMIT=True
> BUG=webrtc:5548, webrtc:5623
>
> Committed: https://crrev.com/de1c81b2d2196be611674aa6019b9db3a9329042
> Cr-Commit-Position: refs/heads/master@{#11907}

TBR=kjellander@webrtc.org,kwiberg@webrtc.org,tina.legrand@webrtc.org,hbos@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5548, webrtc:5623

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

Cr-Commit-Position: refs/heads/master@{#11965}
2016-03-12 01:12:40 +00:00
6030a129c0 Pass ownership of external encoders to the ACM
We want this because otherwise the ACM uses its mutex to protect an
encoder that's owned by someone else. That someone else may easily
slip up and delete or otherwise touch the encoder before making sure
that the ACM has stopped using it, bypassing the lock.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#11909}
2016-03-08 14:01:37 +00:00