OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/audio/audio_output_proxy.h" | 5 #include "media/audio/audio_output_proxy.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "media/audio/audio_manager.h" | 9 #include "media/audio/audio_manager.h" |
10 #include "media/audio/audio_output_dispatcher.h" | 10 #include "media/audio/audio_output_dispatcher.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 | 67 |
68 if (dispatcher_) | 68 if (dispatcher_) |
69 dispatcher_->StreamVolumeSet(this, volume); | 69 dispatcher_->StreamVolumeSet(this, volume); |
70 } | 70 } |
71 | 71 |
72 void AudioOutputProxy::GetVolume(double* volume) { | 72 void AudioOutputProxy::GetVolume(double* volume) { |
73 DCHECK(CalledOnValidThread()); | 73 DCHECK(CalledOnValidThread()); |
74 *volume = volume_; | 74 *volume = volume_; |
75 } | 75 } |
76 | 76 |
77 void AudioOutputProxy::EnableDebugRecording(const base::FilePath& file_name) { | |
78 // Must only be called by AudoiManager directly on physical streams. | |
Max Morin
2017/01/20 07:49:09
Audio
Henrik Grunell
2017/01/20 10:38:56
Done.
| |
79 NOTREACHED(); | |
80 } | |
81 | |
82 void AudioOutputProxy::DisableDebugRecording() { | |
83 // Must only be called by AudioManager directly on physical streams. | |
84 NOTREACHED(); | |
85 } | |
86 | |
77 void AudioOutputProxy::Close() { | 87 void AudioOutputProxy::Close() { |
78 DCHECK(CalledOnValidThread()); | 88 DCHECK(CalledOnValidThread()); |
79 DCHECK(state_ == kCreated || state_ == kOpenError || state_ == kOpened || | 89 DCHECK(state_ == kCreated || state_ == kOpenError || state_ == kOpened || |
80 state_ == kStartError); | 90 state_ == kStartError); |
81 | 91 |
82 // kStartError means OpenStream() succeeded and the stream must be closed | 92 // kStartError means OpenStream() succeeded and the stream must be closed |
83 // before destruction. | 93 // before destruction. |
84 if (state_ != kCreated && state_ != kOpenError && dispatcher_) | 94 if (state_ != kCreated && state_ != kOpenError && dispatcher_) |
85 dispatcher_->CloseStream(this); | 95 dispatcher_->CloseStream(this); |
86 | 96 |
87 state_ = kClosed; | 97 state_ = kClosed; |
88 | 98 |
89 // Delete the object now like is done in the Close() implementation of | 99 // Delete the object now like is done in the Close() implementation of |
90 // physical stream objects. If we delete the object via DeleteSoon, we | 100 // physical stream objects. If we delete the object via DeleteSoon, we |
91 // unnecessarily complicate the Shutdown procedure of the | 101 // unnecessarily complicate the Shutdown procedure of the |
92 // dispatcher+audio manager. | 102 // dispatcher+audio manager. |
93 delete this; | 103 delete this; |
94 } | 104 } |
95 | 105 |
96 } // namespace media | 106 } // namespace media |
OLD | NEW |