81 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
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
tommi
322a9e42f8 Handle TimeUntilNextProcess in StartupShutdownWithExternalADM
BUG=webrtc:7258

Review-Url: https://codereview.webrtc.org/2719113002
Cr-Commit-Position: refs/heads/master@{#16894}
2017-02-28 10:12:57 +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
ossu
11bfc53cd9 Fixed a couple of build-flag dependent tests of webrtcvoiceengine.
The codecs expected by HasCorrectCodecs now depends which codecs were
enabled by build flags.

SendSideBweWithOverheadTest.MinAndMaxBitrate now expects different
values for min bitrate depending on if we support 120 ms frames for
Opus.

BUG=b/35415435

Review-Url: https://codereview.webrtc.org/2691343008
Cr-Commit-Position: refs/heads/master@{#16643}
2017-02-16 13:37:06 +00:00
ossu
bcd88dbc01 WebRtcVoiceEngineTest: Changed a static_cast to a checked_cast.
Also two spelling fixes.
This is a follow-up to https://codereview.webrtc.org/2669583002/

TBR=kwiberg@webrtc.org
BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2697453004
Cr-Commit-Position: refs/heads/master@{#16586}
2017-02-13 15:04:05 +00:00
kwiberg
087bd34d23 Move AudioDecoder and related stuff to the api/ directory
BUG=webrtc:5805, webrtc:6725

Review-Url: https://codereview.webrtc.org/2668523004
Cr-Commit-Position: refs/heads/master@{#16534}
2017-02-10 16:15:44 +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
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
deadbeef
f534659ee6 Adding ability for BaseChannel to use PacketTransportInterface.
... As opposed to DtlsTransportInternal.

The code is suboptimal right now, storing two pointers to the different
interfaces. This will all be cleaned up when we have an "RtpTransport"
abstraction that BaseChannel can use.

This CL also cleans up the "fake transport" classes a bit, and gives
them their own header files.

BUG=None

Review-Url: https://codereview.webrtc.org/2648233003
Cr-Commit-Position: refs/heads/master@{#16258}
2017-01-25 05:51:21 +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
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
ossu
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
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
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
solenberg
d4adce4672 Remove Absolute Send Time from list of supported header extensions for audio streams.
Follow-up to https://codereview.webrtc.org/2473663002/.

BUG=b/32591921

Review-Url: https://codereview.webrtc.org/2501503004
Cr-Commit-Position: refs/heads/master@{#15132}
2016-11-17 14:26:59 +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
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
magjed
3663c52382 Provide move semantic for cricket::Codec and subclasses
The cricket::Codec class contains std containers like
std::map<std::string, std::string> and is expensive to copy. This CL
adds move constructors and move assignment operators for it and all
subclasses.

This CL also:
 * Implement functions with '= default' instead of doing it manually.
 * Makes codec::Matches symmetric. We currently don't check if the
   payload type of the callee is static, and might incorrectly return
   true in these cases.

BUG=None

Review-Url: https://codereview.webrtc.org/2481193002
Cr-Commit-Position: refs/heads/master@{#14956}
2016-11-07 18:14:44 +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
skvlad
11a9cbfa50 Refactoring: move ownership of RtcEventLog from Call to PeerConnection
This CL is a pure refactoring which should not result in any functinal
changes. It moves ownership of the RtcEventLog from webrtc::Call to the
webrtc::PeerConnection object.

This is done so that we can add RtcEventLog support for ICE events -
which will require the TransportController to have a pointer to the
RtcEventLog. PeerConnection is the closest common owner of both Call and
TransportController (through WebRtcSession).

BUG=webrtc:6393

Review-Url: https://codereview.webrtc.org/2353033005
Cr-Commit-Position: refs/heads/master@{#14578}
2016-10-07 18:53:15 +00:00
aleloi
18e0b67815 Restarting channel when swapping AudioReceiveStreams in WebrtcVoE.
BUG=webrtc:6346

Review-Url: https://codereview.webrtc.org/2383143002
Cr-Commit-Position: refs/heads/master@{#14493}
2016-10-04 09:45:54 +00:00
henrik.lundin
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
ossu
c54071d8ab WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs.
Reland of https://codereview.webrtc.org/2072753002/ which broke
chromium due to how their build was setup. This issue should now be
resolved.

Changed WebRtcVoiceEngine to present receive codecs from the formats
provided by its decoder factory. Added supported formats to
BuiltinAudioDecoderFactory. Added helper functions for creating some
simple decoder factories for mocking.

Created a PayloadTypeMapper for assigning payload types to formats. I
think we'll eventually want to use this further up, or possibly in
both the audio and video sides. It would be best if the engines didn't
have to talk payload types at all, but it might be more difficult to
get around when payload types depend on each-other, like the RTX
codecs for video.

BUG=webrtc:5805
TBR=ivoc@webrtc.org

Review-Url: https://codereview.webrtc.org/2250683002
Cr-Commit-Position: refs/heads/master@{#13793}
2016-08-17 09:45:47 +00:00
aleloi
84ef615a5d Removed calls to VoE::SetPlayout() from WebRTCVoiceEngine.
This is part of rewriting the ConferenceMixer and OutputMixer.

Calls are instead routed through AudioReceiveStream::Start/Stop.

NOTRY=True

Review-Url: https://codereview.webrtc.org/2206223002
Cr-Commit-Position: refs/heads/master@{#13636}
2016-08-04 12:28:28 +00:00
ossu
f93be584f7 Revert of WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs. (patchset #10 id:200001 of https://codereview.webrtc.org/2072753002/ )
Reason for revert:
For some reason, payload_type_mapper.cc is not being picked up in Chrome builds, leading to undefined references. Reverting while investigating.

Original issue's description:
> WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs.
>
> Changed WebRtcVoiceEngine to present receive codecs from the formats
> provided by its decoder factory. Added supported formats to
> BuiltinAudioDecoderFactory. Added helper functions for creating some
> simple decoder factories for mocking.
>
> Created a PayloadTypeMapper for assigning payload types to formats. I
> think we'll eventually want to use this further up, or possibly in
> both the audio and video sides. It would be best if the engines didn't
> have to talk payload types at all, but it might be more difficult to
> get around when payload types depend on each-other, like the RTX
> codecs for video.
>
> This CL also includes some changes to rtc::Optional. I've put them in
> a separate CL that should (or should not) land first, making these
> changes void.
> See: https://codereview.webrtc.org/2072713002/
>
> BUG=webrtc:5805
>
> Committed: https://crrev.com/95eb1ba0db79d8fd134ae61b0a24648598684e8a
> Cr-Commit-Position: refs/heads/master@{#13459}

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

Review-Url: https://codereview.webrtc.org/2151453002
Cr-Commit-Position: refs/heads/master@{#13460}
2016-07-13 13:31:37 +00:00
ossu
95eb1ba0db WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs.
Changed WebRtcVoiceEngine to present receive codecs from the formats
provided by its decoder factory. Added supported formats to
BuiltinAudioDecoderFactory. Added helper functions for creating some
simple decoder factories for mocking.

Created a PayloadTypeMapper for assigning payload types to formats. I
think we'll eventually want to use this further up, or possibly in
both the audio and video sides. It would be best if the engines didn't
have to talk payload types at all, but it might be more difficult to
get around when payload types depend on each-other, like the RTX
codecs for video.

This CL also includes some changes to rtc::Optional. I've put them in
a separate CL that should (or should not) land first, making these
changes void.
See: https://codereview.webrtc.org/2072713002/

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2072753002
Cr-Commit-Position: refs/heads/master@{#13459}
2016-07-13 13:05:32 +00:00
solenberg
217fb66e16 Add AudioReceiveStream::SetGain() method and use that in WVoMC::SetOutputVolume().
Removes the need to use VoEVolume::SetChannelOutputVolumeScaling().

BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2062193002
Cr-Commit-Position: refs/heads/master@{#13194}
2016-06-17 15:30:58 +00:00
solenberg
4a0f7b508d - Remove use of VoERTP_RTCP::SetLocalSSRC() for receive streams; recreate them instead.
- Remove VoERTP_RTCP from VoEWrapper and FakeWebRtcVoiceEngine.

BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2072783002
Cr-Commit-Position: refs/heads/master@{#13174}
2016-06-16 20:07:39 +00:00
solenberg
9421853e17 Add AudioSendStream::SetMuted() method and use it in WVoMC::MuteStream().
Removes the need to use VoEVolume::SetInputMute()/GetInputMute().

BUG=webrtc:4690
NOTRY=true

Review-Url: https://codereview.webrtc.org/2066973002
Cr-Commit-Position: refs/heads/master@{#13172}
2016-06-16 17:53:28 +00:00
solenberg
8189b02fea Configure VoE NACK through AudioReceiveStream::Config, for receive streams. Also minor refactoring of WVoE unit test.
BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2060813002
Cr-Commit-Position: refs/heads/master@{#13140}
2016-06-14 19:13:07 +00:00
solenberg
971cab0d93 Configure VoE NACK through AudioSendStream::Config, for send streams.
BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/1955363003
Cr-Commit-Position: refs/heads/master@{#13136}
2016-06-14 17:02:46 +00:00