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

Side by Side Diff: media/audio/mac/audio_input_mac.cc

Issue 9418042: Adding microphone volume support to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added a comment about the number of channel, and fix a compiling issue on mac 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 unified diff | Download patch | Annotate | Revision Log
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 #include "media/audio/mac/audio_input_mac.h" 5 #include "media/audio/mac/audio_input_mac.h"
6 6
7 #include <CoreServices/CoreServices.h> 7 #include <CoreServices/CoreServices.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 HandleError(err); 106 HandleError(err);
107 } 107 }
108 if (callback_) { 108 if (callback_) {
109 callback_->OnClose(this); 109 callback_->OnClose(this);
110 callback_ = NULL; 110 callback_ = NULL;
111 } 111 }
112 manager_->ReleaseInputStream(this); 112 manager_->ReleaseInputStream(this);
113 // CARE: This object may now be destroyed. 113 // CARE: This object may now be destroyed.
114 } 114 }
115 115
116 double PCMQueueInAudioInputStream::GetMaxVolume() {
117 NOTREACHED() << "Only supported for low-latency mode.";
118 return 0.0;
119 }
120
121 void PCMQueueInAudioInputStream::SetVolume(double volume) {
122 NOTREACHED() << "Only supported for low-latency mode.";
123 }
124
125 double PCMQueueInAudioInputStream::GetVolume() {
126 NOTREACHED() << "Only supported for low-latency mode.";
127 return 0.0;
128 }
129
116 void PCMQueueInAudioInputStream::HandleError(OSStatus err) { 130 void PCMQueueInAudioInputStream::HandleError(OSStatus err) {
117 if (callback_) 131 if (callback_)
118 callback_->OnError(this, static_cast<int>(err)); 132 callback_->OnError(this, static_cast<int>(err));
119 NOTREACHED() << "error " << GetMacOSStatusErrorString(err) 133 NOTREACHED() << "error " << GetMacOSStatusErrorString(err)
120 << " (" << err << ")"; 134 << " (" << err << ")";
121 } 135 }
122 136
123 bool PCMQueueInAudioInputStream::SetupBuffers() { 137 bool PCMQueueInAudioInputStream::SetupBuffers() {
124 DCHECK(buffer_size_bytes_); 138 DCHECK(buffer_size_bytes_);
125 for (int i = 0; i < kNumberBuffers; ++i) { 139 for (int i = 0; i < kNumberBuffers; ++i) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // TODO(joth): PCMQueueOutAudioOutputStream uses callback_ to provide an 200 // TODO(joth): PCMQueueOutAudioOutputStream uses callback_ to provide an
187 // extra guard for this situation, but it seems to introduce more 201 // extra guard for this situation, but it seems to introduce more
188 // complications than it solves (memory barrier issues accessing it from 202 // complications than it solves (memory barrier issues accessing it from
189 // multiple threads, looses the means to indicate OnClosed to client). 203 // multiple threads, looses the means to indicate OnClosed to client).
190 // Should determine if we need to do something equivalent here. 204 // Should determine if we need to do something equivalent here.
191 return; 205 return;
192 } 206 }
193 HandleError(err); 207 HandleError(err);
194 } 208 }
195 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698