RTP packets can be padded with extra data at the end of the payload. The usable
payload length of the packet should then be reduced with the padding length,
since the padding must be discarded. This was not the case; instead, the entire
payload, including padding data, was forwarded to the audio channel and in the
end to the decoder.
A special case of padding is packets which are empty except for the padding.
That is, they carry no usable payload. These packets are sometimes used for
probing the network and were discarded in
RTPReceiverAudio::ParseAudioCodecSpecific. The result is that NetEq never sees
those empty packets, just the holes in the sequence number series; this can
throw off the target buffer calculations.
With this change, the empty (after removing the padding) packets are let through,
all the way down to NetEq, to a new method called NetEq::InsertEmptyPacket. This
method notifies the DelayManager that an empty packet was received.
BUG=webrtc:7610, webrtc:7625
Review-Url: https://codereview.webrtc.org/2870043003
Cr-Commit-Position: refs/heads/master@{#18083}
Reason for revert:
Downstream roadblock should be cleared by now. Relanding original patch.
Original issue's description:
> Revert of Change NetEq::InsertPacket to take an RTPHeader (patchset #2 id:20001 of https://codereview.webrtc.org/2807273004/ )
>
> Reason for revert:
> Broke downstream dependencies.
>
> Original issue's description:
> > Change NetEq::InsertPacket to take an RTPHeader
> >
> > It used to take a WebRtcRTPHeader as input, which has an RTPHeader as
> > a member. None of the other member in WebRtcRTPHeader where used in
> > NetEq.
> >
> > This CL adapts the production code; tests and tools will be converted
> > in a follow-up CL.
> >
> > BUG=webrtc:7467
> >
> > Review-Url: https://codereview.webrtc.org/2807273004
> > Cr-Commit-Position: refs/heads/master@{#17652}
> > Committed: 4d027576a6
>
> TBR=ivoc@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7467
>
> Review-Url: https://codereview.webrtc.org/2812933002
> Cr-Commit-Position: refs/heads/master@{#17657}
> Committed: 10d095d4f7R=ivoc@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_rel_ng
BUG=webrtc:7467
Review-Url: https://codereview.webrtc.org/2835093002 .
Cr-Commit-Position: refs/heads/master@{#17843}
Reason for revert:
Broke downstream dependencies.
Original issue's description:
> Change NetEq::InsertPacket to take an RTPHeader
>
> It used to take a WebRtcRTPHeader as input, which has an RTPHeader as
> a member. None of the other member in WebRtcRTPHeader where used in
> NetEq.
>
> This CL adapts the production code; tests and tools will be converted
> in a follow-up CL.
>
> BUG=webrtc:7467
>
> Review-Url: https://codereview.webrtc.org/2807273004
> Cr-Commit-Position: refs/heads/master@{#17652}
> Committed: 4d027576a6TBR=ivoc@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7467
Review-Url: https://codereview.webrtc.org/2812933002
Cr-Commit-Position: refs/heads/master@{#17657}
It used to take a WebRtcRTPHeader as input, which has an RTPHeader as
a member. None of the other member in WebRtcRTPHeader where used in
NetEq.
This CL adapts the production code; tests and tools will be converted
in a follow-up CL.
BUG=webrtc:7467
Review-Url: https://codereview.webrtc.org/2807273004
Cr-Commit-Position: refs/heads/master@{#17652}
Deletes left-over includes of trace.h and critical_section_wrapper.h.
BUG=webrtc:7035
Review-Url: https://codereview.webrtc.org/2784873002
Cr-Commit-Position: refs/heads/master@{#17460}
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: 1724cfbdbaTBR=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}
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}
In short, what I did was to
* Remove acm_common_defs.h (the stuff in it was used only by
acm_codec_database.cc).
* Move audio_coding_module_typedefs.h to a new build target.
* Move the NetEqDecoder enum (and the associated
NetEqDecoderToSdpAudioFormat function) to a new file in a new
build target.
BUG=webrtc:7243, webrtc:7244
Review-Url: https://codereview.webrtc.org/2723253005
Cr-Commit-Position: refs/heads/master@{#17005}
It's the faster, less strict cousin of checked_cast.
BUG=none
Review-Url: https://codereview.webrtc.org/2714063002
Cr-Commit-Position: refs/heads/master@{#16958}
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}
NetEq already uses SdpAudioFormat internally; this CL adds an
AudioCodingModule::RegisterReceiveCodec overload that accepts
SdpAudioFormat, and propagates it through AcmReceiver into NetEq.
The intention is to get rid of the other ways to specify decoders and
always use SdpAudioFormat. (And eventually to do the same for encoders
too.)
NOTRY=true
BUG=5801
Review-Url: https://codereview.webrtc.org/2365653004
Cr-Commit-Position: refs/heads/master@{#14506}
NetEqDecoder is still used in the external interfaces, but this change
opens up the ability to use SdpAudioFormats directly, once appropriate
interfaces have been added.
BUG=webrtc:5805
Review-Url: https://codereview.webrtc.org/2355503002
Cr-Commit-Position: refs/heads/master@{#14368}
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}
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}
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}
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}
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}
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}
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}
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}
The new method returns the current total delay (packet buffer and sync
buffer) in ms, with smoothing applied to even out short-time
fluctuations due to jitter. The packet buffer part of the delay is not
updated during DTX/CNG periods.
This CL also pipes the new metric through ACM and uses it in
VoiceEngine. It replaces the previous method of estimating the buffer
delay (where an inserted packet's RTP timestamp was compared with the
last played timestamp from NetEq). The new method works better under
periods of DTX/CNG.
Review-Url: https://codereview.webrtc.org/2262203002
Cr-Commit-Position: refs/heads/master@{#13855}
Channel's API remains unchanged, but the creation of a BuiltinAudioDecoderFactory is now in Channel. The next step would be to amend Channel's API (through CreateChannel, I believe) to allow an AudioDecoderFactory to be sent along.
BUG=webrtc:5805
Review-Url: https://codereview.webrtc.org/1992763002
Cr-Commit-Position: refs/heads/master@{#12893}
The new parameter indicates if the output in the AudioFrame is muted. If
so, the output samples are not written, but should be interpreted as all
zero.
A version of AudioCodingModule::PlayoutData10Ms() without the new
parameter is maintained while waiting for downstream dependencies to
conform.
BUG=webrtc:5609
Review-Url: https://codereview.webrtc.org/1976913002
Cr-Commit-Position: refs/heads/master@{#12719}
This CL implements the muted output functionality in NetEq. Tests are
added. The feature is currently off by default, and AcmReceiver makes
sure that the muted state is not engaged.
BUG=webrtc:5608
Review-Url: https://codereview.webrtc.org/1965733002
Cr-Commit-Position: refs/heads/master@{#12711}
This was previously done in AcmReceiver, but belongs in NetEq where the
rest of the AudioFrame fields are populated.
BUG=webrtc:5669,webrtc:5607
Review URL: https://codereview.webrtc.org/1863993002
Cr-Commit-Position: refs/heads/master@{#12265}
This is in preparation for changes to when the playout timestamp is
valid.
BUG=webrtc:5669
Review URL: https://codereview.webrtc.org/1853183002
Cr-Commit-Position: refs/heads/master@{#12256}
This copies the contents (unittest excluded) of base/numerics in
chromium to base/numerics in webrtc. Files added:
- safe_conversions.h
- safe_conversions_impl.h
- safe_math.h
- safe_math_impl.h
A really old version of safe_conversions[_impl].h previously existed in
base/, this has been deleted and sources using it have been updated
to include the new base/numerics/safe_converions.h.
This CL also adds a DEPS file to webrtc/base.
NOPRESUBMIT=True
BUG=webrtc:5548, webrtc:5623
Review URL: https://codereview.webrtc.org/1753293002
Cr-Commit-Position: refs/heads/master@{#11907}
The type is included in the AudioFrame output parameter.
Rename the type NetEqOutputType to just OutputType, since it is now
internal to NetEq.
BUG=webrtc:5607
Review URL: https://codereview.webrtc.org/1769883002
Cr-Commit-Position: refs/heads/master@{#11903}
This change essentially does two things:
1. Remove the VAD-related methods from AcmReceiver. These are
EnableVad(), DisableVad(), and vad_enabled(). None of them were used
outside of unit tests.
2. Move the functionality to set AudioFrame::speech_type_ and
AudioFrame::vad_activity_ inside NetEq. This was previously done in
AcmReceiver, but based on information inherently owned by NetEq.
With the change in 2, NetEq's GetAudio interface can be simplified by
removing the output type parameter. This will be done in a follow-up
CL.
BUG=webrtc:5607
Review URL: https://codereview.webrtc.org/1772583002
Cr-Commit-Position: refs/heads/master@{#11902}
With this change, NetEq now uses AudioFrame as output type, like the
surrounding functions in ACM and VoiceEngine already do.
The computational savings is probably slim, since one memcpy is
removed while another one is added (both in AcmReceiver::GetAudio).
More simplifications and clean-up will be done in
AcmReceiver::GetAudio in future CLs.
BUG=webrtc:5607
Review URL: https://codereview.webrtc.org/1750353002
Cr-Commit-Position: refs/heads/master@{#11874}
The new fields are default-populated for built-in decoders, but for
external decoders, the name can now be given when registering the
decoder.
BUG=webrtc:3520
Review URL: https://codereview.webrtc.org/1484343003
Cr-Commit-Position: refs/heads/master@{#10952}
This is the last piece of the old directory layout of the modules.
Duplicated header files are left in audio_coding/main/include until
downstream code is updated to the new location. They have pragma
warnings added to them and identical header guards as the new headers to avoid breaking things.
BUG=webrtc:5095
TESTED=Passing compile-trybots with --clobber flag:
git cl try --clobber --bot=win_compile_rel --bot=linux_compile_rel --bot=android_compile_rel --bot=mac_compile_rel --bot=ios_rel --bot=linux_gn_rel --bot=win_x64_gn_rel --bot=mac_x64_gn_rel --bot=android_gn_rel -m tryserver.webrtc
NOTRY=True
NOPRESUBMIT=True
Review URL: https://codereview.webrtc.org/1481493004
Cr-Commit-Position: refs/heads/master@{#10803}