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}
AudioDecoder and AudioDecoderFactory are in webrtc/api/ now, so move
their mocks to someplace central where tests from all over WebRTC are
allowed to #include them.
BUG=webrtc:5805
Review-Url: https://codereview.webrtc.org/2798063004
Cr-Commit-Position: refs/heads/master@{#17619}
As it is, the test fails to compile on some downstream compilers with the following error:
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:316:25: error: lambda capture 'kPayloadLength' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
.WillOnce(Invoke([kPayloadLength, kFirstSequenceNumber, kFirstTimestamp,
^
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:316:41: error: lambda capture 'kFirstSequenceNumber' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
.WillOnce(Invoke([kPayloadLength, kFirstSequenceNumber, kFirstTimestamp,
^
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:316:63: error: lambda capture 'kFirstTimestamp' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
.WillOnce(Invoke([kPayloadLength, kFirstSequenceNumber, kFirstTimestamp,
^
webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:317:25: error: lambda capture 'kFirstReceiveTime' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
kFirstReceiveTime](const SdpAudioFormat& format,
BUG=webrtc:7107
Review-Url: https://codereview.webrtc.org/2672823002
Cr-Commit-Position: refs/heads/master@{#16422}
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}
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}
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}
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}
The biggest change to NetEq is the move from a primary flag, to a
Priority with two separate levels: one set by RED splitting and one
set by the codec itself. This allows us to unambigously prioritize
"fallback" packets from these two sources. I've chosen what I believe
is the sensible ordering: packets that the codec prioritizes are
chosen first, regardless of if they are secondary RED packets or
not. So if we were to use Opus w/ FEC in RED, we'd only do Opus FEC
decoding if there was no RED packet that could cover the time slot.
With this change, PayloadSplitter now only deals with RED
packets. Maybe it should be renamed RedPayloadSplitter?
BUG=webrtc:5805
Review-Url: https://codereview.webrtc.org/2342443005
Cr-Commit-Position: refs/heads/master@{#14347}
There's still some code run specifically for Opus w/ FEC. It will be
addressed in a separate CL.
BUG=webrtc:5805
Review-Url: https://codereview.webrtc.org/2326003002
Cr-Commit-Position: refs/heads/master@{#14319}
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}
It allows the decoder to split the input up into usable chunks before
they are put into NetEq's PacketBuffer. Eventually, all packet splitting
will move into ParsePayload.
There's currently a base implementation of ParsePayload. It will
generate a single Frame that calls the underlying AudioDecoder for
getting Duration() and to Decode.
BUG=webrtc:5805
BUG=chromium:428099
Review-Url: https://codereview.webrtc.org/2326953003
Cr-Commit-Position: refs/heads/master@{#14300}
With this change, the value 0xFF is no longer used to flag that the RTP
type is unknown. Instead, an empty value for the rtc::Optional is used.
Review-Url: https://codereview.webrtc.org/2290153002
Cr-Commit-Position: refs/heads/master@{#13989}
the number of points that need to be mocked for testing.
For the now non-virtual methods, DecoderDatabase now does a lookup
through GetDecoderInfo and then delegates to the appropriate method in
the DecoderInfo object, if one is found.
A few other methods were also changed to look up through GetDecoderInfo.
Also moved the audio decoder factory into DecoderInfo, so that
DecoderInfo::GetDecoder can be used directly.
Review-Url: https://codereview.webrtc.org/2276913002
Cr-Commit-Position: refs/heads/master@{#13933}
And implement SampleRateHz in a bunch of mocks.
BUG=webrtc:5801
NOTRY=true
Review-Url: https://codereview.webrtc.org/2029543002
Cr-Commit-Position: refs/heads/master@{#13161}
This allows us to get rid of the function that computes it, which gets
us one step closer to getting rid of the NetEqDecoder type.
BUG=webrtc:5801
Review-Url: https://codereview.webrtc.org/2021063002
Cr-Commit-Position: refs/heads/master@{#12974}
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}
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}
The problem with gmock is worked around by commenting out any other override declarations in classes using gmock.
NOPRESUBMIT=True
BUG=webrtc:3970
Review-Url: https://codereview.webrtc.org/1921653002
Cr-Commit-Position: refs/heads/master@{#12563}
This change replaces packet_iat_count_ms_ and max_timer_ms_, two
time-counting member variables in DelayManager, with Stopwatch objects
obtained from a TickTimer.
BUG=webrtc:5608
Review-Url: https://codereview.webrtc.org/1929863002
Cr-Commit-Position: refs/heads/master@{#12554}
Specifically, this change replaces peak_period_counter_ms_ with
peak_period_stopwatch_ which obtains a Stopwatch object from
TickTimer. Necessary plumbing to get the TickTimer through to the
DelayPeakDetector is also included.
BUG=webrtc:5608
NOTRY=True
Review-Url: https://codereview.webrtc.org/1921163003
Cr-Commit-Position: refs/heads/master@{#12542}
With this change, the NetEqImpl constructor takes a struct
(NetEqImpl::Dependencies) as input instead of a collection of
individual dependencies. The NetEqImpl unit test fixture is modified
to make better used of unique_ptrs.
Review URL: https://codereview.webrtc.org/1921243002
Cr-Commit-Position: refs/heads/master@{#12514}
This change makes use of the TickTimer::Stopwatch in Packets. When a
packet is inserted into the PacketBuffer, a Stopwatch object is
attached to it. When the packet is extracted from the buffer, the
Stopwatch is read to know how long the packet waited in the buffer.
BUG=webrtc:5608
Review URL: https://codereview.webrtc.org/1917913002
Cr-Commit-Position: refs/heads/master@{#12508}
The TickTimer is incremented on each call to GetAudioInternal(). Other
than that, the new object is not used yet.
Also adding a unit test in NetEqImplTest to verify that the tick timer
is incremented in the call to NetEq::GetAudio.
BUG=webrtc:5608
Review URL: https://codereview.webrtc.org/1903153005
Cr-Commit-Position: refs/heads/master@{#12493}
By eliminating one of the two constructors, handling decoder ownership
with a unique_ptr instead of a raw pointer, and making all member
variables const (except one, which is made private instead).
BUG=webrtc:5801
Review URL: https://codereview.webrtc.org/1899733002
Cr-Commit-Position: refs/heads/master@{#12425}
With this change, the return value from NetEq::GetPlayoutTimestamp is
empty if the latest call to NetEq::GetAudio resulted in comfort noise
(codec-internal or external) being played out. This is because the
playout timestamp is not updated during CNG, and can therefore not be
trusted.
A few unit tests were updated to reflect the change.
BUG=webrtc:5669
Review URL: https://codereview.webrtc.org/1861303002
Cr-Commit-Position: refs/heads/master@{#12268}
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}
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}
Also removes virtual from VideoDecoder::Decode and updated mocks and
tests accordingly to use VideoDecoder::DecodeInternal instead.
BUG=webrtc:5167
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1512483003 .
Cr-Commit-Position: refs/heads/master@{#10935}
This change moves the logics for keeping track of the last ouput
sample rate from AcmReceiver to NetEq, where it fits better. The
getter function AcmReceiver::current_sample_rate_hz() is renamed to
last_output_sample_rate_hz().
BUG=webrtc:3520
Review URL: https://codereview.webrtc.org/1467163002
Cr-Commit-Position: refs/heads/master@{#10754}