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

Unified Diff: webrtc/voice_engine/channel.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/audio_level.cc ('k') | webrtc/voice_engine/file_player.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 0a9e9fce34b8a3a3217eef8dbc4bac09b17182b3..16122709c31fe976ddde3c63a477d78957f72070 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -660,7 +660,7 @@ MixerParticipant::AudioFrameInfo Channel::GetAudioFrameWithMuted(
rtc::CritScope cs(&_callbackCritSect);
if (audio_sink_) {
AudioSinkInterface::Data data(
- &audioFrame->data_[0], audioFrame->samples_per_channel_,
+ audioFrame->data(), audioFrame->samples_per_channel_,
audioFrame->sample_rate_hz_, audioFrame->num_channels_,
audioFrame->timestamp_);
audio_sink_->OnData(data);
@@ -2786,12 +2786,12 @@ void Channel::ProcessAndEncodeAudioOnTaskQueue(AudioFrame* audio_input) {
if (_includeAudioLevelIndication) {
size_t length =
audio_input->samples_per_channel_ * audio_input->num_channels_;
- RTC_CHECK_LE(length, sizeof(audio_input->data_));
+ RTC_CHECK_LE(length, AudioFrame::kMaxDataSizeBytes);
if (is_muted && previous_frame_muted_) {
rms_level_.AnalyzeMuted(length);
} else {
rms_level_.Analyze(
- rtc::ArrayView<const int16_t>(audio_input->data_, length));
+ rtc::ArrayView<const int16_t>(audio_input->data(), length));
}
}
previous_frame_muted_ = is_muted;
@@ -2951,8 +2951,8 @@ int32_t Channel::MixOrReplaceAudioWithFile(AudioFrame* audio_input) {
if (_mixFileWithMicrophone) {
// Currently file stream is always mono.
// TODO(xians): Change the code when FilePlayer supports real stereo.
- MixWithSat(audio_input->data_, audio_input->num_channels_, fileBuffer.get(),
- 1, fileSamples);
+ MixWithSat(audio_input->mutable_data(), audio_input->num_channels_,
+ fileBuffer.get(), 1, fileSamples);
} else {
// Replace ACM audio with file.
// Currently file stream is always mono.
@@ -2991,8 +2991,8 @@ int32_t Channel::MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency) {
if (audioFrame.samples_per_channel_ == fileSamples) {
// Currently file stream is always mono.
// TODO(xians): Change the code when FilePlayer supports real stereo.
- MixWithSat(audioFrame.data_, audioFrame.num_channels_, fileBuffer.get(), 1,
- fileSamples);
+ MixWithSat(audioFrame.mutable_data(), audioFrame.num_channels_,
+ fileBuffer.get(), 1, fileSamples);
} else {
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::MixAudioWithFile() samples_per_channel_(%" PRIuS
« no previous file with comments | « webrtc/voice_engine/audio_level.cc ('k') | webrtc/voice_engine/file_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698