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

Side by Side Diff: media/audio/audio_output_device.h

Issue 11878032: Plumb |input_channels| all the way to AudioManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/audio_output_device.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 namespace media { 73 namespace media {
74 74
75 class MEDIA_EXPORT AudioOutputDevice 75 class MEDIA_EXPORT AudioOutputDevice
76 : NON_EXPORTED_BASE(public AudioRendererSink), 76 : NON_EXPORTED_BASE(public AudioRendererSink),
77 public AudioOutputIPCDelegate, 77 public AudioOutputIPCDelegate,
78 NON_EXPORTED_BASE(public ScopedLoopObserver) { 78 NON_EXPORTED_BASE(public ScopedLoopObserver) {
79 public: 79 public:
80 // AudioRendererSink implementation. 80 // AudioRendererSink implementation.
81 virtual void Initialize(const AudioParameters& params, 81 virtual void Initialize(const AudioParameters& params,
82 RenderCallback* callback) OVERRIDE; 82 RenderCallback* callback) OVERRIDE;
83 virtual void InitializeIO(const AudioParameters& params,
84 int input_channels,
85 RenderCallback* callback) OVERRIDE;
86 virtual void Start() OVERRIDE; 83 virtual void Start() OVERRIDE;
87 virtual void Stop() OVERRIDE; 84 virtual void Stop() OVERRIDE;
88 virtual void Play() OVERRIDE; 85 virtual void Play() OVERRIDE;
89 virtual void Pause(bool flush) OVERRIDE; 86 virtual void Pause(bool flush) OVERRIDE;
90 virtual bool SetVolume(double volume) OVERRIDE; 87 virtual bool SetVolume(double volume) OVERRIDE;
91 88
92 // Methods called on IO thread ---------------------------------------------- 89 // Methods called on IO thread ----------------------------------------------
93 // AudioOutputIPCDelegate methods. 90 // AudioOutputIPCDelegate methods.
94 virtual void OnStateChanged(AudioOutputIPCDelegate::State state) OVERRIDE; 91 virtual void OnStateChanged(AudioOutputIPCDelegate::State state) OVERRIDE;
95 virtual void OnStreamCreated(base::SharedMemoryHandle handle, 92 virtual void OnStreamCreated(base::SharedMemoryHandle handle,
(...skipping 23 matching lines...) Expand all
119 IDLE, // Not started. 116 IDLE, // Not started.
120 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back. 117 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back.
121 PAUSED, // Paused. OnStreamCreated() has been called. Can Play()/Stop(). 118 PAUSED, // Paused. OnStreamCreated() has been called. Can Play()/Stop().
122 PLAYING, // Playing back. Can Pause()/Stop(). 119 PLAYING, // Playing back. Can Pause()/Stop().
123 }; 120 };
124 121
125 // Methods called on IO thread ---------------------------------------------- 122 // Methods called on IO thread ----------------------------------------------
126 // The following methods are tasks posted on the IO thread that needs to 123 // The following methods are tasks posted on the IO thread that needs to
127 // be executed on that thread. They interact with AudioMessageFilter and 124 // be executed on that thread. They interact with AudioMessageFilter and
128 // sends IPC messages on that thread. 125 // sends IPC messages on that thread.
129 void CreateStreamOnIOThread(const AudioParameters& params, 126 void CreateStreamOnIOThread(const AudioParameters& params);
130 int input_channels);
131 void PlayOnIOThread(); 127 void PlayOnIOThread();
132 void PauseOnIOThread(bool flush); 128 void PauseOnIOThread(bool flush);
133 void ShutDownOnIOThread(); 129 void ShutDownOnIOThread();
134 void SetVolumeOnIOThread(double volume); 130 void SetVolumeOnIOThread(double volume);
135 131
136 // MessageLoop::DestructionObserver implementation for the IO loop. 132 // MessageLoop::DestructionObserver implementation for the IO loop.
137 // If the IO loop dies before we do, we shut down the audio thread from here. 133 // If the IO loop dies before we do, we shut down the audio thread from here.
138 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; 134 virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
139 135
140 AudioParameters audio_parameters_; 136 AudioParameters audio_parameters_;
141 137
142 // The number of optional synchronized input channels having the same
143 // sample-rate and buffer-size as specified in audio_parameters_.
144 int input_channels_;
145
146 RenderCallback* callback_; 138 RenderCallback* callback_;
147 139
148 // A pointer to the IPC layer that takes care of sending requests over to 140 // A pointer to the IPC layer that takes care of sending requests over to
149 // the AudioRendererHost. 141 // the AudioRendererHost.
150 AudioOutputIPC* ipc_; 142 AudioOutputIPC* ipc_;
151 143
152 // Our stream ID on the message filter. Only accessed on the IO thread. 144 // Our stream ID on the message filter. Only accessed on the IO thread.
153 // Must only be modified on the IO thread. 145 // Must only be modified on the IO thread.
154 int stream_id_; 146 int stream_id_;
155 147
(...skipping 20 matching lines...) Expand all
176 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept 168 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept
177 // the callback via Start(). See http://crbug.com/151051 for details. 169 // the callback via Start(). See http://crbug.com/151051 for details.
178 bool stopping_hack_; 170 bool stopping_hack_;
179 171
180 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice); 172 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice);
181 }; 173 };
182 174
183 } // namespace media 175 } // namespace media
184 176
185 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_ 177 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_
OLDNEW
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/audio_output_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698