OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/base/fake_audio_renderer_sink.h" | 5 #include "media/base/fake_audio_renderer_sink.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 output_device_info_(std::string(), | 25 output_device_info_(std::string(), |
26 OUTPUT_DEVICE_STATUS_OK, | 26 OUTPUT_DEVICE_STATUS_OK, |
27 hardware_params) {} | 27 hardware_params) {} |
28 | 28 |
29 FakeAudioRendererSink::~FakeAudioRendererSink() { | 29 FakeAudioRendererSink::~FakeAudioRendererSink() { |
30 DCHECK(!callback_); | 30 DCHECK(!callback_); |
31 } | 31 } |
32 | 32 |
33 void FakeAudioRendererSink::Initialize(const AudioParameters& params, | 33 void FakeAudioRendererSink::Initialize(const AudioParameters& params, |
34 RenderCallback* callback) { | 34 RenderCallback* callback) { |
35 DCHECK_EQ(state_, kUninitialized); | 35 DCHECK(state_ == kUninitialized || state_ == kStopped); |
36 DCHECK(!callback_); | 36 DCHECK(!callback_); |
37 DCHECK(callback); | 37 DCHECK(callback); |
38 | 38 |
39 callback_ = callback; | 39 callback_ = callback; |
40 ChangeState(kInitialized); | 40 ChangeState(kInitialized); |
41 } | 41 } |
42 | 42 |
43 void FakeAudioRendererSink::Start() { | 43 void FakeAudioRendererSink::Start() { |
44 DCHECK_EQ(state_, kInitialized); | 44 DCHECK_EQ(state_, kInitialized); |
45 ChangeState(kStarted); | 45 ChangeState(kStarted); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 "kPlaying", | 100 "kPlaying", |
101 "kStopped" | 101 "kStopped" |
102 }; | 102 }; |
103 | 103 |
104 DVLOG(1) << __func__ << " : " << kStateNames[state_] << " -> " | 104 DVLOG(1) << __func__ << " : " << kStateNames[state_] << " -> " |
105 << kStateNames[new_state]; | 105 << kStateNames[new_state]; |
106 state_ = new_state; | 106 state_ = new_state; |
107 } | 107 } |
108 | 108 |
109 } // namespace media | 109 } // namespace media |
OLD | NEW |