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

Side by Side Diff: webrtc/modules/audio_mixer/audio_mixer_impl_unittest.cc

Issue 2448113009: Add a NeededFrequency() method to the AudioMixer::Source interface. (Closed)
Patch Set: Changed name to PreferredSampleRate and made Ssrc const. Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/voice_engine/channel_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 MockMixerAudioSource() 54 MockMixerAudioSource()
55 : fake_audio_frame_info_(AudioMixer::Source::AudioFrameInfo::kNormal) { 55 : fake_audio_frame_info_(AudioMixer::Source::AudioFrameInfo::kNormal) {
56 ON_CALL(*this, GetAudioFrameWithInfo(_, _)) 56 ON_CALL(*this, GetAudioFrameWithInfo(_, _))
57 .WillByDefault( 57 .WillByDefault(
58 Invoke(this, &MockMixerAudioSource::FakeAudioFrameWithInfo)); 58 Invoke(this, &MockMixerAudioSource::FakeAudioFrameWithInfo));
59 } 59 }
60 60
61 MOCK_METHOD2(GetAudioFrameWithInfo, 61 MOCK_METHOD2(GetAudioFrameWithInfo,
62 AudioFrameInfo(int sample_rate_hz, AudioFrame* audio_frame)); 62 AudioFrameInfo(int sample_rate_hz, AudioFrame* audio_frame));
63 63
64 MOCK_METHOD0(Ssrc, int()); 64 MOCK_CONST_METHOD0(PreferredSampleRate, int());
65 MOCK_CONST_METHOD0(Ssrc, int());
65 66
66 AudioFrame* fake_frame() { return &fake_frame_; } 67 AudioFrame* fake_frame() { return &fake_frame_; }
67 AudioFrameInfo fake_info() { return fake_audio_frame_info_; } 68 AudioFrameInfo fake_info() { return fake_audio_frame_info_; }
68 void set_fake_info(const AudioFrameInfo audio_frame_info) { 69 void set_fake_info(const AudioFrameInfo audio_frame_info) {
69 fake_audio_frame_info_ = audio_frame_info; 70 fake_audio_frame_info_ = audio_frame_info;
70 } 71 }
71 72
72 private: 73 private:
73 AudioFrame fake_frame_; 74 AudioFrame fake_frame_;
74 AudioFrameInfo fake_audio_frame_info_; 75 AudioFrameInfo fake_audio_frame_info_;
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 kAudioSources, AudioMixer::Source::AudioFrameInfo::kNormal); 363 kAudioSources, AudioMixer::Source::AudioFrameInfo::kNormal);
363 frame_info[0] = AudioMixer::Source::AudioFrameInfo::kMuted; 364 frame_info[0] = AudioMixer::Source::AudioFrameInfo::kMuted;
364 std::fill(frames[0].data_, frames[0].data_ + kDefaultSampleRateHz / 100, 365 std::fill(frames[0].data_, frames[0].data_ + kDefaultSampleRateHz / 100,
365 std::numeric_limits<int16_t>::max()); 366 std::numeric_limits<int16_t>::max());
366 std::vector<bool> expected_status(kAudioSources, true); 367 std::vector<bool> expected_status(kAudioSources, true);
367 expected_status[0] = false; 368 expected_status[0] = false;
368 369
369 MixAndCompare(frames, frame_info, expected_status); 370 MixAndCompare(frames, frame_info, expected_status);
370 } 371 }
371 } // namespace webrtc 372 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/voice_engine/channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698