556 Commits

Author SHA1 Message Date
danilchap
56359be7fe Update thread annotiation macros in modules to use RTC_ prefix
BUG=webrtc:8198

Review-Url: https://codereview.webrtc.org/3010223002
Cr-Commit-Position: refs/heads/master@{#19728}
2017-09-07 14:53:45 +00:00
kwiberg
84f6a3fc6b Move optional.h to webrtc/api/
We use Optional in our public API, so its header should be in
webrtc/api/.

BUG=webrtc:8205

Review-Url: https://codereview.webrtc.org/3011943002
Cr-Commit-Position: refs/heads/master@{#19693}
2017-09-05 15:43:13 +00:00
kwiberg
529662a44c Move array_view.h to webrtc/api/
We use ArrayView in our public API, so its header should be in
webrtc/api/.

BUG=none

Review-Url: https://codereview.webrtc.org/3007763002
Cr-Commit-Position: refs/heads/master@{#19658}
2017-09-04 12:43:17 +00:00
oprypin
6e09d875fb Replace remaining gflags usages with rtc_base/flags
Continued from https://codereview.webrtc.org/2995363002

BUG=webrtc:7644

Review-Url: https://codereview.webrtc.org/3005483002
Cr-Commit-Position: refs/heads/master@{#19624}
2017-08-31 10:21:39 +00:00
henrik.lundin
9657172a81 neteq_rtpplay: Add one more RTP header extension and fix some stats
The extension ID for transport sequence number is added to the list of
known RTP header extensions. Also, the minimum and maximum waiting
time for packets is now aggregated as minimum and maximum,
respectively, not as averages.

BUG=none

Review-Url: https://codereview.webrtc.org/3004783003
Cr-Commit-Position: refs/heads/master@{#19593}
2017-08-30 07:41:30 +00:00
henrik.lundin
f09c904dd1 neteq_rtpplay: Fix a bug in the matlab plotting function
This CL fixes a small bug, causing the matlab plot script to contain
empty vectors. Also, the script file name is fixed, to avoid two
periods (.) in the file name; matlab did not like that.

BUG=none

Review-Url: https://codereview.webrtc.org/3004813002
Cr-Commit-Position: refs/heads/master@{#19586}
2017-08-29 16:14:08 +00:00
oprypin
9b2f20c618 Replace gflags usages with rtc_base/flags in all targets based on test_main
BUG=webrtc:7644

Review-Url: https://codereview.webrtc.org/2995363002
Cr-Commit-Position: refs/heads/master@{#19580}
2017-08-29 12:51:57 +00:00
lliuu
ff2824b917 Fix compiler warnings due to type mismatch.
BUG=webrtc:8169

Change-Id: Ie98dcaa09e1e5b7c9f48410cd3049740ccac67b9
Reviewed-on: https://chromium-review.googlesource.com/639314
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Commit-Queue: Lu Liu <lliuu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19567}
2017-08-28 20:31:58 +00:00
Steve Anton
2dbc69fa64 Add stats totalSamplesReceived and concealedSamples
Adds two new stats to RTCMediaStreamTrackStats:
* totalSamplesReceived is the total number of samples received on
      the audio channel and includes real and synthetic samples.
* concealedSamples is the total number of synthetic samples
      received on the audio channel used to conceal packet loss.

Bug: webrtc:8076
Change-Id: I36e9828525ec341490cf3310a972b56a8b443667
Reviewed-on: https://chromium-review.googlesource.com/615902
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19506}
2017-08-25 00:50:42 +00:00
minyue-webrtc
0c3ca753c5 Replacing NetEq discard rate with secondary discarded rate.
NetEq network statistics contains discard rate but has not been used and even not been implemented until recently.

According to w3c.github.io/webrtc-stats/#dom-rtcreceivedrtpstreamstats-packetsdiscarded,
this statistics needs to be replaced with an accumulative stats. Such work will be carried out separately.

Meanwhile, we need to add a rate to reflect rate of discarded redundant packets. See webrtc:8025.

In this CL, we replace the existing discard rate with secondary discarded rate, so as to
1. fulfill the requests on webrtc:8025
2. get ready to implement an accumulative statistics for discarded packets.

BUG: webrtc:7903,webrtc:8025
Change-Id: Idbf143a105db76ca15f0af54848e1448f2a810ec
Reviewed-on: https://chromium-review.googlesource.com/582863
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19495}
2017-08-24 13:46:52 +00:00
kwiberg
6ff045f097 Give Audio{De,En}coderIsac* an "Impl" suffix, to free up the original names
I want to publish an API for iSAC in webrtc/api/, and I want to use
the class names Audio{De,En}coderIsac{Fix,Float}.

BUG=webrtc:7835, webrtc:7841

Review-Url: https://codereview.webrtc.org/2996593002
Cr-Commit-Position: refs/heads/master@{#19381}
2017-08-17 12:31:02 +00:00
srte
186d9c3873 Renamed fields in common_types.h/RtcpStatistics.
BUG=webrtc:8033

Review-Url: https://codereview.webrtc.org/2992043002
Cr-Commit-Position: refs/heads/master@{#19247}
2017-08-04 12:03:53 +00:00
minyue-webrtc
516711cde9 Turning on Opus 120ms frame length switch.
Chromium has adopted Opus 1.2.1 which allows 120ms frame encoding. It
is time to turn on the switch for building WebRTC with this feature.


Bug: webrtc:8042
TBR: kjellander@webrtc.org
Change-Id: I644b47cfb56f835695ef1263741cda6e3ee3d862
Reviewed-on: https://chromium-review.googlesource.com/586725
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Felicia Lim <flim@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19173}
2017-07-27 17:23:35 +00:00
minyue-webrtc
adb58b88a1 Renable some Opus tests after Opus 1.2.1 update.
Bug: webrtc:8024
Change-Id: Ia7b9de70ef85e4ac32a7b84088b79cc6a260cc69
Reviewed-on: https://chromium-review.googlesource.com/586867
Reviewed-by: Felicia Lim <flim@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19164}
2017-07-27 07:40:14 +00:00
flim
bf8202185c Disable some Opus tests pending an update
These tests will be reenabled and updated after Opus has been updated in
Chromium and rolled into WebRTC.

BUG=737323, webrtc:8024

Review-Url: https://codereview.webrtc.org/2963673002
Cr-Commit-Position: refs/heads/master@{#19118}
2017-07-24 09:17:38 +00:00
minyue-webrtc
12d30840d8 Correct the calculation of discard rate.
Bug: webrtc:7903
Change-Id: Ib5d6fd882a994dd542b616e5fe1c75710346dd31
Reviewed-on: https://chromium-review.googlesource.com/575057
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19101}
2017-07-20 09:15:46 +00:00
Jonathan Yu
3ffa72d0f0 Add AudioFrame::ResetWithoutMuting() to address performance regression.
Prior to https://codereview.webrtc.org/2750783004/ Reset() intentionally
did not zero out the buffer. After that change, callers calling Reset()
and then mutable_data() were performing a wasteful zeroing.

This change adds ResetWithoutMuting() to match the old behavior and
switches the sole non-test caller of Reset() to use ResetWithoutMuting()
instead.

Prior to this change (optimized, Linux):
$ out/Default/webrtc_perf_tests --gtest_filter=NetEqPerformanceTest.Run* \
  --gtest_repeat=10 | grep neteq_performance
*RESULT neteq_performance: 10_pl_10_drift= 4051 ms
*RESULT neteq_performance: 0_pl_0_drift= 1768 ms
*RESULT neteq_performance: 10_pl_10_drift= 3666 ms
*RESULT neteq_performance: 0_pl_0_drift= 1690 ms
*RESULT neteq_performance: 10_pl_10_drift= 3685 ms
*RESULT neteq_performance: 0_pl_0_drift= 1693 ms
*RESULT neteq_performance: 10_pl_10_drift= 3720 ms
*RESULT neteq_performance: 0_pl_0_drift= 1690 ms
*RESULT neteq_performance: 10_pl_10_drift= 3780 ms
*RESULT neteq_performance: 0_pl_0_drift= 1728 ms
*RESULT neteq_performance: 10_pl_10_drift= 3733 ms
*RESULT neteq_performance: 0_pl_0_drift= 1737 ms
*RESULT neteq_performance: 10_pl_10_drift= 3781 ms
*RESULT neteq_performance: 0_pl_0_drift= 1744 ms
*RESULT neteq_performance: 10_pl_10_drift= 3712 ms
*RESULT neteq_performance: 0_pl_0_drift= 1731 ms
*RESULT neteq_performance: 10_pl_10_drift= 3681 ms
*RESULT neteq_performance: 0_pl_0_drift= 1691 ms
*RESULT neteq_performance: 10_pl_10_drift= 3681 ms
*RESULT neteq_performance: 0_pl_0_drift= 1690 ms

With this change:
$ out/Default/webrtc_perf_tests --gtest_filter=NetEqPerformanceTest.Run* \
  --gtest_repeat=10 | grep neteq_performance
*RESULT neteq_performance: 10_pl_10_drift= 3824 ms
*RESULT neteq_performance: 0_pl_0_drift= 1632 ms
*RESULT neteq_performance: 10_pl_10_drift= 3502 ms
*RESULT neteq_performance: 0_pl_0_drift= 1521 ms
*RESULT neteq_performance: 10_pl_10_drift= 3520 ms
*RESULT neteq_performance: 0_pl_0_drift= 1534 ms
*RESULT neteq_performance: 10_pl_10_drift= 3517 ms
*RESULT neteq_performance: 0_pl_0_drift= 1530 ms
*RESULT neteq_performance: 10_pl_10_drift= 3521 ms
*RESULT neteq_performance: 0_pl_0_drift= 1527 ms
*RESULT neteq_performance: 10_pl_10_drift= 3511 ms
*RESULT neteq_performance: 0_pl_0_drift= 1533 ms
*RESULT neteq_performance: 10_pl_10_drift= 3518 ms
*RESULT neteq_performance: 0_pl_0_drift= 1523 ms
*RESULT neteq_performance: 10_pl_10_drift= 3503 ms
*RESULT neteq_performance: 0_pl_0_drift= 1524 ms
*RESULT neteq_performance: 10_pl_10_drift= 3514 ms
*RESULT neteq_performance: 0_pl_0_drift= 1534 ms
*RESULT neteq_performance: 10_pl_10_drift= 3501 ms
*RESULT neteq_performance: 0_pl_0_drift= 1530 ms

BUG=webrtc:7343,chromium:738852,chromium:738839

Change-Id: Idcbb276ca0ed27fff95164a73f1c1fa310175ee5
Reviewed-on: https://chromium-review.googlesource.com/563021
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Olga Sharonova <olka@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18939}
2017-07-08 23:36:26 +00:00
Edward Lemur
c20978e581 Rename webrtc/base -> webrtc/rtc_base
NOPRESUBMIT=True # cpplint errors that aren't caused by this CL.
NOTRY=True
NOTREECHECKS=True
TBR=kwiberg@webrtc.org, kjellander@webrtc.org

Bug: webrtc:7634
Change-Id: I3cca0fbaa807b563c95979cccd6d1bec32055f36
Reviewed-on: https://chromium-review.googlesource.com/562156
Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18919}
2017-07-06 19:11:40 +00:00
henrik.lundin
a44910787b Let NetEq reset the AudioFrame during muted state
In practice, this change will make AudioFrame::muted_ replicate the
explicit muted variable, passed as a pointer to NetEq::GetAudio.

BUG=webrtc:7944

Review-Url: https://codereview.webrtc.org/2965203002
Cr-Commit-Position: refs/heads/master@{#18914}
2017-07-06 12:23:53 +00:00
henrik.lundin
63d146b743 NetEq: Rectify the implementation of PacketBuffer::DiscardOldPackets
The implementation of this method did not follow the description in
the method comment. It was supposed to delete all packets in a range
[A, B], but if at least one packet in the buffer had a timestamp lower
than A, then no packets at all were discarded. This is now fixed.

BUG=webrtc:7937

Review-Url: https://codereview.webrtc.org/2969123003
Cr-Commit-Position: refs/heads/master@{#18903}
2017-07-05 14:03:34 +00:00
minyue-webrtc
fae474c9cd Implement packet discard rate in NetEq.
BUG=webrtc:7903

Change-Id: I819c9362671ca0b02c602d53e4dc39afdd8ec465
Reviewed-on: https://chromium-review.googlesource.com/555311
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18899}
2017-07-05 10:18:00 +00:00
Henrik Kjellander
dca1e09db7 Revert "Update includes for webrtc/{base => rtc_base} rename (1/3)"
This reverts commit c8fa692ec44fd6ba4fa3d085ac3161a262fc18c5.

BUG=webrtc:7634
NOTRY=True
NOPRESUBMIT=True

Review-Url: https://codereview.webrtc.org/2964773002 .
Cr-Commit-Position: refs/heads/master@{#18872}
2017-07-01 14:42:25 +00:00
kjellander
c8fa692ec4 Update includes for webrtc/{base => rtc_base} rename (1/3)
I used a command like this to update the paths:
perl -pi -e "s/webrtc\/base/webrtc\/rtc_base/g" `find webrtc/rtc_base -name "*.cc" -o -name "*.h"`

The only manual edit is to add an include of webrtc/rtc_base/checks.h in
webrtc/modules/audio_device/android/opensles_common.h, which likely
was needed due to changed include paths due to 'git cl format'.

BUG=webrtc:7634
NOTRY=True
NOPRESUBMIT=True

Review-Url: https://codereview.webrtc.org/2969653002
Cr-Commit-Position: refs/heads/master@{#18871}
2017-06-30 21:02:00 +00:00
kwiberg
96d74bb933 Opus implementation of the AudioDecoderFactoryTemplate API
(This got reverted because of a problem with the Opus encoder parts.
Re-landing without changes.)

BUG=webrtc:7837

Review-Url: https://codereview.webrtc.org/2950453002
Cr-Commit-Position: refs/heads/master@{#18855}
2017-06-30 12:24:56 +00:00
kwiberg
96da0115d7 Opus implementation of the AudioEncoderFactoryTemplate API
This was previously reverted, because external projects were using the
internal webrtc::AudioEncoderOpus class and broke when it was renamed.
This re-land avoids renaming it immediately, to give those projects
time to adapt. It also has to revert some of the changes I had made to the
Config struct, since that was also used by the same external projects.

BUG=webrtc:7831

Review-Url: https://codereview.webrtc.org/2948483002
Cr-Commit-Position: refs/heads/master@{#18852}
2017-06-30 11:23:22 +00:00
Mirko Bonadei
b14fad45b8 Adding newline at the end of .proto files
Some .proto files have newline at the end. This CL levels all our .proto
files. A presubmit check will follow.

NOTRY=True
TBR=minyue@webrtc.org

Bug: None
Change-Id: I988fe94c31abf91c85a45b564c488329d677b958
Reviewed-on: https://chromium-review.googlesource.com/552137
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18823}
2017-06-29 07:09:12 +00:00
solenberg
db3c9b0f72 Expose ILBC codec in webrtc/api/audio_codecs/
BUG=webrtc:7834, webrtc:7840

Review-Url: https://codereview.webrtc.org/2951873002
Cr-Commit-Position: refs/heads/master@{#18803}
2017-06-28 09:05:04 +00:00
kwiberg
1b97e26364 Don't forget to support G722 stereo decoding
https://codereview.webrtc.org/2940833002 added support for G722
decoding with the AudioDecoderFactoryTemplate API, but forgot to
support stereo.

BUG=webrtc:7839

Review-Url: https://codereview.webrtc.org/2945423003
Cr-Commit-Position: refs/heads/master@{#18761}
2017-06-26 11:19:43 +00:00
Henrik Lundin
a2af000882 Improve the simulation stats aggregation in neteq_rtpplay
The network stats used to be polled from the NetEq object once at the
very end of the simulation. With this change, the stats are polled
once every second, and then aggregated at the end of the run. This
leads to more meaningful numbers.

Bug: webrtc:2692
Change-Id: I9e0f4ddada2f9e42fb9234970deb1af235fffc8c
Reviewed-on: https://chromium-review.googlesource.com/541218
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18682}
2017-06-20 16:20:00 +00:00
Henrik Lundin
0bc0ccdc43 Add Matlab plotting script generator to neteq_rtpplay
This change adds an option to have neteq_rtpplay generate a Matlab
script. When executed in Matlab, the script will generate graphs with
the timing information from the test run.

The script is generated when the flag --matlabplot is passed to
neteq_rtpplay.

The CL also adds better checking and reporting about packets discarded
in the process of finding out the initial sampling rate.

Bug: webrtc:2692, webrtc:7467
Change-Id: I805e7c83b82533142b6e74bf065506e3d60a8170
Reviewed-on: https://chromium-review.googlesource.com/541276
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18680}
2017-06-20 14:22:19 +00:00
charujain
1a610f15c3 Revert of Opus implementation of the AudioEncoderFactoryTemplate API (patchset #4 id:80001 of https://codereview.webrtc.org/2930243003/ )
Reason for revert:
Breaking google3 projects

Original issue's description:
> Opus implementation of the AudioEncoderFactoryTemplate API
>
> Now the templated AudioEncoderFactory can create Opus encoders!
>
> BUG=webrtc:7831
>
> Review-Url: https://codereview.webrtc.org/2930243003
> Cr-Commit-Position: refs/heads/master@{#18645}
> Committed: fe1aa82c63

TBR=ossu@webrtc.org,solenberg@webrtc.org,kwiberg@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7831

Review-Url: https://codereview.webrtc.org/2947563002
Cr-Commit-Position: refs/heads/master@{#18649}
2017-06-18 09:38:58 +00:00
charujain
eb2d2d31d1 Revert of Opus implementation of the AudioDecoderFactoryTemplate API (patchset #1 id:1 of https://codereview.webrtc.org/2942733003/ )
Reason for revert:
breaking downstream projects

Original issue's description:
> Opus implementation of the AudioDecoderFactoryTemplate API
>
> BUG=webrtc:7837
>
> Review-Url: https://codereview.webrtc.org/2942733003
> Cr-Commit-Position: refs/heads/master@{#18646}
> Committed: d053fe4ab3

TBR=ossu@webrtc.org,solenberg@webrtc.org,kwiberg@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7837

Review-Url: https://codereview.webrtc.org/2944763002
Cr-Commit-Position: refs/heads/master@{#18648}
2017-06-18 09:37:17 +00:00
kwiberg
d053fe4ab3 Opus implementation of the AudioDecoderFactoryTemplate API
BUG=webrtc:7837

Review-Url: https://codereview.webrtc.org/2942733003
Cr-Commit-Position: refs/heads/master@{#18646}
2017-06-18 01:40:52 +00:00
kwiberg
fe1aa82c63 Opus implementation of the AudioEncoderFactoryTemplate API
Now the templated AudioEncoderFactory can create Opus encoders!

BUG=webrtc:7831

Review-Url: https://codereview.webrtc.org/2930243003
Cr-Commit-Position: refs/heads/master@{#18645}
2017-06-18 01:23:03 +00:00
kwiberg
b8727aebc1 G722 implementation of the AudioEncoderFactoryTemplate API
Now the templated AudioEncoderFactory can create G722 encoders!

BUG=webrtc:7833

Review-Url: https://codereview.webrtc.org/2934833002
Cr-Commit-Position: refs/heads/master@{#18644}
2017-06-18 00:41:59 +00:00
kwiberg
b1ed7f09c0 G722 implementation of the AudioDecoderFactoryTemplate API
Now the templated AudioDecoderFactory can create G722 decoders!

BUG=webrtc:7839

Review-Url: https://codereview.webrtc.org/2940833002
Cr-Commit-Position: refs/heads/master@{#18643}
2017-06-18 00:30:09 +00:00
henrik.lundin
4eccdaa314 Fix a numerical issue in NetEq delay plotting
Imprecisions in floating point representation caused noise in the
graphs. The integer division is in fact exact.

BUG= webrtc:7467

Review-Url: https://codereview.webrtc.org/2933053002
Cr-Commit-Position: refs/heads/master@{#18592}
2017-06-14 14:02:17 +00:00
henrik.lundin
3c938fc5ea Add NetEq delay plotting to event_log_visualizer
This CL adds the capability to analyze and plot how NetEq behaves in
response to a network trace.

BUG=webrtc:7467

Review-Url: https://codereview.webrtc.org/2876423002
Cr-Commit-Position: refs/heads/master@{#18590}
2017-06-14 13:09:58 +00:00
Henrik Lundin
c417d9e558 NetEq: Removing LastError and LastDecoderError
LastDecoderError was only used in tests. LastError was only used in
conjunction with RemovePayloadType, and always to distinguish between
"decoder not found" and "other error". In AcmReceiver, "decoder not
found" was not treated as an error.

With this change, calling NetEq::RemovePayloadType with a payload type
that is not registered is no longer considered to be an error. This
allows to rewrite the code in AcmReceiver, such that it no longer has
to call LastError.

The internal member variables NetEqImpl::error_code_ and
NetEqImpl::decoder_error_code_ are removed, since they were no longer
read.

Bug: none
Change-Id: Ibfe97265954a2870c3caea4a34aac958351d7ff1
Reviewed-on: https://chromium-review.googlesource.com/535533
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18588}
2017-06-14 12:06:24 +00:00
yujo
36b1a5fcec Add mute state field to AudioFrame and switch some callers to use it. Also make AudioFrame::data_ private and instead provide:
const int16_t* data() const;
int16_t* mutable_data();

- data() returns a zeroed static buffer on muted frames (to avoid unnecessary zeroing of the member buffer) and directly returns AudioFrame::data_ on unmuted frames.
- mutable_data(), lazily zeroes AudioFrame::data_ if the frame is currently muted, sets muted=false, and returns AudioFrame::data_.

These accessors serve to "force" callers to be aware of the mute state field, i.e. lazy zeroing is not the primary motivation.

This change only optimizes handling of muted frames where it is somewhat trivial to do so. Other improvements requiring more significant structural changes will come later.

BUG=webrtc:7343
TBR=henrika

Review-Url: https://codereview.webrtc.org/2750783004
Cr-Commit-Position: refs/heads/master@{#18543}
2017-06-12 19:45:32 +00:00
henrik.lundin
7a2862a933 Fix a bug in RtcEventLogSource
A recent change (https://codereview.webrtc.org/2855143002/) introduced
a bug in RtcEventLogSource::NextPacket(). The rtp_packet_index_ must
be incremented when a valid packet is found and delivered. Otherwise,
the same packet will be delivered over and over again.

The recent change also altered the way that audio packets are sifted out. Now, the RTP header is always parsed before discarding any non-audio packets. This means that RtpHeaderParser::Parse is always called, also with video packets, which sometimes contain padding. When header-only dumps (such as RtcEventLogs) are created, the payload is stripped, and the payload length is equal to
the RTP header length. However, if the original packet was padded, the
RTP header will carry information about this padding length, and the
parser will check that the pyaload length is at least the header +
padding. This is not the case for header-only dumps, and the parser will return an error. In this CL, we ignore that error when a header-only packet has padding length larger than 0.

BUG=webrtc:7538

Review-Url: https://codereview.webrtc.org/2912323003
Cr-Commit-Position: refs/heads/master@{#18385}
2017-06-01 14:41:11 +00:00
perkj
77cd58e140 This cl removes RtcEventLog deps to call:call_interfaces. The purpose is to be able to use the event log from the upcoming RtpTransport.
Biggest change is to Remove MediaType as argument to RtcEventLog::LogRtpHeader and RtcEventLog::LogRtcpHeader.
Since the type is used by tools, these tools are rewritten to figure out the media type from the configurations instead.

BUG=webrtc:7538
TBR=solenberg@webrtc.org // For call.cc and voiceengine.cc

Review-Url: https://codereview.webrtc.org/2855143002
Cr-Commit-Position: refs/heads/master@{#18324}
2017-05-30 10:52:10 +00:00
ivoc
e3fc11464e Fixed NetEq overflow bug.
Negating an int can result in a value that cannot be represented as an int. This is fixed here by using a 64 bit variable.

BUG=chromium:663611

Review-Url: https://codereview.webrtc.org/2879863002
Cr-Commit-Position: refs/heads/master@{#18167}
2017-05-16 14:13:15 +00:00
henrik.lundin
b8c55b15a3 Handle padded audio packets correctly
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}
2017-05-10 14:38:01 +00:00
henrik.lundin
2979f55f95 NetEq: Fix a bug in expand_rate and speech_expand_rate calculation
After a Merge operation, the statistics for number of samples
generated using Expand must be corrected, and the correction can in
fact be negative. However, a bug was introduced in
https://codereview.webrtc.org/1230503003 which uses a size_t to
represent the correction, which leads to wrap-around of the negative
value. This is not a problem in itself, since this value is added to
another size_t, with the effect that the desired subtraction happens
anyway.

The actual problem arises if the statistics are polled/reset before a
subtraction happens -- that is, between an Expand and a Merge
operation. This will lead to an actual wrap-around of the stats value,
and large expand_rate (16384) is reported.

BUG=webrtc:7554

Review-Url: https://codereview.webrtc.org/2859483005
Cr-Commit-Position: refs/heads/master@{#18029}
2017-05-05 12:04:16 +00:00
henrik.lundin
02739d9149 NetEqTest: Extend the callback structure
This change allows more callbacks to be registered to the test object.
The callbacks are used to give the user of the test object the ability
to instrument the test object. This CL specifically adds
instrumentation points just after a packet is inserted into NetEq, and
just after audio is pulled out of NetEq.

BUG=webrtc:7467

Review-Url: https://codereview.webrtc.org/2851383004
Cr-Commit-Position: refs/heads/master@{#18014}
2017-05-04 13:09:06 +00:00
ossu
eb1fde4a26 Injectable audio encoders: Moved audio encoder, factory and builtin factory to api/.
Plumbed AudioEncoderFactory up into CreatePeerConnectionFactory.

BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2799033006
Cr-Commit-Position: refs/heads/master@{#17977}
2017-05-02 13:46:30 +00:00
henrik.lundin
7a38fd2628 Add NetEqInput::PacketData::ToString method
This new method prints information about the packet.

BUG=webrtc:7467

Review-Url: https://codereview.webrtc.org/2844283002
Cr-Commit-Position: refs/heads/master@{#17922}
2017-04-28 08:35:53 +00:00
henrik.lundin
b637a94b63 NetEq tests: BUILD target reorg
In this CL, the neteq_unittest_tools target is split in two separate
targets. One still called neteq_tools which does not set
testonly=true and that includes code related to audio input,
replacement audio and fake decoding. The other target called
neteq_test_tools contains the remaining files, and is
still under testonly=true.

Other renames:
neteq_test_tools -> neteq_test_tools_deprecated
neteq_test_minimal -> neteq_tools_minimal

Cyclic dependencies were also cleaned up.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_compile_rel_ng,linux_chromium_compile_dbg_ng
BUG=webrtc:7467,webrtc:6828

Review-Url: https://codereview.webrtc.org/2845013003
Cr-Commit-Position: refs/heads/master@{#17921}
2017-04-28 07:59:45 +00:00
henrik.lundin
a05d3c8efe NetEq: Add a VoidAudioSink tool
This is to be used in tests where the audio output is not interesting.

BUG=webrtc:7467

Review-Url: https://codereview.webrtc.org/2842033003
Cr-Commit-Position: refs/heads/master@{#17893}
2017-04-26 16:32:07 +00:00