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/audio/cast_audio_output_stream.h" | 5 #include "chromecast/media/audio/cast_audio_output_stream.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chromecast/base/metrics/cast_metrics_test_helper.h" | 8 #include "chromecast/base/metrics/cast_metrics_test_helper.h" |
9 #include "chromecast/media/audio/cast_audio_manager.h" | 9 #include "chromecast/media/audio/cast_audio_manager.h" |
10 #include "chromecast/public/media/cast_decoder_buffer.h" | 10 #include "chromecast/public/media/cast_decoder_buffer.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 class FakeAudioSourceCallback | 147 class FakeAudioSourceCallback |
148 : public ::media::AudioOutputStream::AudioSourceCallback { | 148 : public ::media::AudioOutputStream::AudioSourceCallback { |
149 public: | 149 public: |
150 FakeAudioSourceCallback() : error_(false) {} | 150 FakeAudioSourceCallback() : error_(false) {} |
151 | 151 |
152 bool error() const { return error_; } | 152 bool error() const { return error_; } |
153 | 153 |
154 // ::media::AudioOutputStream::AudioSourceCallback overrides. | 154 // ::media::AudioOutputStream::AudioSourceCallback overrides. |
155 int OnMoreData(::media::AudioBus* audio_bus, | 155 int OnMoreData(::media::AudioBus* audio_bus, |
156 uint32_t total_bytes_delay, | 156 uint32_t total_bytes_delay, |
157 uint32_t frames_skipped) override { | 157 uint32_t frames_skipped, |
| 158 const ::media::AudioTimestamp& timestamp = {0,0}) override { |
158 audio_bus->Zero(); | 159 audio_bus->Zero(); |
159 return audio_bus->frames(); | 160 return audio_bus->frames(); |
160 } | 161 } |
161 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } | 162 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } |
162 | 163 |
163 private: | 164 private: |
164 bool error_; | 165 bool error_; |
165 }; | 166 }; |
166 | 167 |
167 class FakeAudioManager : public CastAudioManager { | 168 class FakeAudioManager : public CastAudioManager { |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { | 515 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { |
515 ::media::AudioOutputStream* stream = CreateStream(); | 516 ::media::AudioOutputStream* stream = CreateStream(); |
516 ASSERT_TRUE(stream); | 517 ASSERT_TRUE(stream); |
517 ASSERT_TRUE(stream->Open()); | 518 ASSERT_TRUE(stream->Open()); |
518 stream->Close(); | 519 stream->Close(); |
519 } | 520 } |
520 | 521 |
521 } // namespace | 522 } // namespace |
522 } // namespace media | 523 } // namespace media |
523 } // namespace chromecast | 524 } // namespace chromecast |
OLD | NEW |