Merge the contents of audio_encoder_mutable_opus_test.cc into
audio_encoder_opus_unittest.cc, since they're now both testing
AudioEncoderOpus.
(While preparing this CL, I noted a bug in the PacketLossRateOptimized
test. This CL leaves that test essentially unchanged; I've posted bug
4981 about the problem.)
Review URL: https://codereview.webrtc.org/1319713004
Cr-Commit-Position: refs/heads/master@{#9906}
And the corresponding ACM methods SetISACMaxRate and
SetISACMaxPayloadSize. They were only used in tests.
Review URL: https://codereview.webrtc.org/1311533010
Cr-Commit-Position: refs/heads/master@{#9903}
An option was added to voe_cmd_test to make a RtcEventLog dump.
BUG=webrtc:4741
Review URL: https://codereview.webrtc.org/1267683002
Cr-Commit-Position: refs/heads/master@{#9901}
There's no point in returning a status code, since the max playback rate
is only a suggestion that the encoder is free to disregard.
Review URL: https://codereview.webrtc.org/1332573003
Cr-Commit-Position: refs/heads/master@{#9900}
It makes more sense to combine the two interfaces, since there wasn't
a clear line separating them. The result is a combined interface with
just over a dozen methods, half of which need to be implemented by
every subclass, while the other half have sensible (and trivial)
default implementations and are implemented only by the few subclasses
that need non-default behavior.
Review URL: https://codereview.webrtc.org/1322973004
Cr-Commit-Position: refs/heads/master@{#9894}
This CL adds support for simulating neteq using stored RTP packets as well as calls to GetAudio from an RtcEventLog, using the stored timestamps.
The type of the input file is detected automatically.
BUG=webrtc:4741
Review URL: https://codereview.webrtc.org/1316903002
Cr-Commit-Position: refs/heads/master@{#9886}
The easy way also happens to be more efficient if we have to
reallocate, but that's a minor concern here.
Review URL: https://codereview.webrtc.org/1327053002
Cr-Commit-Position: refs/heads/master@{#9876}
Hopefully, this will make it easier to figure out what's wrong the
next time this happens.
BUG=526478
Review URL: https://codereview.webrtc.org/1313073008
Cr-Commit-Position: refs/heads/master@{#9844}
In some cases, the number of samples (per channel) in NetEq's sync
buffer could fall below the allowed minimum (5 samples for narrowband,
scaling for other rates). If the number of samples extracted from the
buffer was smaller than the desired number, an error is
returned. However, if the decoder returns fewer samples than expected,
it could happen that the sync buffer level falls under the minimum,
but enough samples are extracted. This triggered an assert. With this
change, the minimum level of the sync buffer is always enforced.
A test is implemented to trigger the problem. It made the assert fire
without this fix, but it now passes.
BUG=webrtc:4840
R=minyue@webrtc.org
Review URL: https://codereview.webrtc.org/1324453002 .
Cr-Commit-Position: refs/heads/master@{#9828}
These asserts cover error cases that are also handled by the code
after the assert. Should not have both assert and error handling.
BUG=webrtc:4840
Review URL: https://codereview.webrtc.org/1321023002
Cr-Commit-Position: refs/heads/master@{#9804}
This is a bug that was introduced in
https://codereview.webrtc.org/1230503003, where the variable "int
temp_bufsize" was changed to a size_t. If the packet buffer was
flushed while inserting a packet, temp_bufsize became negative, which
was tested later in an if-statement. Now, with size_t instead, it
would just become very large, and the if-statement would never see a
negative value. The effect was that the packet size in samples could
be updated with a very large positive number, causing an overflow
which triggered rtc::checked_cast in
StatisticsCalculator::GetNetworkStatistics, line 220.
Also adding a test to reproduce the crash. Without the fix, the test
results in the above mentioned checked_cast to trigger. With the fix,
everything works fine.
BUG=chromium:525260
Review URL: https://codereview.webrtc.org/1307893004
Cr-Commit-Position: refs/heads/master@{#9802}
This was not implemented before. It returns the current total delay
(packet buffer and sync buffer) of NetEq. This is the same information
that was already available in
NetEqNetworkStatistics::current_buffer_size_ms, that can be obtained
through NetEq::NetworkStatistics(). But, since the current delay is a
key metric of NetEq, it is convenient to have it available in a
simpler way.
This is a re-landing of r9359,
https://webrtc-codereview.appspot.com/51149004, which was reverted in
r9360. The refactoring made in r9669 facilitated the relanding.
TBR=minyue@webrtc.org
Review URL: https://codereview.webrtc.org/1313873003
Cr-Commit-Position: refs/heads/master@{#9801}
The Init() method was previously used to initialize and reset
decoders, and returned an error code. The new Reset() method is used
for reset only; the constructor is now responsible for fully
initializing the AudioDecoder.
Reset() doesn't return an error code; it turned out that none of the
functions it ended up calling could actually fail, so this CL removes
their error return codes as well.
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1319683002 .
Cr-Commit-Position: refs/heads/master@{#9798}
The Buffer is saved between calls, so after the initial allocation
it'll already be allocated and of the right size. The stack-allocated
array had the advantage of requiring no heap allocation at all, but
for most popular encoders it ended up allocating about 15 kB too much,
and now that we allow user-defined encoders there was also the
(remote) possibility that the buffer would actually be too small.
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1303413003 .
Cr-Commit-Position: refs/heads/master@{#9789}
With this change, the aggregates for packet waiting times are
calculated in NetEq's StatisticsCalculator insead of in
AcmReceiver. This simplifies things somewhat, and avoids having to
copy the raw data on polling.
R=ivoc@webrtc.org, minyue@webrtc.org
Review URL: https://codereview.webrtc.org/1296633002 .
Cr-Commit-Position: refs/heads/master@{#9778}
By converting three raw pointers to scoped_ptrs, we can eliminate the
need for a manually-defined destructor, and generally sleep better at
night.
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1310213003 .
Cr-Commit-Position: refs/heads/master@{#9776}
The only shared state is now the bandwidth estimation info.
This reduces the amount and complexity of the locking
substantially.
Review URL: https://codereview.webrtc.org/1208993010
Cr-Commit-Position: refs/heads/master@{#9762}
This CL adds calculation and logging of average excess buffer delay
and number of delayed packet outage events per minute.
The first is the average of time spent in the packet buffer for all
packets. The average is calculated for intervals of one minute, and
the result is logged to the UMA stat
WebRTC.Audio.AverageExcessBufferDelayMs.
The second is a counter of delayed packet outage events that is
restarted every minute, and the result is logged to the UMA stat
WebRTC.Audio.DelayedPacketOutageEventsPerMinute. For a description of
delayed packet outages, see previous CL implementing a duration log
for these events.
BUG=webrtc:4915, chromium:488124
R=minyue@webrtc.org
Review URL: https://codereview.webrtc.org/1287333005 .
Cr-Commit-Position: refs/heads/master@{#9731}
Measures the duration of each packet loss concealment (a.k.a. expand)
event that is not followed by a merge operation.
Having decoded and played packet m−1, the next expected packet is
m. If packet m arrives after some time of packet loss concealment, we
have a delayed packet outage event. However, if instead packet n>m
arrives, we have a lost packet outage event. In NetEq, the two outage
types results in different operations. Both types start with expand
operations to generate audio to play while the buffer is empty. When a
lost packet outage happens, the expand operation(s) are followed by
one merge operation. For delayed packet outages, merge is not done,
and the expand operations are immediately followed by normal
operations.
This change also includes unit tests for the new statistics.
BUG=webrtc:4915, chromium:488124
R=minyue@webrtc.org
Review URL: https://codereview.webrtc.org/1290113002 .
Cr-Commit-Position: refs/heads/master@{#9725}
This change includes base/logging.h instead of the old and deprecated
system_wrappers/interface/logging.h. This requires some changes of the
actual logging invocations.
For reference the following regexps where used (in Eclipse) for a few
of the replacements:
find: LOG_FERR1\(\s*([^,]*),\s*([^,]*),\s*(.*)\);
replace: LOG($1) << "$2 " << $3;
find: LOG_FERR2\(\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*(.*)\);
replace: LOG($1) << "$2 " << $3 << " " << $4;
BUG=4735
R=minyue@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/50229004 .
Cr-Commit-Position: refs/heads/master@{#9669}
Re-lands "Renamed the ACMDump to RtcEventLog and moved it to webrtc/video, since it is not specific to the audio coding module."
This reverts commit b933667a7f97697d6390d1eee5f378cedd9ca208.
R=pbos@webrtc.org
Review URL: https://codereview.webrtc.org/1259683003 .
Cr-Commit-Position: refs/heads/master@{#9661}
Prevents presubmit failures when touching audio_coding_module.gypi due
to source files being included from outside the gypi directory.
BUG=
R=minyue@webrtc.org
Review URL: https://codereview.webrtc.org/1262333002 .
Cr-Commit-Position: refs/heads/master@{#9659}
Placed the protobuf structures in the namespace webrtc::rtclog. Removed the message field from the DebugEvent structure, since it was not used.
Added an interface to set config information for VideoReceiveStream and VideoSendStream in the event log.
Added function to log full RTCP packets and changed RTP-logging to only log headers.
Significantly extended the unit tests for RtcEventLog.
R=ivoc@webrtc.org, minyue@webrtc.org, pbos@webrtc.org, stefan@webrtc.org
Review URL: https://codereview.webrtc.org/1230973005 .
Cr-Commit-Position: refs/heads/master@{#9656}
WebRtcIsacfix_AllpassFilter2FixDec16Neon was disabled due to a Clang
bug. The bug is fixed in current Clang version, re-enable it in this patch.
BUG=4567
R=andrew@webrtc.org, kjellander@webrtc.org
TEST=buildbot build
Change-Id: I71e309cec6caf376181cf9c299c9e8967c9a328e
Review URL: https://codereview.webrtc.org/1194773002 .
Patch from Zhongwei Yao <zhongwei.yao@arm.com>.
Cr-Commit-Position: refs/heads/master@{#9645}
These are mostly trivial changes and are separated out just to reduce the
diff on that change to the minimum possible.
Note explanatory comments on patch set 1.
BUG=none
TEST=none
Review URL: https://codereview.webrtc.org/1235643003
Cr-Commit-Position: refs/heads/master@{#9617}
This patch tests separate iSAC encoder and decoder in more cases (32
kHz in addition to 16 kHz, and 30 ms adaptive and 60 ms nonadaptive).
In order to handle 32 kHz adaptive, the decoder needs to be told of
the encoder's sample rate (16 kHz worked already because that's the
default). And since we can't set the encoder's frame size without also
setting its bit rate, we need a way to set the decoder's bit rate as
well.
It turned out to be way too messy to continue verifying that the
bandwidth estimator does something reasonable in all these cases,
because it seems it doesn't. So the GetSetBandwidthInfo is now just
responsible for ensuring that split encoder/decoder behaves the same
as conjoined encoder/decoder; the job of verifying that the bandwidth
estimator does its job properly falls on some other test (that doesn't
exist yet).
Review URL: https://codereview.webrtc.org/1225093005
Cr-Commit-Position: refs/heads/master@{#9583}
They make it possible to send bandwidth estimation info from decoder
to encoder even if they are separate objects (which we want them to be
because multithreading).
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1208923002.
Cr-Commit-Position: refs/heads/master@{#9535}
Using random "garbage" bytes makes testing harder for no good reason.
Any deterministic sequence would do, but we choose all zeros because
it's simple.
Review URL: https://codereview.webrtc.org/1211243014
Cr-Commit-Position: refs/heads/master@{#9532}
in the ACMDump. The ACMDump interface itself is not updated, so there
is no way (yet) to actually write the configuration fields.
BUG=
Review URL: https://codereview.webrtc.org/1202833003
Cr-Commit-Position: refs/heads/master@{#9519}
All ownership is now handled by the top-level OWNERS file in
modules/audio_coding.
NOTRY=True
Review URL: https://codereview.webrtc.org/1212133005
Cr-Commit-Position: refs/heads/master@{#9512}
This change introduces the sub-class ChangeLogger in AudioCodingModuleImpl. The class writes values to the named UMA histogram, but only if the value has changed since the last time (and always for the first call). This is to avoid the problem with audio codecs being registered but never used. Before this change, these codecs' bitrate was also logged, even though they were never used.
BUG=chromium:488124
R=kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1203803004
Cr-Commit-Position: refs/heads/master@{#9506}