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

Side by Side Diff: chromecast/media/audio/cast_audio_output_stream_unittest.cc

Issue 1538563002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix. git cl format. Rebase. Created 5 years 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/synchronization/waitable_event.h" 6 #include "base/synchronization/waitable_event.h"
7 #include "chromecast/base/metrics/cast_metrics_test_helper.h" 7 #include "chromecast/base/metrics/cast_metrics_test_helper.h"
8 #include "chromecast/media/audio/cast_audio_manager.h" 8 #include "chromecast/media/audio/cast_audio_manager.h"
9 #include "chromecast/media/audio/cast_audio_output_stream.h" 9 #include "chromecast/media/audio/cast_audio_output_stream.h"
10 #include "chromecast/media/base/media_message_loop.h" 10 #include "chromecast/media/base/media_message_loop.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 class FakeAudioSourceCallback 159 class FakeAudioSourceCallback
160 : public ::media::AudioOutputStream::AudioSourceCallback { 160 : public ::media::AudioOutputStream::AudioSourceCallback {
161 public: 161 public:
162 FakeAudioSourceCallback() : error_(false) {} 162 FakeAudioSourceCallback() : error_(false) {}
163 163
164 bool error() const { return error_; } 164 bool error() const { return error_; }
165 165
166 // ::media::AudioOutputStream::AudioSourceCallback overrides. 166 // ::media::AudioOutputStream::AudioSourceCallback overrides.
167 int OnMoreData(::media::AudioBus* audio_bus, 167 int OnMoreData(::media::AudioBus* audio_bus,
168 uint32 total_bytes_delay) override { 168 uint32_t total_bytes_delay,
169 uint32_t frames_skipped) override {
169 audio_bus->Zero(); 170 audio_bus->Zero();
170 return audio_bus->frames(); 171 return audio_bus->frames();
171 } 172 }
172 void OnError(::media::AudioOutputStream* stream) override { error_ = true; } 173 void OnError(::media::AudioOutputStream* stream) override { error_ = true; }
173 174
174 private: 175 private:
175 bool error_; 176 bool error_;
176 }; 177 };
177 178
178 class FakeAudioManager : public CastAudioManager { 179 class FakeAudioManager : public CastAudioManager {
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { 641 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) {
641 ::media::AudioOutputStream* stream = CreateStream(); 642 ::media::AudioOutputStream* stream = CreateStream();
642 ASSERT_TRUE(stream); 643 ASSERT_TRUE(stream);
643 ASSERT_TRUE(OpenStream(stream)); 644 ASSERT_TRUE(OpenStream(stream));
644 CloseStream(stream); 645 CloseStream(stream);
645 } 646 }
646 647
647 } // namespace 648 } // namespace
648 } // namespace media 649 } // namespace media
649 } // namespace chromecast 650 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/audio/cast_audio_output_stream.cc ('k') | components/audio_modem/audio_player_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698