3 Commits

Author SHA1 Message Date
zstein
3c45186ef2 Move total audio energy and duration tracking to AudioLevel and protect with existing critial section.
BUG=webrtc:7982

Review-Url: https://codereview.webrtc.org/2984473002
Cr-Commit-Position: refs/heads/master@{#19105}
2017-07-20 16:57:42 +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
92a7a1810c Update formatting of AudioLevel class
These changes are all no-op, only affecting the appearance of the code. The file names are changed to match the class name.

BUG=none

Review-Url: https://codereview.webrtc.org/2731993002
Cr-Commit-Position: refs/heads/master@{#17087}
2017-03-07 09:58:55 +00:00