Commit Graph

8 Commits

Author SHA1 Message Date
d313403564 rtc::Buffer: Let SetData and AppendData accept anything with .data() and .size()
In addition to setting or appending from another Buffer, which was
already possible, this allows for e.g. std::vector and rtc::ArrayView
arguments.

Review-Url: https://codereview.webrtc.org/2293983002
Cr-Commit-Position: refs/heads/master@{#14073}
2016-09-05 14:46:24 +00:00
bd4317263a Restrict the 1-argument ArrayView constructor to types with .size() and .data()
Before this change, the argument still needed those methods, but not
having them resulted in a compilation error. Now, it results in this
constructor being removed from the overload set.

This currently makes no difference, but I'm about to publish a CL that
breaks without this.

Review-Url: https://codereview.webrtc.org/2312473002
Cr-Commit-Position: refs/heads/master@{#14068}
2016-09-05 11:20:58 +00:00
ac554eebb9 Add functions to interact with ASan and MSan, and some sample uses
The sample uses are from when I debugged bug 617124. The change in neteq_network_stats_unittest.cc is a fix for a minor unrelated bug found by the try bots when I tried to land this CL (a test was passing uninitialized packet data to NetEq).

BUG=chromium:617124

Review-Url: https://codereview.webrtc.org/2293893002
Cr-Commit-Position: refs/heads/master@{#14034}
2016-09-02 07:39:40 +00:00
3f81fcd2e8 Don't recreate the speech encoder if we don't have to
If the specification for the speech encoder hasn't changed, we should
reuse it instead of recreating it. Otherwise, we lose its state. (This
problem was originally discovered because AudioEncoderOpus instances
would forget that they were supposed to be using DTX.)

BUG=webrtc:6020, chromium:622647

Review-Url: https://codereview.webrtc.org/2089183002
Cr-Commit-Position: refs/heads/master@{#13273}
2016-06-23 10:58:45 +00:00
c3ddb3e127 Improve documentation for ArrayView
Review URL: https://codereview.webrtc.org/1468183003

Cr-Commit-Position: refs/heads/master@{#10775}
2015-11-24 16:59:40 +00:00
74e35f1d62 Remove the special case for std::vector in rtc::ArrayView
We don't need it anymore now that we can use std::vector::data().

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

Cr-Commit-Position: refs/heads/master@{#10755}
2015-11-23 14:54:56 +00:00
288886b2ec Pass audio to AudioEncoder::Encode() in an ArrayView
Instead of in separate pointer and size arguments.

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

Cr-Commit-Position: refs/heads/master@{#10535}
2015-11-06 09:21:39 +00:00
e2a83eee73 Introduce rtc::ArrayView<T>, which keeps track of an array that it doesn't own
The main intended use case is as a function argument, replacing the
harder-to-read and harder-to-use separate pointer and size arguments.
It's easier to read because it's just one argument instead of two, and
with clearly defined semantics; it's easier to use because it has
iterators, and will automatically figure out the size of arrays.

BUG=webrtc:5028
R=andrew@webrtc.org, solenberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10415}
2015-10-26 18:51:42 +00:00