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

Unified Diff: media/audio/win/wavein_input_win.cc

Issue 9702019: Adds Analog Gain Control (AGC) to the WebRTC client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/win/wavein_input_win.h ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/wavein_input_win.cc
diff --git a/media/audio/win/wavein_input_win.cc b/media/audio/win/wavein_input_win.cc
index f8a4e7ded95e184b53eda5b64dae63ff8ce979b7..f4055dbb6d83482b4ef099ab1ce41e5bec72d977 100644
--- a/media/audio/win/wavein_input_win.cc
+++ b/media/audio/win/wavein_input_win.cc
@@ -4,8 +4,6 @@
#include "media/audio/win/wavein_input_win.h"
-#include <windows.h>
-#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
#include "base/logging.h"
@@ -15,7 +13,7 @@
#include "media/audio/win/device_enumeration_win.h"
namespace {
-const int kStopInputStreamCallbackTimeout = 3000; // Three seconds.
+const int kStopInputStreamCallbackTimeout = 3000; // Three seconds.
}
using media::AudioDeviceNames;
@@ -201,6 +199,17 @@ double PCMWaveInAudioInputStream::GetVolume() {
return 0.0;
}
+void PCMWaveInAudioInputStream::SetAutomaticGainControl(bool enabled) {
+ // TODO(henrika): Add AGC support when volume control has been added.
+ NOTIMPLEMENTED();
+}
+
+bool PCMWaveInAudioInputStream::GetAutomaticGainControl() {
+ // TODO(henrika): Add AGC support when volume control has been added.
+ NOTIMPLEMENTED();
+ return false;
+}
+
void PCMWaveInAudioInputStream::HandleError(MMRESULT error) {
DLOG(WARNING) << "PCMWaveInAudio error " << error;
callback_->OnError(this, error);
@@ -260,10 +269,13 @@ void PCMWaveInAudioInputStream::WaveCallback(HWAVEIN hwi, UINT msg,
// to the callback and check if we need to stop playing.
// It should be OK to assume the data in the buffer is what has been
// recorded in the soundcard.
+ // TODO(henrika): the |volume| parameter is always set to zero since there
+ // is currently no support for controlling the microphone volume level.
WAVEHDR* buffer = reinterpret_cast<WAVEHDR*>(param1);
obj->callback_->OnData(obj, reinterpret_cast<const uint8*>(buffer->lpData),
buffer->dwBytesRecorded,
- buffer->dwBytesRecorded);
+ buffer->dwBytesRecorded,
+ 0.0);
if (obj->state_ == kStateStopping) {
// The main thread has called Stop() and is waiting to issue waveOutReset
« no previous file with comments | « media/audio/win/wavein_input_win.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698