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

Side by Side Diff: chromecast/media/cma/backend/alsa/stream_mixer_alsa_unittest.cc

Issue 2341783004: [chromecast] Slew stream volume changes in StreamMixerAlsa. (Closed)
Patch Set: address comments Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/media/cma/backend/alsa/stream_mixer_alsa.h" 5 #include "chromecast/media/cma/backend/alsa/stream_mixer_alsa.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <utility> 10 #include <utility>
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 testing::Invoke(this, &MockInputQueue::DoGetResampledData)); 136 testing::Invoke(this, &MockInputQueue::DoGetResampledData));
137 ON_CALL(*this, PrepareToDelete(_)).WillByDefault( 137 ON_CALL(*this, PrepareToDelete(_)).WillByDefault(
138 testing::Invoke(this, &MockInputQueue::DoPrepareToDelete)); 138 testing::Invoke(this, &MockInputQueue::DoPrepareToDelete));
139 } 139 }
140 ~MockInputQueue() override {} 140 ~MockInputQueue() override {}
141 141
142 bool paused() const { return paused_; } 142 bool paused() const { return paused_; }
143 143
144 // StreamMixerAlsa::InputQueue implementation: 144 // StreamMixerAlsa::InputQueue implementation:
145 int input_samples_per_second() const override { return samples_per_second_; } 145 int input_samples_per_second() const override { return samples_per_second_; }
146 float volume_multiplier() const override { return multiplier_; }
147 bool primary() const override { return primary_; } 146 bool primary() const override { return primary_; }
148 bool IsDeleting() const override { return deleting_; } 147 bool IsDeleting() const override { return deleting_; }
149 MOCK_METHOD1(Initialize, 148 MOCK_METHOD1(Initialize,
150 void(const MediaPipelineBackendAlsa::RenderingDelay& 149 void(const MediaPipelineBackendAlsa::RenderingDelay&
151 mixer_rendering_delay)); 150 mixer_rendering_delay));
152 int MaxReadSize() override { return max_read_size_; } 151 int MaxReadSize() override { return max_read_size_; }
153 MOCK_METHOD2(GetResampledData, void(::media::AudioBus* dest, int frames)); 152 MOCK_METHOD2(GetResampledData, void(::media::AudioBus* dest, int frames));
154 MOCK_METHOD1(AfterWriteFrames, 153 MOCK_METHOD1(AfterWriteFrames,
155 void(const MediaPipelineBackendAlsa::RenderingDelay& 154 void(const MediaPipelineBackendAlsa::RenderingDelay&
156 mixer_rendering_delay)); 155 mixer_rendering_delay));
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 EXPECT_CALL(*inputs[0], AfterWriteFrames(_)); 688 EXPECT_CALL(*inputs[0], AfterWriteFrames(_));
690 EXPECT_CALL(*inputs[1], GetResampledData(_, _)).Times(0); 689 EXPECT_CALL(*inputs[1], GetResampledData(_, _)).Times(0);
691 EXPECT_CALL(*inputs[1], AfterWriteFrames(_)); 690 EXPECT_CALL(*inputs[1], AfterWriteFrames(_));
692 691
693 EXPECT_CALL(*mock_alsa(), PcmWritei(_, _, kNumFrames)).Times(1); 692 EXPECT_CALL(*mock_alsa(), PcmWritei(_, _, kNumFrames)).Times(1);
694 mixer->WriteFramesForTest(); 693 mixer->WriteFramesForTest();
695 } 694 }
696 695
697 } // namespace media 696 } // namespace media
698 } // namespace chromecast 697 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698