Commit Graph

1273 Commits

Author SHA1 Message Date
676e08f3b6 Refactor webrtc/{api,audio} and modules/audio_coding for GN check
This moves some GN check configurations out of .gn to individual targets.
The now checked targets are:
"//webrtc/api/*",
"//webrtc/audio/*",
"//webrtc/modules/audio_coding/*",

Many targets were fixed by adding dependencies, but the ones that
requires more refactorings are left with the check_includes attribute
set to false instead.

Make //webrtc/test:test_support a public dep of //webrtc/test:test_main
to avoid having to add that to all users of it.

BUG=webrtc:6828
NOTRY=True

Review-Url: https://codereview.webrtc.org/2556943003
Cr-Commit-Position: refs/heads/master@{#15461}
2016-12-07 16:23:35 +00:00
f515ab8c3f Moved call.h and most of api/call/* into call/
BUG=webrtc:6716

Review-Url: https://codereview.webrtc.org/2550273003
Cr-Commit-Position: refs/heads/master@{#15460}
2016-12-07 12:53:04 +00:00
eca373f3ba Adding OnReceivedOverhead to AudioEncoder.
BUG=webrtc:6762

Review-Url: https://codereview.webrtc.org/2528933002
Cr-Commit-Position: refs/heads/master@{#15457}
2016-12-07 09:40:42 +00:00
7439f973f7 Split targets mixing .c and .cc sources.
The Bazel build format doesn't support having separate
lists of compilation flags for C and C++; it just has a single
copts list for cc_library:
https://bazel.build/versions/master/docs/be/c-cpp.html#cc_binary.copts

This makes it hard to convert our GN targets to Bazel when there are
compiler warnings that aren't supported for C (like -Woverloaded-virtual
being added in bugs.webrtc.org/6653).

The solution for this is to move all .c files to their own targets
and remove C++-only compiler flags during conversion.

New targets:
//webrtc/common_audio:common_audio_c
//webrtc/common_audio:common_audio_neon_c
//webrtc/modules/audio_coding:g711_c
//webrtc/modules/audio_coding:g722_c
//webrtc/modules/audio_coding:ilbc_c
//webrtc/modules/audio_coding:isac_c
//webrtc/modules/audio_coding:isac_fix_c
//webrtc/modules/audio_coding:isac_test_util
//webrtc/modules/audio_coding:pcm16b_c
//webrtc/modules/audio_coding:webrtc_opusj_c
//webrtc/modules/audio_device:mac_portaudio
//webrtc/modules/audio_procssing:audio_processing_c
//webrtc/modules/audio_procssing:audio_processing_neon_c

This CL also adds a PRESUBMIT.py check that will throw an error
if targets are mixing .c and .cc files, to preven this from regressing.

BUG=webrtc:6653
NOTRY=True

Review-Url: https://codereview.webrtc.org/2550563003
Cr-Commit-Position: refs/heads/master@{#15433}
2016-12-06 06:47:52 +00:00
4b9a2cb0d8 Reland "Renaming AudioEncoder::SetTargetBitrate and SetProjectedPacketLossRate."
The earlier attempt of this was in
https://codereview.webrtc.org/2411613002/

It was reverted due to failures on internal bots, showing that we cannot deprecate one method.

BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2538493006
Cr-Commit-Position: refs/heads/master@{#15333}
2016-11-30 14:50:08 +00:00
26bddb92f0 Replace test_support_main by test_main and get rid of test_support_main_threaded_mac
test_support_main_threaded_mac doesn't seem to be used. It looks like it was
last used about a year and a half ago, and was removed in
https://webrtc-codereview.appspot.com/55379004

BUG=webrtc:6424
R=kjellander@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2540693002
Cr-Commit-Position: refs/heads/master@{#15332}
2016-11-30 14:12:10 +00:00
e69b46863a Revert of Renaming AudioEncoder::SetTargetBitrate and SetProjectedPacketLossRate. (patchset #5 id:240001 of https://codereview.webrtc.org/2411613002/ )
Reason for revert:
internal bot failure

Original issue's description:
> Renaming AudioEncoder::SetTargetBitrate and SetProjectedPacketLossRate.
>
> BUG=webrtc:6303
>
> Committed: https://crrev.com/84e56d576806635c966093d5421c5d04c9b90746
> Cr-Commit-Position: refs/heads/master@{#15310}

TBR=kwiberg@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:6303

Review-Url: https://codereview.webrtc.org/2537243004
Cr-Commit-Position: refs/heads/master@{#15312}
2016-11-30 09:19:06 +00:00
84e56d5768 Renaming AudioEncoder::SetTargetBitrate and SetProjectedPacketLossRate.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2411613002
Cr-Commit-Position: refs/heads/master@{#15310}
2016-11-30 08:28:07 +00:00
c9e80eee51 Adding packet overhead to audio network adaptor.
BUG=webrtc:6303, webrtc:6762

Review-Url: https://codereview.webrtc.org/2530653003
Cr-Commit-Position: refs/heads/master@{#15305}
2016-11-29 21:00:37 +00:00
352444fcac RTC_[D]CHECK_op: Remove superfluous casts
There's no longer any need to make the two arguments have the same
signedness, so we can remove a bunch of superfluous (and sometimes
dangerous) casts.

It turned out I also had to fix the safe_cmp functions to properly handle
enums that are implicitly convertible to integers.

NOPRESUBMIT=true
BUG=webrtc:6645

Review-Url: https://codereview.webrtc.org/2534683002
Cr-Commit-Position: refs/heads/master@{#15281}
2016-11-28 23:59:03 +00:00
af476c737f RTC_[D]CHECK_op: Remove "u" suffix on integer constants
There's no longer any need to make the two arguments have the same
signedness, so we can drop the "u" suffix on literal integer
arguments.

NOPRESUBMIT=true
BUG=webrtc:6645

Review-Url: https://codereview.webrtc.org/2535593002
Cr-Commit-Position: refs/heads/master@{#15280}
2016-11-28 23:21:51 +00:00
fd87f4af66 Opus: Move complexity variable out of conditional build flag
BUG=webrtc:6708

Review-Url: https://codereview.webrtc.org/2535933002
Cr-Commit-Position: refs/heads/master@{#15277}
2016-11-28 19:16:00 +00:00
69b627d89d Move smoothing filter to common audio and exp_filter to base/analytics.
An earlier attempt of this work can be found here https://codereview.webrtc.org/2520003005/#ps100001, but was reverted.

PS4 in that CL was not valid since separation of BUILD.gn can cause internal bot to fail.

This is a new attempt, which is the same as https://codereview.webrtc.org/2520003005/#ps100001 but PS4 reverted.

BUG=webrtc:6443
TBR=tommi@webrtc.org, solenberg@webrtc.org

Review-Url: https://codereview.webrtc.org/2532523002
Cr-Commit-Position: refs/heads/master@{#15233}
2016-11-24 19:01:14 +00:00
3c3aef44de Revert of Reland "Move smoothing filter to common audio". (patchset #5 id:100001 of https://codereview.webrtc.org/2520003005/ )
Reason for revert:
Internal bots failed.

Original issue's description:
> Reland "Move smoothing filter to common audio".
>
> The original CL was this https://codereview.webrtc.org/2484153002/
>
> Due to failure with internal trial servers, it was reverted. This CL tries to reland it.
>
> BUG=webrtc:6443
>
> Committed: https://crrev.com/223641f1b903e41e77d88f03199b4cdb65255ec8
> Cr-Commit-Position: refs/heads/master@{#15227}

TBR=tommi@webrtc.org,solenberg@webrtc.org,terelius@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:6443

Review-Url: https://codereview.webrtc.org/2529943002
Cr-Commit-Position: refs/heads/master@{#15228}
2016-11-24 15:13:24 +00:00
223641f1b9 Reland "Move smoothing filter to common audio".
The original CL was this https://codereview.webrtc.org/2484153002/

Due to failure with internal trial servers, it was reverted. This CL tries to reland it.

BUG=webrtc:6443

Review-Url: https://codereview.webrtc.org/2520003005
Cr-Commit-Position: refs/heads/master@{#15227}
2016-11-24 14:08:09 +00:00
c1dd1a5916 Really disable Opus complexity tests on Android
This is a follow-up to https://codereview.webrtc.org/2525603002/,
which was incomplete.

BUG=webrtc:6708
TBR=philipel@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2524813002
Cr-Commit-Position: refs/heads/master@{#15202}
2016-11-22 19:19:21 +00:00
0eb19602a3 ComfortNoise: Calculate used scale factor in Q13
BUG=chromium:666518

Review-Url: https://codereview.webrtc.org/2519873003
Cr-Commit-Position: refs/heads/master@{#15189}
2016-11-22 13:15:29 +00:00
58f90a76cc Disable Opus complexity tests on Android
Reason: breaks perf bots

BUG=webrtc:6708
TBR=philipel@webrtc.org

Review-Url: https://codereview.webrtc.org/2525603002
Cr-Commit-Position: refs/heads/master@{#15188}
2016-11-22 12:13:08 +00:00
875862ca86 Let Opus increase complexity for low bitrates
This change adds code that lets Opus increase the complexity setting
at low bitrates (only relevant for mobile where the default complexity
is not already maximum). The feature is default off.

Also adding a performance test to make sure the complexity adaptation
has desired effect.

BUG=webrtc:6708

Review-Url: https://codereview.webrtc.org/2503443002
Cr-Commit-Position: refs/heads/master@{#15182}
2016-11-22 10:08:01 +00:00
d7ac0a9bcc Revert of Move smoothing filter to common audio. (patchset #3 id:60001 of https://codereview.webrtc.org/2484153002/ )
Reason for revert:
Breaks downstream projects:
error: undefined reference to 'rtc::ExpFilter::kValueUndefined'
error: undefined reference to 'rtc::ExpFilter::Apply(float, float)'
error: undefined reference to 'rtc::ExpFilter::Reset(float)'
rror: undefined reference to 'rtc::ExpFilter::UpdateBase(float)'

Original issue's description:
> Move smoothing filter to common audio.
>
> This will make the smoothing filter a basic tool that is going to be used by both voice engine and ANA.
>
> BUG=webrtc:6443
>
> Committed: https://crrev.com/a82395bf7cd15b7396456df06fe952ede8db0c39
> Cr-Commit-Position: refs/heads/master@{#15146}

TBR=minyue@webrtc.org,solenberg@webrtc.org,perkj@webrtc.org,tommi@webrtc.org,michaelt@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6443

Review-Url: https://codereview.webrtc.org/2510373002
Cr-Commit-Position: refs/heads/master@{#15147}
2016-11-18 09:31:19 +00:00
a82395bf7c Move smoothing filter to common audio.
This will make the smoothing filter a basic tool that is going to be used by both voice engine and ANA.

BUG=webrtc:6443

Review-Url: https://codereview.webrtc.org/2484153002
Cr-Commit-Position: refs/heads/master@{#15146}
2016-11-18 08:23:22 +00:00
2779bab02a Support receiving DTMF for multiple RTP clock rates.
BUG=webrtc:2795

Review-Url: https://codereview.webrtc.org/2337473002
Cr-Commit-Position: refs/heads/master@{#15128}
2016-11-17 12:45:25 +00:00
b4af3d673a Remove all references to GYP
Remove all .gyp and .gypi files.
Remove entries from OWNERS files for *.isolate, *.gyp, *.gypi
Remove unused scripts in webrtc/build.

BUG=webrtc:6323
R=henrika@webrtc.org, phoglund@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#15107}
2016-11-16 19:11:38 +00:00
79dfdadbc8 Avoid left-shifting negative values in a number of places
This is undefined behavior, according to specification.

BUG=chromium:661133

Review-Url: https://codereview.webrtc.org/2500953003
Cr-Commit-Position: refs/heads/master@{#15078}
2016-11-15 09:45:59 +00:00
80c06fa574 NetEq: Don't interpolate longer than the output size
This can happen in rare and strange cases.

Also taking the opportunity to replace all asserts with DCHECKs in
that file.

BUG=chromium:659225

Review-Url: https://codereview.webrtc.org/2499013002
Cr-Commit-Position: refs/heads/master@{#15070}
2016-11-14 16:18:56 +00:00
e941306bd6 NetEq: Don't forget to save the codec name
BUG=chromium:661362

Review-Url: https://codereview.webrtc.org/2472083002
Cr-Commit-Position: refs/heads/master@{#14909}
2016-11-03 12:29:12 +00:00
1515e95329 Add audio_format_conversion to deps for audio_decoder_factory_interface.
This fix is made to remove the discrepancy between GYP and GN audio_decoder_factory_interface target.

BUG=webrtc:6412
NOTRY=True

Review-Url: https://codereview.webrtc.org/2472643003
Cr-Commit-Position: refs/heads/master@{#14894}
2016-11-02 15:43:42 +00:00
8a44e1d87b Let RTC_[D]CHECK_op accept arguments of different signedness
With this change, instead of

  RTC_DCHECK_GE(unsigned_var, 17u);

we can simply write

  RTC_DCHECK_GE(unsigned_var, 17);

or even

  RTC_DCHECK_GE(unsigned_var, -17);  // Always true.

and the mathematically sensible thing will happen.

Perhaps more importantly, we can replace checks like

  // index is size_t, num_channels is int.
  RTC_DCHECK(num_channels >= 0
             && index < static_cast<size_t>(num_channels));

or, even worse, just

  // Surely num_channels isn't negative. That would be absurd!
  RTC_DCHECK_LT(index, static_cast<size_t>(num_channels));

with simply

  RTC_DCHECK_LT(index, num_channels);

In short, you no longer have to keep track of the signedness of the arguments, because the sensible thing will happen.

BUG=webrtc:6645

Review-Url: https://codereview.webrtc.org/2459793002
Cr-Commit-Position: refs/heads/master@{#14878}
2016-11-01 19:04:32 +00:00
6b6c88f184 NetEq jitter calculation now done in uint64_t.
The timestamps are 32 bit and can (conceivably) be spaced far enough
apart for the calculation, which is done in Q4, to overflow.

BUG=chromium:653268

Review-Url: https://codereview.webrtc.org/2460393002
Cr-Commit-Position: refs/heads/master@{#14856}
2016-10-31 15:59:34 +00:00
6b825df37e Using AudioOption to enable audio network adaptor.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2397573006
Cr-Commit-Position: refs/heads/master@{#14845}
2016-10-31 11:08:37 +00:00
bc8074474d Eliminate left shift of negative value by using multiplication instead
NOPRESUBMIT=true
BUG=chromium:653267

Review-Url: https://codereview.webrtc.org/2439353003
Cr-Commit-Position: refs/heads/master@{#14837}
2016-10-31 09:26:14 +00:00
6ceab08322 GN: New conventions, default target and refactorings
Introduce a convention on categorizing GN targets:
1. Production code
2. Tests
3. Examples
4. Tools
The first two have targets spread out all over the tree,
while the latter are isolated to examples/ and tools/ directories.

Another new convention: Each directory's BUILD.gn file shall contain
a target named similar to the directory name. This target shall
contain the 'most common' production code, i.e. so that most
consumers of the directory can depend on only the directory
(which implicitly means that target in GN).

//webrtc:webrtc_tests is changed to depend on all WebRTC tests.
From now on, it's necessary to add new test targets to this dependency
tree in order to get them compiled.

Two new group targets are created:
//webrtc/modules/audio_coding:audio_coding_tests
//webrtc/modules/audio_processing:audio_processing_tests
to reduce the long list of tests in //webrtc:webrtc_tests.

Visibility on //webrtc:webrtc and  //webrtc:webrtc_tests is restricted
to the root target, to avoid circular dependencies due to the monolithic
property of these targets (a problem we've had in the past).

The 'root' target at the top level is renamed to 'default', which means GN will
build this target instead of _all_ generated targets
(see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default).
This target now depends on everything we want to build, meaning all targets now
explicitly needs to be wired up from the root target in order to get build.
Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build.

BUG=webrtc:6440
TESTED=git cl try --clobber
NOTRY=True

Review-Url: https://codereview.webrtc.org/2441383002
Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 12:44:07 +00:00
a6b8298b48 Use relative names in GN to make Chromium happy
A recent CL (https://codereview.chromium.org/2388153004/) introduced absolute names, which caused Chromium builds
to fail.

TBR=kjellander@webrtc.org
BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2446643005
Cr-Commit-Position: refs/heads/master@{#14755}
2016-10-24 23:31:25 +00:00
da2bf4e150 Stop using old AudioCodingModule::RegisterReceiveCodec overloads
BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2388153004
Cr-Commit-Position: refs/heads/master@{#14753}
2016-10-24 20:47:16 +00:00
a6f495c7c2 Simplifying audio network adaptor by moving receiver frame length range to ctor.
It turns out that that audio network adaptor can always be created with knowledge of receiver frame length range. There is no need to keep some infrastructure that is used for runtime setting of receiver frame length ranges.

BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2429503002
Cr-Commit-Position: refs/heads/master@{#14748}
2016-10-24 16:19:22 +00:00
a73f6c9726 NetEq now works with packets as values, rather than pointers.
PacketList is now list<Packet> instead of list<Packet*>.
Splicing the lists in NetEqImpl::InsertPacketInternal instead of
moving packets. Avoid moving the packet when doing Rfc3389Cng.
Removed PacketBuffer::DeleteFirstPacket and DeleteAllPackets.

BUG=chromium:657300

Review-Url: https://codereview.webrtc.org/2425223002
Cr-Commit-Position: refs/heads/master@{#14747}
2016-10-24 15:25:33 +00:00
b60d1962d8 Eliminate left shift of negative value by using multiplication instead
BUG=chromium:655917

Review-Url: https://codereview.webrtc.org/2430393003
Cr-Commit-Position: refs/heads/master@{#14741}
2016-10-24 11:18:50 +00:00
c4d2dc4e02 Delete DataLog abstraction, which was almost unused.
Configuration with rtc_enable_data_logging = true was broken in cl
https://codereview.webrtc.org/2054373002/ (which deleted the
FileWrapper::WriteText method), and apparently noone noticed.

BUG=None

Review-Url: https://codereview.webrtc.org/2439473002
Cr-Commit-Position: refs/heads/master@{#14719}
2016-10-21 08:53:01 +00:00
7a3776102f Removed RTPHeader from NetEq's Packet struct.
Only three items in the (rather large) header were actually used after
InsertPacket: payloadType, timestamp and sequenceNumber. They are now
put directly into Packet. This saves 129 bytes per Packet that no
longer need to be allocated and deallocated.

This also works towards decoupling NetEq from RTP. As part of that,
I've moved the NACK code earlier in InsertPacketInternal, together
with other things that directly reference the RTPHeader.

BUG=webrtc:6549

Review-Url: https://codereview.webrtc.org/2411183003
Cr-Commit-Position: refs/heads/master@{#14658}
2016-10-18 11:06:19 +00:00
e40a7ee007 GN: Exclude suppressions of Chromium Clang warnings for Chromium builds.
These suppressions are causing GN errors when Chromium targets are depending
directly on WebRTC targets (needed for https://codereview.chromium.org/2413103004)

BUG=webrtc:4256
NOTRY=True

Review-Url: https://codereview.webrtc.org/2408133008
Cr-Commit-Position: refs/heads/master@{#14644}
2016-10-17 06:56:20 +00:00
0d8385770b NetEq: Convert AverageIAT from int to float calculations
With this change, the calculations inside AverageIAT are changed to be
in double-precision floating point instead of in fixed point. Also,
the method's name is changed to EstimatedClockDriftPpm to better
reflect what it returns.

A few unit tests had to be updated because of minor numerical
differences.

Also removing the UBSan suppression related to this issue.

BUG=webrtc:5889

Review-Url: https://codereview.webrtc.org/2408653002
Cr-Commit-Position: refs/heads/master@{#14628}
2016-10-13 10:35:58 +00:00
c9ec8758db NetEq: Remove special case for Merge without Expand
This was an ill tested special case which turned out to be more problem
than benefit. The special case was only triggered when the decoder frame
size was smaller than 10 ms, which is more or less unsupported by NetEq.

Also fixed a bug in a test, a bug which was exposed by the code change.

BUG=chromium:654983

Review-Url: https://codereview.webrtc.org/2412883002
Cr-Commit-Position: refs/heads/master@{#14627}
2016-10-13 09:43:38 +00:00
e280cdeb74 Voe::Channel: Turned GetPlayoutFrequency into GetRtpTimestampRateHz.
This gets rid of a bit of codec-specific code in VoE.

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2355483003
Cr-Commit-Position: refs/heads/master@{#14614}
2016-10-12 18:04:16 +00:00
7e30432b36 Hooking up audio network adaptor to VoE.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2390883004
Cr-Commit-Position: refs/heads/master@{#14611}
2016-10-12 12:01:01 +00:00
99df6c03c3 Fix bug in DTMF generation where events with level > 36 would be ignored.
BUG=webrtc:2795

Review-Url: https://codereview.webrtc.org/2404183003
Cr-Commit-Position: refs/heads/master@{#14598}
2016-10-11 11:35:40 +00:00
0d382efbdc Cleaning build file for audio network adaptor.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2399883002
Cr-Commit-Position: refs/heads/master@{#14575}
2016-10-07 14:59:36 +00:00
7056be937f Delete old video defines in engine config.
This CL deletes the old and not used video defines in
engine_configurations.h and pre-pends voice_ to indicate there are only
voice/audio defines left in the file.

BUG=none
R=solenberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14558}
2016-10-07 05:07:36 +00:00
41b9c801c2 Adding audio network adaptor to AudioEncoderOpus.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2362703002
Cr-Commit-Position: refs/heads/master@{#14555}
2016-10-06 14:13:59 +00:00
bf7c620280 Fix lint errors in audio_coding_module_unittest.cc
BUG=None
NOTRY=True

Review-Url: https://codereview.webrtc.org/2389263003
Cr-Commit-Position: refs/heads/master@{#14544}
2016-10-06 08:53:39 +00:00
2504c0a91c Drop _oldapi from ACM test file names
Updating GN files, include paths, and include guards

BUG=None
NOTRY=True
NOPRESUBMIT=true

Review-Url: https://codereview.webrtc.org/2387113005
Cr-Commit-Position: refs/heads/master@{#14542}
2016-10-06 08:31:38 +00:00