Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: webrtc/voice_engine/utility.cc

Issue 2750783004: Add mute state field to AudioFrame. (Closed)
Patch Set: Update new usages of AudioFrame::data_ Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/voice_engine/transmit_mixer.cc ('k') | webrtc/voice_engine/utility_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/utility.cc
diff --git a/webrtc/voice_engine/utility.cc b/webrtc/voice_engine/utility.cc
index f394762c5294bc7fe4c7110cadea16271ab5c18e..f877c43b15ad15a9dcbb6131e3fa0cc0c880de7c 100644
--- a/webrtc/voice_engine/utility.cc
+++ b/webrtc/voice_engine/utility.cc
@@ -25,7 +25,7 @@ namespace voe {
void RemixAndResample(const AudioFrame& src_frame,
PushResampler<int16_t>* resampler,
AudioFrame* dst_frame) {
- RemixAndResample(src_frame.data_, src_frame.samples_per_channel_,
+ RemixAndResample(src_frame.data(), src_frame.samples_per_channel_,
src_frame.num_channels_, src_frame.sample_rate_hz_,
resampler, dst_frame);
dst_frame->timestamp_ = src_frame.timestamp_;
@@ -64,13 +64,18 @@ void RemixAndResample(const int16_t* src_data,
<< ", audio_ptr_num_channels = " << audio_ptr_num_channels;
}
+ // TODO(yujo): for muted input frames, don't resample. Either 1) allow
+ // resampler to return output length without doing the resample, so we know
+ // how much to zero here; or 2) make resampler accept a hint that the input is
+ // zeroed.
const size_t src_length = samples_per_channel * audio_ptr_num_channels;
- int out_length = resampler->Resample(audio_ptr, src_length, dst_frame->data_,
+ int out_length = resampler->Resample(audio_ptr, src_length,
+ dst_frame->mutable_data(),
AudioFrame::kMaxDataSizeSamples);
if (out_length == -1) {
FATAL() << "Resample failed: audio_ptr = " << audio_ptr
<< ", src_length = " << src_length
- << ", dst_frame->data_ = " << dst_frame->data_;
+ << ", dst_frame->mutable_data() = " << dst_frame->mutable_data();
}
dst_frame->samples_per_channel_ = out_length / audio_ptr_num_channels;
« no previous file with comments | « webrtc/voice_engine/transmit_mixer.cc ('k') | webrtc/voice_engine/utility_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698