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 // Audio rendering unit utilizing audio output stream provided by browser | 5 // Audio rendering unit utilizing audio output stream provided by browser |
6 // process through IPC. | 6 // process through IPC. |
7 // | 7 // |
8 // Relationship of classes. | 8 // Relationship of classes. |
9 // | 9 // |
10 // AudioOutputController AudioOutputDevice | 10 // AudioOutputController AudioOutputDevice |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 class MEDIA_EXPORT AudioOutputDevice | 74 class MEDIA_EXPORT AudioOutputDevice |
75 : NON_EXPORTED_BASE(public AudioRendererSink), | 75 : NON_EXPORTED_BASE(public AudioRendererSink), |
76 NON_EXPORTED_BASE(public AudioOutputIPCDelegate), | 76 NON_EXPORTED_BASE(public AudioOutputIPCDelegate), |
77 NON_EXPORTED_BASE(public ScopedTaskRunnerObserver) { | 77 NON_EXPORTED_BASE(public ScopedTaskRunnerObserver) { |
78 public: | 78 public: |
79 // NOTE: Clients must call Initialize() before using. | 79 // NOTE: Clients must call Initialize() before using. |
80 AudioOutputDevice( | 80 AudioOutputDevice( |
81 scoped_ptr<AudioOutputIPC> ipc, | 81 scoped_ptr<AudioOutputIPC> ipc, |
82 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); | 82 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); |
83 | 83 |
84 // Initialize the stream using |session_id|, which is used for the browser | 84 // Initialize function for clients wishing to have unified input and |
85 // to select the correct input device. | 85 // output, |params| may specify |input_channels| > 0, representing a |
| 86 // number of input channels which will be at the same sample-rate |
| 87 // and buffer-size as the output as specified in |params|. |session_id| is |
| 88 // used for the browser to select the correct input device. |
86 void InitializeWithSessionId(const AudioParameters& params, | 89 void InitializeWithSessionId(const AudioParameters& params, |
87 RenderCallback* callback, | 90 RenderCallback* callback, |
88 int session_id); | 91 int session_id); |
89 | 92 |
90 // AudioRendererSink implementation. | 93 // AudioRendererSink implementation. |
91 virtual void Initialize(const AudioParameters& params, | 94 virtual void Initialize(const AudioParameters& params, |
92 RenderCallback* callback) OVERRIDE; | 95 RenderCallback* callback) OVERRIDE; |
93 virtual void Start() OVERRIDE; | 96 virtual void Start() OVERRIDE; |
94 virtual void Stop() OVERRIDE; | 97 virtual void Stop() OVERRIDE; |
95 virtual void Play() OVERRIDE; | 98 virtual void Play() OVERRIDE; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept | 173 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept |
171 // the callback via Start(). See http://crbug.com/151051 for details. | 174 // the callback via Start(). See http://crbug.com/151051 for details. |
172 bool stopping_hack_; | 175 bool stopping_hack_; |
173 | 176 |
174 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice); | 177 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice); |
175 }; | 178 }; |
176 | 179 |
177 } // namespace media | 180 } // namespace media |
178 | 181 |
179 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_ | 182 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_ |
OLD | NEW |