Commit Graph

1348 Commits

Author SHA1 Message Date
a70695a3e1 Moved Opus-specific payload splitting into AudioDecoderOpus.
The biggest change to NetEq is the move from a primary flag, to a
Priority with two separate levels: one set by RED splitting and one
set by the codec itself. This allows us to unambigously prioritize
"fallback" packets from these two sources. I've chosen what I believe
is the sensible ordering: packets that the codec prioritizes are
chosen first, regardless of if they are secondary RED packets or
not. So if we were to use Opus w/ FEC in RED, we'd only do Opus FEC
decoding if there was no RED packet that could cover the time slot.

With this change, PayloadSplitter now only deals with RED
packets. Maybe it should be renamed RedPayloadSplitter?

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2342443005
Cr-Commit-Position: refs/heads/master@{#14347}
2016-09-22 09:07:03 +00:00
bc77ed7657 Adding reordering logic in audio network adaptor.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2349113002
Cr-Commit-Position: refs/heads/master@{#14344}
2016-09-22 07:45:23 +00:00
4aec1d4437 Relanding of "Adding BitrateController to audio network adaptor."
Adding BitrateController to audio network adaptor was first landed in https://codereview.webrtc.org/2334613002/ but reverted in https://codereview.webrtc.org/2352223002/ due to ODR violation.

This CL tries to use namespace trick to solve the ODR problem.

BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2353293002
Cr-Commit-Position: refs/heads/master@{#14343}
2016-09-22 06:01:34 +00:00
e35d329315 Adding FrameLengthController to audio network adaptor.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2335163002
Cr-Commit-Position: refs/heads/master@{#14339}
2016-09-21 23:00:38 +00:00
c4ccd4d61c AcmReceiver: Eliminate AcmReceiver::decoders_
BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2351183002
Cr-Commit-Position: refs/heads/master@{#14335}
2016-09-21 17:55:21 +00:00
7f40ba4414 Moved legacy_encoded_audio_frame into audio_decoder_interface.
audio_decoder.cc depends on LegacyEncodedAudioFrame and
LegacyEncodedAudioFrame depends on AudioDecoder::EncodedAudioFrame, so
there's no clear way to separate them as of now. This error is also
hodling up builds downstream. I expect we'll revisit these
dependencies as part of the upcoming larger restructuring effort.

NOTRY=true
BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2359763002
Cr-Commit-Position: refs/heads/master@{#14329}
2016-09-21 12:50:45 +00:00
33b96b3588 Revert of Adding BitrateController to audio network adaptor. (patchset #7 id:140001 of https://codereview.webrtc.org/2334613002/ )
Reason for revert:
ODR violation

Original issue's description:
> Adding BitrateController to audio network adaptor.
>
> BUG=webrtc:6303
>
> Committed: https://crrev.com/26b039a137be0a8703766f45b546b29323de714f
> Cr-Commit-Position: refs/heads/master@{#14293}

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

Review-Url: https://codereview.webrtc.org/2352223002
Cr-Commit-Position: refs/heads/master@{#14327}
2016-09-21 11:30:23 +00:00
0d526d558b Moved codec-specific audio packet splitting into decoders.
There's still some code run specifically for Opus w/ FEC. It will be
addressed in a separate CL.

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2326003002
Cr-Commit-Position: refs/heads/master@{#14319}
2016-09-21 08:57:36 +00:00
3548357e1b Adding SmoothingFilter to audio network adaptor.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2339523002
Cr-Commit-Position: refs/heads/master@{#14313}
2016-09-21 06:13:16 +00:00
d120192f32 AcmReceiver::DecoderByPayloadType: Ask NetEq for decoder
Instead of looking in AcmReceiver::decoders_, which we're trying to
get rid of.

(This is a re-land of https://codereview.webrtc.org/2341283002.)

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2352623002
Cr-Commit-Position: refs/heads/master@{#14312}
2016-09-20 22:18:24 +00:00
42feb51f15 NetEq: New test for muted state during CNG
Verifies that NetEq doesn't enter muted state when CNG mode is active
and the packet stream is suspended for a long time.

BUG=webrtc:5608

Review-Url: https://codereview.webrtc.org/2335343011
Cr-Commit-Position: refs/heads/master@{#14308}
2016-09-20 13:51:48 +00:00
6b19b560ac AcmReceiver: Ask NetEq to delete all decoders at once instead of one by one
It requires a new NetEq method, but it can no longer fail. And we no
longer need to use AcmReceiver::decoders_, which we're trying to
eliminate.

(This is a re-land of https://codereview.webrtc.org/2342313002.)

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2348233002
Cr-Commit-Position: refs/heads/master@{#14304}
2016-09-20 11:02:38 +00:00
6f0f616b53 AcmReceiver: Look up last decoder in NetEq's table of decoders
AcmReceiver::decoders_ is now one step closer to being unused.

(This is a re-land of https://codereview.webrtc.org/2339953002.)

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2354453003
Cr-Commit-Position: refs/heads/master@{#14303}
2016-09-20 10:07:49 +00:00
63489787a0 Add new decoding statistics for muted output
This change adds a new statistic for logging how many calls to
NetEq::GetAudio resulted in a "muted output". A muted output happens
if the packet stream has been dead for some time (and the last decoded
packet was not comfort noise).

BUG=webrtc:5606
BUG=b/31256483

Review-Url: https://codereview.webrtc.org/2341293002
Cr-Commit-Position: refs/heads/master@{#14302}
2016-09-20 08:47:19 +00:00
61a208b1b8 Added a ParsePayload method to AudioDecoder.
It allows the decoder to split the input up into usable chunks before
they are put into NetEq's PacketBuffer. Eventually, all packet splitting
will move into ParsePayload.

There's currently a base implementation of ParsePayload. It will
generate a single Frame that calls the underlying AudioDecoder for
getting Duration() and to Decode.

BUG=webrtc:5805
BUG=chromium:428099

Review-Url: https://codereview.webrtc.org/2326953003
Cr-Commit-Position: refs/heads/master@{#14300}
2016-09-20 08:38:09 +00:00
26b039a137 Adding BitrateController to audio network adaptor.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2334613002
Cr-Commit-Position: refs/heads/master@{#14293}
2016-09-19 16:56:43 +00:00
7a0f2c55f5 Revert of AcmReceiver: Look up last decoder in NetEq's table of decoders (patchset #1 id:100001 of https://codereview.webrtc.org/2339953002/ )
Reason for revert:
Seems to have broken Chromium tests.

Original issue's description:
> AcmReceiver: Look up last decoder in NetEq's table of decoders
>
> AcmReceiver::decoders_ is now one step closer to being unused.
>
> BUG=webrtc:5801
>
> Committed: https://crrev.com/1e4d8b574cde64d93b98d89c7b817fb93185a307
> Cr-Commit-Position: refs/heads/master@{#14274}

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

Review-Url: https://codereview.webrtc.org/2348123002
Cr-Commit-Position: refs/heads/master@{#14279}
2016-09-18 12:35:59 +00:00
bfb78d1293 Revert of AcmReceiver: Ask NetEq to delete all decoders at once instead of one by one (patchset #2 id:20001 of https://codereview.webrtc.org/2342313002/ )
Reason for revert:
Seems to have broken Chromium tests.

Original issue's description:
> AcmReceiver: Ask NetEq to delete all decoders at once instead of one by one
>
> It requires a new NetEq method, but it can no longer fail. And we no
> longer need to use AcmReceiver::decoders_, which we're trying to
> eliminate.
>
> BUG=webrtc:5801
>
> Committed: https://crrev.com/f6232b43a176e1717354b671a0a52b887d70de59
> Cr-Commit-Position: refs/heads/master@{#14275}

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

Review-Url: https://codereview.webrtc.org/2349973002
Cr-Commit-Position: refs/heads/master@{#14278}
2016-09-18 12:33:48 +00:00
f62b82e95f Revert of AcmReceiver::DecoderByPayloadType: Ask NetEq for decoder (patchset #1 id:1 of https://codereview.webrtc.org/2341283002/ )
Reason for revert:
Seems to have broken Chromium tests.

Original issue's description:
> AcmReceiver::DecoderByPayloadType: Ask NetEq for decoder
>
> Instead of looking in AcmReceiver::decoders_, which we're trying to
> get rid of.
>
> BUG=webrtc:5801
>
> Committed: https://crrev.com/07772e4738ef8007280f97a0245eef34b9ca9391
> Cr-Commit-Position: refs/heads/master@{#14276}

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

Review-Url: https://codereview.webrtc.org/2346173002
Cr-Commit-Position: refs/heads/master@{#14277}
2016-09-18 12:32:19 +00:00
07772e4738 AcmReceiver::DecoderByPayloadType: Ask NetEq for decoder
Instead of looking in AcmReceiver::decoders_, which we're trying to
get rid of.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2341283002
Cr-Commit-Position: refs/heads/master@{#14276}
2016-09-17 18:30:31 +00:00
f6232b43a1 AcmReceiver: Ask NetEq to delete all decoders at once instead of one by one
It requires a new NetEq method, but it can no longer fail. And we no
longer need to use AcmReceiver::decoders_, which we're trying to
eliminate.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2342313002
Cr-Commit-Position: refs/heads/master@{#14275}
2016-09-17 17:45:24 +00:00
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
a6974d7f7e NetEq: Remove a test printout
BUG=none
TBR=minyue@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2342343002
Cr-Commit-Position: refs/heads/master@{#14262}
2016-09-16 13:11:38 +00:00
186cd06512 Adding DTX controller to audio network adaptor.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2320093002
Cr-Commit-Position: refs/heads/master@{#14260}
2016-09-16 12:54:47 +00:00
17f008bf33 GYP: Remove targets inside include_tests==1 that are converted to GN.
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}
2016-09-15 11:57:39 +00:00
c26f77f5a6 Remove a couple of unnecessary dependencies on gflags
BUG=webrtc:5447, chromium:645069
NOTRY=True

Review-Url: https://codereview.webrtc.org/2335683002
Cr-Commit-Position: refs/heads/master@{#14221}
2016-09-15 07:05:00 +00:00
f807a521fa iSAC: Remove unnecessary WEBRTC_LINUX define
Similar to https://codereview.webrtc.org/1539883002
but for GN. This was discovered during GN vs GYP auditing.

NOTRY=True
BUG=webrtc:6323

Review-Url: https://codereview.webrtc.org/2344633002
Cr-Commit-Position: refs/heads/master@{#14220}
2016-09-15 06:15:55 +00:00
2e164c6b53 Adding ChannelController to audio network adaptor.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2319873002
Cr-Commit-Position: refs/heads/master@{#14216}
2016-09-14 13:47:39 +00:00
3a7f35b1c4 GN: Declare resources for targets.
Declare resources for GN targets so that they can be isolated

NOTRY=True
BUG=chromium:497757

Review-Url: https://codereview.webrtc.org/2340753002
Cr-Commit-Position: refs/heads/master@{#14210}
2016-09-14 12:10:06 +00:00
caa9cb2cea Adding basic implementation of AudioNetworkAdaptor.
The basic implementation of AudioNetworkAdaptor include the introduction of
  1. Controller
  2. ControllerManager

ControllerManager is to hold all needed controllers. It also orders them according to their significance in dealing with current network condition.

Controller provides an interface MakeDecision, which has to be implemented by specific controllers. AudioNetworkAdaptorImpl calls MakeDecision of the controllers in the order decided by ControllerManager to collect EncoderRuntimeConfig.

BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2306083002
Cr-Commit-Position: refs/heads/master@{#14201}
2016-09-13 20:34:22 +00:00
a41c13e6a2 OWNERS: Make everyone able to change *.gn,*.gni files.
Project-wide change to make it possible for all team members
to do changes to GN files.

NOTRY=True
R=kwiberg@webrtc.org
TBR=henrika@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14163}
2016-09-09 12:51:48 +00:00
2b1b7a83ad iSAC fix: Ignore overflow in signed left shift
A left shift by 10 was assumed to never overflow, since "[s]imulation
of the 25 files shows that maximum value in the vector gain_lo_hiQ17[]
is 441344, which means that it is log2((2^31)/441344) = 12.2 shifting
bits from saturation." However, a fuzzer test succeeded in provoking
an overflow, which we ignore in this CL on the theory that only
"abnormal" inputs cause overflow.

Also had to replace a "foo << 1" with "foo * (1 << 1)" in
WEBRTC_SPL_MUL_16_32_RSFT15 because foo could be negative; this
problem showed up as soon as I'd asked UBSan to ignore the overflow
discussed above.

BUG=chromium:615819

Review-Url: https://codereview.webrtc.org/2314413002
Cr-Commit-Position: refs/heads/master@{#14162}
2016-09-09 12:51:38 +00:00
22c8d5a3e0 Revert of Setting up an RTP input fuzzer for NetEq (patchset #2 id:20001 of https://codereview.webrtc.org/2315633002/ )
Reason for revert:
Broke all Chromium libFuzzer builds
https://bugs.chromium.org/p/chromium/issues/detail?id=645069

Original issue's description:
> Setting up an RTP input fuzzer for NetEq
>
> This CL introduces a new fuzzer target neteq_rtp_fuzzer that
> manipulates the RTP header fields before inserting the packets into
> NetEq. A few helper classes are also introduced.
>
> BUG=webrtc:5447
> NOTRY=True
>
> Committed: https://crrev.com/2d273f1e97cd5030ed1686f27ce1118291b66395
> Cr-Commit-Position: refs/heads/master@{#14103}

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

Review-Url: https://codereview.webrtc.org/2328483002
Cr-Commit-Position: refs/heads/master@{#14131}
2016-09-08 12:00:41 +00:00
17e3fa1fb4 Removed sync packet support from NetEq.
I could not find a single place it was used, outside of the unittests
for the sync packet support itself.

Review-Url: https://codereview.webrtc.org/2309303002
Cr-Commit-Position: refs/heads/master@{#14130}
2016-09-08 11:53:00 +00:00
243c0e8066 Fixing NetEqReplacementInput for reordered and missing packets
With this CL, the NetEqReplacementInput class handles reordered and
missing packets in a better way than before, by storing the last
confirmed packet size and using that when the next packet size cannot
be calculated.

NOTRY=True

Review-Url: https://codereview.webrtc.org/2319553003
Cr-Commit-Position: refs/heads/master@{#14122}
2016-09-08 09:14:34 +00:00
7610f85a2b Adding AudioNetworkAdaptor interfaces.
AudioNetworkAdaptor is supposed to facilitate AudioEncoder to adapt to varying network conditions.

This is the first of a sequence of CLs that are to add one implementation of AudioNetworkAdaptor.

This CL illustrates the interfaces of the AudioNetworkAdaptor.

BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2308573002
Cr-Commit-Position: refs/heads/master@{#14115}
2016-09-07 20:51:59 +00:00
88499ecaca Moving/renaming webrtc/common.h.
This file defines webrtc::Config which was mostly used by modules/audio_processing. The files webrtc/common.h, webrtc/common.cc and webrtc/test/common_unittests.cc are moved to modules/audio_processing and the few remaining uses of webrtc::Config are replaced with simpler code.

- For NetEq and pacing configuration, a VoEBase::ChannelConfig is passed to VoEBase::CreateChannel().
- Removes the need for VoiceEngine::Create(const Config& config). No need to store the webrtc::Config in VoE shared state.

BUG=webrtc:5879

Review-Url: https://codereview.webrtc.org/2307533004
Cr-Commit-Position: refs/heads/master@{#14109}
2016-09-07 14:34:45 +00:00
2d273f1e97 Setting up an RTP input fuzzer for NetEq
This CL introduces a new fuzzer target neteq_rtp_fuzzer that
manipulates the RTP header fields before inserting the packets into
NetEq. A few helper classes are also introduced.

BUG=webrtc:5447
NOTRY=True

Review-Url: https://codereview.webrtc.org/2315633002
Cr-Commit-Position: refs/heads/master@{#14103}
2016-09-07 12:57:34 +00:00
d52bef7d64 iSAC float: Handle errors in upper band decoding
We hit a fuzzer bug that caused numDecodedBytesLB + numDecodedBytesUB
> lenEncodedBytes, which is obviously bogus. Check for that, and for
the case whhere the UB decoder itself realized that something was
wrong. (The code already makes the corresponding check for the LB
decoder.)

BUG=chromium:637899

Review-Url: https://codereview.webrtc.org/2315693002
Cr-Commit-Position: refs/heads/master@{#14091}
2016-09-06 13:16:09 +00:00
d4ec970a79 neteq_rtpplay: Add an error message for unmatched SSRC
If neteq_rtpplay is invoked with the --ssrc option to select packets
matching a specific SSRC, but no matching packets are found, this CL
provides a meaningful error message.

BUG=webrtc:2692
NOTRY=True
TBR=ivoc@webrtc.org

Review-Url: https://codereview.webrtc.org/2318503002
Cr-Commit-Position: refs/heads/master@{#14083}
2016-09-06 08:22:51 +00:00
e9cc686293 GN Templates: Move common_inherited_config to the template.
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}
2016-09-05 13:10:23 +00:00
59af8b7714 GN Templates: Use the optimize_max compiler config.
Add "//build/config/compiler:optimize_max" to rtc_add_configs and
"//build/config/compiler:default_optimization" to rtc_remove_configs.

This is the default optimization in GYP, and might help explain a 82.5%
regression in webrtc_perf_tests at 13946:13946

BUG=chromium:641966
NOTRY=True

Review-Url: https://codereview.webrtc.org/2307283002
Cr-Commit-Position: refs/heads/master@{#14067}
2016-09-05 09:48:58 +00:00
7a2ce0b738 GN Templates: Move common_config to the template.
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}
2016-09-05 08:35:48 +00:00
1dd2335023 GN Templates: Add //build/config/sanitizers:deps to rtc_executable.
Remove //build/config/sanitizers:deps as a dependency for
all rtc_executable targets and add it to the template instead.

BUG=webrtc:6187
NOTRY=True

Review-Url: https://codereview.webrtc.org/2308553002
Cr-Commit-Position: refs/heads/master@{#14048}
2016-09-02 14:03:23 +00:00
38a2132b02 GN: Introduce templates.
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}
2016-09-02 11:10:41 +00:00
ac554eebb9 Add functions to interact with ASan and MSan, and some sample uses
The sample uses are from when I debugged bug 617124. The change in neteq_network_stats_unittest.cc is a fix for a minor unrelated bug found by the try bots when I tried to land this CL (a test was passing uninitialized packet data to NetEq).

BUG=chromium:617124

Review-Url: https://codereview.webrtc.org/2293893002
Cr-Commit-Position: refs/heads/master@{#14034}
2016-09-02 07:39:40 +00:00
067d855291 NetEq: Flush and reset if the speech and cng sample rates mismatch
If a CNG packet is received first, followed by a speech packet with
another sample rate, NetEq should treat this as a change of codec, flush
out the CNG packet and reset the sample rate to that of the speech
packet.

BUG=webrtc:5447
NOTRY=True

Review-Url: https://codereview.webrtc.org/2307493002
Cr-Commit-Position: refs/heads/master@{#14032}
2016-09-02 06:19:12 +00:00
affcac4d22 WebRtcIlbcfix_EnhancerInterface: Let input array be const
NOTRY=true
BUG=chromium:617124

Review-Url: https://codereview.webrtc.org/2297873003
Cr-Commit-Position: refs/heads/master@{#14029}
2016-09-01 19:47:22 +00:00
Per
a0e60e8550 packet_buffer.cc: Removed #include of iostream.
A silly little mistake that broke upstream.

NOTRY=True
TBR=kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14025}
2016-09-01 15:11:32 +00:00
ebd9fd7918 NetEq: Add a few EXPECT_CALLs to PacketBuffer unittests
This will silence a few noisy print-outs.

Review-Url: https://codereview.webrtc.org/2290173002
Cr-Commit-Position: refs/heads/master@{#14005}
2016-08-31 20:03:40 +00:00