69 Commits

Author SHA1 Message Date
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
kwiberg
6806136aec Remove RED support from WebRtcVoiceEngine/MediaChannel
This CL was originally written by solenberg@webrtc.org:
https://codereview.webrtc.org/1928233003/

BUG=webrtc:4690, webrtc:5922

Review-Url: https://codereview.webrtc.org/2051073002
Cr-Commit-Position: refs/heads/master@{#13133}
2016-06-14 15:04:53 +00:00
ossu
dedfd28a52 Support for two audio codec lists down into WebRtcVoiceEngine.
Added the plumbing necessary to get two different lists of codecs from
WebRtcVoiceEngine up to MediaSessionDescriptionFactory.

This should be the last step in this set of CLs. Once
https://codereview.webrtc.org/1991233004/ has landed, it's possible to
implement the ReceiveCodecs getter with the info from the
AudioDecoderFactory. The factory needs to be updated to actually
produce the correct list, as well.

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2013053002
Cr-Commit-Position: refs/heads/master@{#13131}
2016-06-14 14:12:46 +00:00
ossu
29b1a8d7ec Moved creation of AudioDecoderFactory to inside PeerConnectionFactory.
CreatePeerConnectionFactory does not yet expose the ability to set the
factory from the outside.

Added notry due to android_dbg being broken.

NOTRY=True
BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/1991233004
Cr-Commit-Position: refs/heads/master@{#13112}
2016-06-13 14:35:01 +00:00
isheriff
6f8d686d35 Remove use of RtpHeaderExtension and clean up
Currently there are two structs that are identical and track extension details:
webrtc::RtpExtension
cricket::RtpHeaderExtension

The use of the structs is mixed in the code to track the extensions being
supported. This results in duplicate definition of
the URI constants and there is code to convert between the two structs.

Clean up to use a single RtpHeader throughout the codebase. The actual location
of RtpHeader may change in future (perhaps to be located in api/). Additionally,
this CL renames some of the constants to clarify Uri and Id use.

BUG= webrtc:5895

Review-Url: https://codereview.webrtc.org/1984983002
Cr-Commit-Position: refs/heads/master@{#12924}
2016-05-26 18:25:04 +00:00
Taylor Brandstetter
db0cd9e774 Adding getParameters/setParameters APIs to RtpReceiver.
This is similar to how a "receive" method is used to apply
RtpParameters to an RtpReceiver in ORTC. Currently, SetParameters
doesn't allow changing the parameters, so the main use of the API is
to retrieve the set of configured codecs. But other uses will likely
be made possible in the future.

R=glaznev@webrtc.org, pthatcher@webrtc.org, tkchin@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12761}
2016-05-16 18:40:38 +00:00
minyuel
b031a2e862 Allow WebRTC to offer receiving capability for 120ms Opus packets.
TEST=Build Chromium for receiving + a special AppRTCDemo built with 120ms Opus sending capability. Call went well.

BUG=
R=solenberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12673}
2016-05-10 13:35:30 +00:00
deadbeef
b56069e650 Enable NACK for audio even if there are no send streams.
BUG=webrtc:5762

Review-Url: https://codereview.webrtc.org/1950963003
Cr-Commit-Position: refs/heads/master@{#12641}
2016-05-06 11:57:11 +00:00
solenberg
31fec40482 Set rtcp_send_transport for AudioReceiveStreams. This was forgotten in https://codereview.webrtc.org/1909333002/.
BUG=webrtc:4690, webrtc:5079, webrtc:5762

Review-Url: https://codereview.webrtc.org/1951833002
Cr-Commit-Position: refs/heads/master@{#12640}
2016-05-06 09:13:22 +00:00
Taylor Brandstetter
55dd70842c Support RtpEncodingParameters::active in voice engine.
R=solenberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12615}
2016-05-03 20:50:24 +00:00
solenberg
05e61edd8f Remove usage of VoENetwork from VoEWrapper and FakeWebRtcVoiceEngine.
BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/1934513002
Cr-Commit-Position: refs/heads/master@{#12566}
2016-04-29 16:05:35 +00:00
mflodman
3d7db263b9 Switch voice transport to use Call and Stream instead of VoENetwork.
VoENetwork is kept for now, but is not really used anylonger.

webrtcvoiceengine is changed to have the same behavior for unsignaled
ssrc as video has, which is reflected by disabling one test case and
this will be discussed and followed up.

BUG=webrtc:5079

TBR=tommi

Review-Url: https://codereview.webrtc.org/1909333002
Cr-Commit-Position: refs/heads/master@{#12555}
2016-04-29 07:57:21 +00:00
deadbeef
8034614b81 Cap the send bitrate for opus and iSAC before passing down to VoE.
The voice engine expects send bitrates no more than the maximum for the
codec. For example, 510kbps for opus. So if "b=AS" sets a maximum above
the codec maximum, WebRtcVoiceEngine needs to cap it.

BUG=603690

Review-Url: https://codereview.webrtc.org/1920123002
Cr-Commit-Position: refs/heads/master@{#12537}
2016-04-27 21:17:15 +00:00