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

Side by Side Diff: media/audio/win/wavein_input_win.cc

Issue 9418042: Adding microphone volume support to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: please review Created 8 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/win/wavein_input_win.h" 5 #include "media/audio/win/wavein_input_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <mmsystem.h> 8 #include <mmsystem.h>
9 #pragma comment(lib, "winmm.lib") 9 #pragma comment(lib, "winmm.lib")
10 10
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 state_ = kStateClosed; 180 state_ = kStateClosed;
181 wavein_ = NULL; 181 wavein_ = NULL;
182 FreeBuffers(); 182 FreeBuffers();
183 } 183 }
184 // Tell the audio manager that we have been released. This can result in 184 // Tell the audio manager that we have been released. This can result in
185 // the manager destroying us in-place so this needs to be the last thing 185 // the manager destroying us in-place so this needs to be the last thing
186 // we do on this function. 186 // we do on this function.
187 manager_->ReleaseInputStream(this); 187 manager_->ReleaseInputStream(this);
188 } 188 }
189 189
190 void PCMWaveInAudioInputStream::SetMicVolume(double volume) {
191 // TODO(xians): Add volume support.
192 }
193
194 void PCMWaveInAudioInputStream::GetMicVolume(double* volume) {
195 }
henrika (OOO until Aug 14) 2012/02/21 14:03:47 Add TODO.
no longer working on chromium 2012/02/21 18:01:38 Done.
196
197 void PCMWaveInAudioInputStream::GetMaxMicVolume(double* max_volume) {
198 *max_volume = 0;
henrika (OOO until Aug 14) 2012/02/21 14:03:47 Add TODO.
no longer working on chromium 2012/02/21 18:01:38 Done.
199 }
200
190 void PCMWaveInAudioInputStream::HandleError(MMRESULT error) { 201 void PCMWaveInAudioInputStream::HandleError(MMRESULT error) {
191 DLOG(WARNING) << "PCMWaveInAudio error " << error; 202 DLOG(WARNING) << "PCMWaveInAudio error " << error;
192 callback_->OnError(this, error); 203 callback_->OnError(this, error);
193 } 204 }
194 205
195 void PCMWaveInAudioInputStream::QueueNextPacket(WAVEHDR *buffer) { 206 void PCMWaveInAudioInputStream::QueueNextPacket(WAVEHDR *buffer) {
196 MMRESULT res = ::waveInAddBuffer(wavein_, buffer, sizeof(WAVEHDR)); 207 MMRESULT res = ::waveInAddBuffer(wavein_, buffer, sizeof(WAVEHDR));
197 if (res != MMSYSERR_NOERROR) 208 if (res != MMSYSERR_NOERROR)
198 HandleError(res); 209 HandleError(res);
199 } 210 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // waveInPrepareHeader. 275 // waveInPrepareHeader.
265 obj->QueueNextPacket(buffer); 276 obj->QueueNextPacket(buffer);
266 } 277 }
267 } else if (msg == WIM_CLOSE) { 278 } else if (msg == WIM_CLOSE) {
268 // We can be closed before calling Start, so it is possible to have a 279 // We can be closed before calling Start, so it is possible to have a
269 // null callback at this point. 280 // null callback at this point.
270 if (obj->callback_) 281 if (obj->callback_)
271 obj->callback_->OnClose(obj); 282 obj->callback_->OnClose(obj);
272 } 283 }
273 } 284 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698