OLD | NEW |
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 #ifndef MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ | 5 #ifndef MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ |
6 #define MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ | 6 #define MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ |
7 | 7 |
8 #include <AudioToolbox/AudioQueue.h> | 8 #include <AudioToolbox/AudioQueue.h> |
9 #include <AudioToolbox/AudioFormat.h> | 9 #include <AudioToolbox/AudioFormat.h> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 // Parameters as per AudioManager::MakeAudioInputStream. | 21 // Parameters as per AudioManager::MakeAudioInputStream. |
22 PCMQueueInAudioInputStream(AudioManagerMac* manager, | 22 PCMQueueInAudioInputStream(AudioManagerMac* manager, |
23 const AudioParameters& params); | 23 const AudioParameters& params); |
24 virtual ~PCMQueueInAudioInputStream(); | 24 virtual ~PCMQueueInAudioInputStream(); |
25 | 25 |
26 // Implementation of AudioInputStream. | 26 // Implementation of AudioInputStream. |
27 virtual bool Open() OVERRIDE; | 27 virtual bool Open() OVERRIDE; |
28 virtual void Start(AudioInputCallback* callback) OVERRIDE; | 28 virtual void Start(AudioInputCallback* callback) OVERRIDE; |
29 virtual void Stop() OVERRIDE; | 29 virtual void Stop() OVERRIDE; |
30 virtual void Close() OVERRIDE; | 30 virtual void Close() OVERRIDE; |
| 31 virtual void SetMicVolume(double volume) OVERRIDE; |
| 32 virtual void GetMicVolume(double* volume) OVERRIDE; |
| 33 virtual void GetMaxMicVolume(double* max_volume) OVERRIDE; |
31 | 34 |
32 private: | 35 private: |
33 // Issue the OnError to |callback_|; | 36 // Issue the OnError to |callback_|; |
34 void HandleError(OSStatus err); | 37 void HandleError(OSStatus err); |
35 | 38 |
36 // Allocates and prepares the memory that will be used for recording. | 39 // Allocates and prepares the memory that will be used for recording. |
37 bool SetupBuffers(); | 40 bool SetupBuffers(); |
38 | 41 |
39 // Sends a buffer to the audio driver for recording. | 42 // Sends a buffer to the audio driver for recording. |
40 OSStatus QueueNextBuffer(AudioQueueBufferRef audio_buffer); | 43 OSStatus QueueNextBuffer(AudioQueueBufferRef audio_buffer); |
(...skipping 26 matching lines...) Expand all Loading... |
67 AudioQueueRef audio_queue_; | 70 AudioQueueRef audio_queue_; |
68 // Size of each of the buffers in |audio_buffers_| | 71 // Size of each of the buffers in |audio_buffers_| |
69 uint32 buffer_size_bytes_; | 72 uint32 buffer_size_bytes_; |
70 // True iff Start() has been called successfully. | 73 // True iff Start() has been called successfully. |
71 bool started_; | 74 bool started_; |
72 | 75 |
73 DISALLOW_COPY_AND_ASSIGN(PCMQueueInAudioInputStream); | 76 DISALLOW_COPY_AND_ASSIGN(PCMQueueInAudioInputStream); |
74 }; | 77 }; |
75 | 78 |
76 #endif // MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ | 79 #endif // MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ |
OLD | NEW |