| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |