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

Unified Diff: webrtc/modules/audio_mixer/frame_combiner_unittest.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/modules/audio_mixer/frame_combiner.cc ('k') | webrtc/modules/audio_mixer/sine_wave_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_mixer/frame_combiner_unittest.cc
diff --git a/webrtc/modules/audio_mixer/frame_combiner_unittest.cc b/webrtc/modules/audio_mixer/frame_combiner_unittest.cc
index 8d745f651def9679e6c161cc053bd90df4f56af6..250c6e1954a1567c1a40b91290bc99664827f425 100644
--- a/webrtc/modules/audio_mixer/frame_combiner_unittest.cc
+++ b/webrtc/modules/audio_mixer/frame_combiner_unittest.cc
@@ -112,9 +112,11 @@ TEST(FrameCombiner, CombiningZeroFramesShouldProduceSilence) {
combiner.Combine(frames_to_combine, number_of_channels, rate,
frames_to_combine.size(), &audio_frame_for_mixing);
+ const int16_t* audio_frame_for_mixing_data =
+ audio_frame_for_mixing.data();
const std::vector<int16_t> mixed_data(
- audio_frame_for_mixing.data_,
- audio_frame_for_mixing.data_ + number_of_channels * rate / 100);
+ audio_frame_for_mixing_data,
+ audio_frame_for_mixing_data + number_of_channels * rate / 100);
const std::vector<int16_t> expected(number_of_channels * rate / 100, 0);
EXPECT_EQ(mixed_data, expected);
@@ -129,15 +131,17 @@ TEST(FrameCombiner, CombiningOneFrameShouldNotChangeFrame) {
SCOPED_TRACE(ProduceDebugText(rate, number_of_channels, 1));
SetUpFrames(rate, number_of_channels);
- std::iota(frame1.data_, frame1.data_ + number_of_channels * rate / 100,
- 0);
+ int16_t* frame1_data = frame1.mutable_data();
+ std::iota(frame1_data, frame1_data + number_of_channels * rate / 100, 0);
const std::vector<AudioFrame*> frames_to_combine = {&frame1};
combiner.Combine(frames_to_combine, number_of_channels, rate,
frames_to_combine.size(), &audio_frame_for_mixing);
+ const int16_t* audio_frame_for_mixing_data =
+ audio_frame_for_mixing.data();
const std::vector<int16_t> mixed_data(
- audio_frame_for_mixing.data_,
- audio_frame_for_mixing.data_ + number_of_channels * rate / 100);
+ audio_frame_for_mixing_data,
+ audio_frame_for_mixing_data + number_of_channels * rate / 100);
std::vector<int16_t> expected(number_of_channels * rate / 100);
std::iota(expected.begin(), expected.end(), 0);
@@ -190,8 +194,8 @@ TEST(FrameCombiner, GainCurveIsSmoothForAlternatingNumberOfStreams) {
combiner.Combine(frames_to_combine, number_of_channels, rate,
number_of_streams, &audio_frame_for_mixing);
cumulative_change += change_calculator.CalculateGainChange(
- rtc::ArrayView<const int16_t>(frame1.data_, number_of_samples),
- rtc::ArrayView<const int16_t>(audio_frame_for_mixing.data_,
+ rtc::ArrayView<const int16_t>(frame1.data(), number_of_samples),
+ rtc::ArrayView<const int16_t>(audio_frame_for_mixing.data(),
number_of_samples));
}
RTC_DCHECK_LT(cumulative_change, 10);
« no previous file with comments | « webrtc/modules/audio_mixer/frame_combiner.cc ('k') | webrtc/modules/audio_mixer/sine_wave_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698