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