128 Commits

Author SHA1 Message Date
kwiberg
670a7f3611 Revert of WebRtcVoiceMediaChannel::AddRecvStream: Don't call SetRecPayloadType (patchset #13 id:260001 of https://codereview.webrtc.org/2686043006/ )
Reason for revert:
Makes perf and Chromium FYI bots unhappy.

Original issue's description:
> WebRtcVoiceMediaChannel::AddRecvStream: Don't call SetRecPayloadType
>
> This removes one more place where we were unable to handle codecs not
> in the built-in set.
>
> BUG=webrtc:5805
>
> Review-Url: https://codereview.webrtc.org/2686043006
> Cr-Commit-Position: refs/heads/master@{#17370}
> Committed: 1724cfbdba

TBR=ossu@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:5805

Review-Url: https://codereview.webrtc.org/2772043002
Cr-Commit-Position: refs/heads/master@{#17374}
2017-03-24 12:56:21 +00:00
kwiberg
1724cfbdba WebRtcVoiceMediaChannel::AddRecvStream: Don't call SetRecPayloadType
This removes one more place where we were unable to handle codecs not
in the built-in set.

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2686043006
Cr-Commit-Position: refs/heads/master@{#17370}
2017-03-24 10:16:04 +00:00
solenberg
22818a5804 (Re)move VoE specific enums from common_types.h.
BUG=webrtc:5876

Review-Url: https://codereview.webrtc.org/2745253007
Cr-Commit-Position: refs/heads/master@{#17267}
2017-03-16 08:20:23 +00:00
solenberg
9a5f032227 Remove VoEHardware interface usage.
BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2737633002
Cr-Commit-Position: refs/heads/master@{#17248}
2017-03-15 13:14:12 +00:00
solenberg
ebb349d7c9 Revert to allowing only 1 unsignaled receive stream for audio.
Reason to go back is that we may end up with a bunch of streams that are never cleaned up and consume resources.

BUG=webrtc:7175, b/35863246

Review-Url: https://codereview.webrtc.org/2746763002
Cr-Commit-Position: refs/heads/master@{#17210}
2017-03-13 12:46:15 +00:00
ossu
0c4b849b27 Pick a matching CN codec, rather than the first CN codec.
It seems to me that we're currently just picking the first CN codec, rather than the one that matches the clock rate of the voice codec. The only test I've gotten to fail by changing this behavior is the one that's also changed in this CL, which explicitly expects a CN codec to be chosen even though there's none matching.

BUG=webrtc:7282

Review-Url: https://codereview.webrtc.org/2707133007
Cr-Commit-Position: refs/heads/master@{#16979}
2017-03-02 19:03:25 +00:00
solenberg
796b8f9d71 Remove usage of VoEVolumeControl from WVoE and Audio[Send|Receive]Stream.
BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2721003002
Cr-Commit-Position: refs/heads/master@{#16956}
2017-03-02 01:02:23 +00:00
solenberg
2100c0ba13 Support N unsignaled audio streams.
BUG=webrtc:7175, webrtc:5208

Review-Url: https://codereview.webrtc.org/2685893002
Cr-Commit-Position: refs/heads/master@{#16952}
2017-03-01 19:29:29 +00:00
sprang
c1b57a15bf Test field trial group with startswith rather than equals.
BUG=webrtc:7266

Review-Url: https://codereview.webrtc.org/2717973005
Cr-Commit-Position: refs/heads/master@{#16915}
2017-02-28 16:50:47 +00:00
solenberg
76377c55b7 Remove usage of VoEAudioProcessing from WVoE/MC.
Calling APM and TransmitMixer directly instead.

BUG=webrtc:4690
TBR=peah@webrtc.org

Review-Url: https://codereview.webrtc.org/2681033010
Cr-Commit-Position: refs/heads/master@{#16734}
2017-02-21 08:54:31 +00:00
solenberg
4904fb6f46 Be less pessimistic about turning "default" receive streams into signaled streams.
BUG=webrtc:7179, b/34746131

Review-Url: https://codereview.webrtc.org/2685573003
Cr-Commit-Position: refs/heads/master@{#16673}
2017-02-17 20:01:14 +00:00
ivoc
4ca18696c5 Allow residual echo detector to be enabled/disabled using AudioOptions, and no longer disable it on mobile platforms.
BUG=webrtc:7136

Review-Url: https://codereview.webrtc.org/2679103007
Cr-Commit-Position: refs/heads/master@{#16531}
2017-02-10 13:11:09 +00:00
solenberg
55c5be0a03 Remove unused methods in WebRtcVoiceEngine and VoiceMediaChannel.
These methods relate to typing detection but are not used anymore. Typing detection is enabled through the VoiceDetection module on the APM.

BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2684933008
Cr-Commit-Position: refs/heads/master@{#16527}
2017-02-10 09:20:25 +00:00
ossu
9def800b70 Added a flag to AudioCodecSpec to indicate adaptive bitrate support.
It's currently only used to ensure transport-cc is enabled for the format in question. It might be used to toggle more things in future.

BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2669583002
Cr-Commit-Position: refs/heads/master@{#16514}
2017-02-09 13:14:32 +00:00
solenberg
f748ca47b0 Change order of tear down/create of default audio stream, to avoid starting/stopping audio card playout unnecessarily.
BUG=b/34746131

Review-Url: https://codereview.webrtc.org/2670183005
Cr-Commit-Position: refs/heads/master@{#16456}
2017-02-06 21:03:19 +00:00
deadbeef
e702b30fec Adding C++ versions of currently spec'd "RtpParameters" structs.
These structs will be used for ORTC objects (and their WebRTC
equivalents).

This CL also introduces some minor changes to the existing implemented
structs:

- max_bitrate_bps uses rtc::Optional instead of "-1 means unset"
- "mime_type" turned into "name"/"kind" (which can be used to form the
  MIME type string, if needed).
- clock_rate and channels changed to rtc::Optional, since they will
  need to be for RtpSender.send().
- Renamed "channels" to "num_channels" (the ORTC name, which I prefer).

BUG=webrtc:7013, webrtc:7112

Review-Url: https://codereview.webrtc.org/2651883010
Cr-Commit-Position: refs/heads/master@{#16437}
2017-02-04 20:09:01 +00:00
michaelt
a55f021d43 Add 120ms frame ability to ANA
BUG=webrtc:7093

Review-Url: https://codereview.webrtc.org/2669733002
Cr-Commit-Position: refs/heads/master@{#16416}
2017-02-02 15:47:19 +00:00
minyue
2e03c66119 Adding build switch for Opus that supports 120ms ptime.
BUG=webrtc:7097

TEST=Set "ptime=120", try WebRTC calls over custom build Chromium with and without Opus 120ms. Try both Chromium w <-> Chromium w and Chromium w <-> Chromium w/o

Review-Url: https://codereview.webrtc.org/2668633004
Cr-Commit-Position: refs/heads/master@{#16408}
2017-02-02 01:31:11 +00:00
elad.alon
0fe1216c9c Move more calls to webrtc::field_trial::FindFullName into ctor, thereby minimizing the non-trivial cost of repeated string comparisons.
BUG=webrtc:7059

Review-Url: https://codereview.webrtc.org/2657863002
Cr-Commit-Position: refs/heads/master@{#16378}
2017-01-31 13:48:37 +00:00
nisse
7d2542623a Delete unneeded includes of base/common.h.
Bulk of the changes were done using

   git grep -l '#include "webrtc/base/common.h"' | \
     xargs sed -i '\,^#include.*webrtc/base/common\.h,d'

followed by adding back the include in the few places where it is
still needed, and in one case (pseudotcp.cc) instead deleting its use
of RTC_UNUSED.

BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2644103002
Cr-Commit-Position: refs/heads/master@{#16263}
2017-01-25 09:47:24 +00:00
stefan
e9f36d55da Make sure min and max bitrate is always set for audio.
BUG=webrtc:5079

Review-Url: https://codereview.webrtc.org/2654503005
Cr-Commit-Position: refs/heads/master@{#16250}
2017-01-24 16:18:45 +00:00
ossu
e1405ad0d1 Removed double-special-casing of ISAC in libjingle and WebRtcVoE.
webrtcvoiceengine.cc ensured that if the bitrate set for ISAC was 0,
it was changed to -1 so that the codec could manage the bitrate
itself.

webrtcsdp.cc ensured that if the bitrate set for ISAC was 0, it was
explicitly set to default values to avoid the codec's built in bitrate
management.

Eventually, there'll be no codec specific code like this in these
layers. This is one step towards that goal.

BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2642923003
Cr-Commit-Position: refs/heads/master@{#16220}
2017-01-23 16:55:48 +00:00
nisse
0ebdf2757c Delete or update left-over ASSERT use and comments.
BUG=webrtc:6424,webrtc:6323

Review-Url: https://codereview.webrtc.org/2647663002
Cr-Commit-Position: refs/heads/master@{#16215}
2017-01-23 15:43:05 +00:00
kwiberg
d32bf75721 Pass SdpAudioFormat through Channel, without converting to CodecInst
BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2516993002
Cr-Commit-Position: refs/heads/master@{#16165}
2017-01-19 15:03:59 +00:00
ivoc
4e477a1d7b Added a new echo likelihood stat that reports the maximum value from a previous time period.
BUG=webrtc:6797

Review-Url: https://codereview.webrtc.org/2629563003
Cr-Commit-Position: refs/heads/master@{#16079}
2017-01-15 16:29:46 +00:00
michaelt
6672b26d02 Add overhead to audio bwe min, max.
BUG=webrtc:6762

Review-Url: https://codereview.webrtc.org/2532433002
Cr-Commit-Position: refs/heads/master@{#16014}
2017-01-11 18:17:59 +00:00
deadbeef
fb2aceded6 Add video send SSRC to RtpParameters, and don't allow changing SSRC.
With this, RtpSender and RtpReceiver will always return an SSRC if one
is available. Also, attempts to change the SSRC with SetParameters will
fail, rather than silently doing nothing.

BUG=webrtc:6888

Review-Url: https://codereview.webrtc.org/2567333004
Cr-Commit-Position: refs/heads/master@{#15939}
2017-01-07 07:05:37 +00:00
gyzhou
95aa96465d Support external audio mixer in webrtc 2.
An external audio mixer will be passed from PeerConnectionFactory to
AudioTransportProxy.

This CL has rewritten based on reverted CL
https://codereview.chromium.org/2539213003/
The only difference is that
  static MediaEngineInterface* Create(
      webrtc::AudioDeviceModule* adm,
      const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
          audio_decoder_factory,
      WebRtcVideoEncoderFactory* video_encoder_factory,
      WebRtcVideoDecoderFactory* video_decoder_factory);
in media/engine/webrtcmediaengine.h is kept in this CL instead of
replaced for backward compatibility.

BUG=webrtc:6457

Review-Url: https://codereview.webrtc.org/2570993002
Cr-Commit-Position: refs/heads/master@{#15580}
2016-12-13 22:06:35 +00:00
gyzhou
39ce11f7f6 Revert of Support external audio mixer. (patchset #5 id:140001 of https://codereview.webrtc.org/2539213003/ )
Reason for revert:
A interface change broke some downstream code in google3.

Original issue's description:
> Support external audio mixer in webrtc.
>
> An external audio mixer will be passed from PeerConnectionFactory to
> AudioTransportProxy.
>
> BUG=webrtc:6457
>
> Committed: https://crrev.com/f6bcac59e88c3be5ffd73bbb1098f2d82ee316a1
> Cr-Commit-Position: refs/heads/master@{#15556}

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

Review-Url: https://codereview.webrtc.org/2562333003
Cr-Commit-Position: refs/heads/master@{#15557}
2016-12-13 01:07:00 +00:00
gyzhou
f6bcac59e8 Support external audio mixer in webrtc.
An external audio mixer will be passed from PeerConnectionFactory to
AudioTransportProxy.

BUG=webrtc:6457

Review-Url: https://codereview.webrtc.org/2539213003
Cr-Commit-Position: refs/heads/master@{#15556}
2016-12-13 00:25:16 +00:00
deadbeef
cb44343006 Add SSRC to RtpEncodingParameters for audio.
Was added for video initially, but not for audio.

BUG=webrtc:6862

Review-Url: https://codereview.webrtc.org/2568553002
Cr-Commit-Position: refs/heads/master@{#15552}
2016-12-12 19:12:42 +00:00
stefan
13f1a0a9ca Wire up x-google-{min,start,max}-bitrate to WebRtcVoiceMediaChannel.
BUG=webrtc:6793

Review-Url: https://codereview.webrtc.org/2534173002
Cr-Commit-Position: refs/heads/master@{#15337}
2016-11-30 15:23:07 +00:00
peah
8271d04009 This CL introduces the new functionality for setting
the APM parameters to the high-pass filter.

The introduction will be done in three steps:
1) This CL which introduces the new scheme and
 changes the code in webrtcvoiceengine.cc to use it.
2) Introduce the scheme into upstream code.
3) Remove the HighPassFilter interface in APM.

BUG=webrtc::6220, webrtc::6296, webrtc::6297, webrtc::6181, webrtc::5298

Review-Url: https://codereview.webrtc.org/2415403002
Cr-Commit-Position: refs/heads/master@{#15197}
2016-11-22 15:24:59 +00:00
peah
64d6ff77ff In VoiceEngine, the settings for APM are applied in such a way that
the previously specified setting is changed if it is specified to be changed,
and otherwise the previously specified setting is kept as it is.

This CL replicates this functionality for the way that the new APM
parameter scheme is used.

BUG=webrtc::6220, webrtc::6296, webrtc::6297, webrtc::6181, webrtc::5298

Review-Url: https://codereview.webrtc.org/2489343002
Cr-Commit-Position: refs/heads/master@{#15167}
2016-11-21 14:28:23 +00:00
hbos
1acfbd22cc Expose RtpCodecParameters to VoiceMediaInfo stats.
Payload type -> RtpCodecParameters maps added for sender and receiver.
This is a follow-up to https://codereview.webrtc.org/2484193002/ which
did the same thing for VideoMediaInfo. This information will be used to
produce RTCCodecStats[1].

Voice[Sender/Receiver]Info is updated with current codec payload type
for every stream which can be used to look up the codec in
VoiceMediaInfo.

[1] https://w3c.github.io/webrtc-stats/#codec-dict*

BUG=chromium:659117

Review-Url: https://codereview.webrtc.org/2503383002
Cr-Commit-Position: refs/heads/master@{#15144}
2016-11-18 07:43:39 +00:00
aleloi
10111bc495 Passed AudioMixer to AudioState::Config.
This is a refactoring change in preparation for enabling AudioMixer
with the goal to have a small CL as possible for passing audio through
the new audio mixer in WebRTC. The dependent CL https://codereview.webrtc.org/2436033002/
enables the mixer.

An object of class AudioState is shared across different webrtc audio
connections. It is created in tests and in
WebRTCVoiceEngine. AudioState is constructed by passing a Config
struct, where one argument is scoped_refptr<AudioMixer>.

Populating this field has now been mandatory. Tests and
WebRTCVoiceEngine create and pass either a AudioMixerImpl.
WebRTCVoiceEngine passes a real AudioMixer, which is
currently unused.

An alternative would have tests pass a mocked audio mixer. We
chose not to do that, because we believe that tests should use
the real thing unless there are reasons against it. Construction
time is not an issue, because the real mixer is relatively
lightweight.

We couldn't find a way to test any mixer-related changes in AudioState
before the mixes is connected. The next dependent CL
https://codereview.webrtc.org/2436033002/ contains unit tests for
mixer usage.

BUG=webrtc:6346

Review-Url: https://codereview.webrtc.org/2469743002
Cr-Commit-Position: refs/heads/master@{#15134}
2016-11-17 14:48:56 +00:00
solenberg
ffbbcac4c6 Support multiple timestamp rates for sending DTMF.
We support multiple payload types, and one which matches the audio codec the closest, is picked (or the one with lowest clock rate, if no perfect match is found).

The exact clock rate is then ignored and DTMF packets are time stamped with the rate of the current audio codec. This is exactly the way the code has worked up to this point, but until now we have been under the impression that we were in fact sending 8k DTMF.

In other words, this is an improvement over the current situation, since we will most likely find a payload type which matches the codec clock rate.

This CL also does a little cleaning of the DTMFQueue and RTPSenderAudio classes.
BUG=webrtc:2795

Review-Url: https://codereview.webrtc.org/2392883002
Cr-Commit-Position: refs/heads/master@{#15129}
2016-11-17 13:25:45 +00:00
solenberg
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
stefan
b2b61b359c Rename the adapt audio bitrate experiment.
BUG=webrtc:5079

Review-Url: https://codereview.webrtc.org/2498233003
Cr-Commit-Position: refs/heads/master@{#15080}
2016-11-15 13:23:35 +00:00
ivoc
b829d9f2ee Add AudioOption for residual echo detector, and enable the echo detector by default on non-mobile platforms.
BUG=webrtc:6525

Review-Url: https://codereview.webrtc.org/2493753002
Cr-Commit-Position: refs/heads/master@{#15079}
2016-11-15 10:34:54 +00:00
solenberg
7602aabdc0 Remove usage of VoEBase::AssociateSendChannel() from WVoMC.
- Functionality now implemented in AudioReceiveStream and Call.
- Added some missing function to MockChannelProxy.

BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2461523002
Cr-Commit-Position: refs/heads/master@{#15072}
2016-11-14 19:30:16 +00:00
michaelt
79e05888e8 Set actual transport overhead in rtp_rtcp
BUG=webrtc:6557

Review-Url: https://codereview.webrtc.org/2437503004
Cr-Commit-Position: refs/heads/master@{#14968}
2016-11-08 10:50:16 +00:00
minyue
10cbb4648f Fixing config for Audio BWE.
The unit was kbps but the one default use of it is in bps. The inconsistency should be fixed.

BUG=webrtc:6670

Review-Url: https://codereview.webrtc.org/2247213005
Cr-Commit-Position: refs/heads/master@{#14955}
2016-11-07 17:29:27 +00:00
kwiberg
37b8b11661 Revert of Removed the legacy behavior of stopping playout when setting new receive codecs. (patchset #1 id:1 of https://codereview.webrtc.org/2409483003/ )
Reason for revert:
Reverting because of the reasons given in comment #16:

"This change breaks a scenario that is unfortunately not covered by unit tests,
but can easily happen in a real call.

The scenario that is broken by the change is this:
1. A sends an offer to B, with a set of codecs C_a (which is a subset of C_b,
the codecs supported by B)
2. B responds with an answer, and sets the receive codecs to C_a.
3. At a later time, B generates a new offer which by default includes all codecs
in C_b.
4. B calls SetLocalDescription() with this offer, that adds new receive codecs.
5. Adding the new codecs fails, because of the check at
https://cs.chromium.org/chromium/src/third_party/webrtc/voice_engine/channel.....
This causes SetLocalDescription() itself to fail. The net effect is that B
cannot set a local description it just generated.

Before the CL mentioned above, we'd stop playout before changing the codecs, and
the operation would succeed."

Original issue's description:
> Removed the legacy behavior of stopping playout when setting new receive codecs.
>
> BUG=webrtc:4690
>
> Committed: https://crrev.com/917d4e1e7131f35764cff932a8793151585e8179
> Cr-Commit-Position: refs/heads/master@{#14610}

TBR=solenberg@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2478433003
Cr-Commit-Position: refs/heads/master@{#14905}
2016-11-03 09:47:02 +00:00
stefan
b521aa704f Clean up abs-send-time for audio.
BUG=None

Review-Url: https://codereview.webrtc.org/2455013003
Cr-Commit-Position: refs/heads/master@{#14870}
2016-11-01 10:17:18 +00:00
minyue
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
solenberg
059fb4480b - Replace FakeAudioProcessing in WVoE unittest with MockAudioProcessing.
- Update MockAudioProcessing to current APM interface.
- Replace calls to VoEAudioProcessing::Start/StopAecDump with direct calls on APM.
- Add AudioProcessing* in WVoE, get it from VoE, so we can call directly on APM.

BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2446143002
Cr-Commit-Position: refs/heads/master@{#14786}
2016-10-26 12:12:29 +00:00
ivoc
8c63a82bf5 Add a placeholder stat for logging the estimated residual echo likelihood.
The stat is currently always set to zero until the residual echo detector has landed.

BUG=webrtc:6525

Review-Url: https://codereview.webrtc.org/2431443003
Cr-Commit-Position: refs/heads/master@{#14721}
2016-10-21 11:10:08 +00:00
minyue
7a973447eb Moving WebRtcVoiceMediaChannel::SendSetCodec to AudioSendStream.
BUG=webrtc:5806, webrtc:4690

Review-Url: https://codereview.webrtc.org/2405183002
Cr-Commit-Position: refs/heads/master@{#14700}
2016-10-20 10:27:21 +00:00
aleloi
e33c5d918a Added a level controller initialization value to MediaConstraints.
An audio track with a level controller with the correct initialization
value can be created by a combination of
PeerConnectionFactory::CreateAudioTrack(..., audio_source) and
either
audio_source = PeerConnectionFactory::CreateAudioSource(constraints) or
audio_source = PeerConnectionFactory::CreateAudioSource(audio_options).

NOTRY=True
BUG=webrtc:6386

Review-Url: https://codereview.webrtc.org/2408143003
Cr-Commit-Position: refs/heads/master@{#14693}
2016-10-20 08:53:30 +00:00