OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
11 #include "media/audio/audio_io.h" | 11 #include "media/audio/audio_io.h" |
12 #include "media/audio/audio_parameters.h" | 12 #include "media/audio/audio_parameters.h" |
13 | 13 |
14 class AudioManagerMac; | 14 class AudioManagerMac; |
15 | 15 |
16 // Implementation of AudioInputStream for Mac OS X using the audio queue service | 16 // Implementation of AudioInputStream for Mac OS X using the audio queue service |
17 // present in OS 10.5 and later. Design reflects PCMQueueOutAudioOutputStream. | 17 // present in OS 10.5 and later. Design reflects PCMQueueOutAudioOutputStream. |
18 class PCMQueueInAudioInputStream : public AudioInputStream { | 18 class PCMQueueInAudioInputStream : public AudioInputStream { |
19 public: | 19 public: |
20 // Parameters as per AudioManager::MakeAudioInputStream. | 20 // Parameters as per AudioManager::MakeAudioInputStream. |
21 PCMQueueInAudioInputStream(AudioManagerMac* manager, | 21 PCMQueueInAudioInputStream(AudioManagerMac* manager, |
22 AudioParameters params, | 22 AudioParameters params); |
23 int samples_per_packet); | |
24 virtual ~PCMQueueInAudioInputStream(); | 23 virtual ~PCMQueueInAudioInputStream(); |
25 | 24 |
26 // Implementation of AudioInputStream. | 25 // Implementation of AudioInputStream. |
27 virtual bool Open(); | 26 virtual bool Open(); |
28 virtual void Start(AudioInputCallback* callback); | 27 virtual void Start(AudioInputCallback* callback); |
29 virtual void Stop(); | 28 virtual void Stop(); |
30 virtual void Close(); | 29 virtual void Close(); |
31 | 30 |
32 private: | 31 private: |
33 // Issue the OnError to |callback_|; | 32 // Issue the OnError to |callback_|; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 AudioStreamBasicDescription format_; | 64 AudioStreamBasicDescription format_; |
66 // Handle to the OS audio queue object. | 65 // Handle to the OS audio queue object. |
67 AudioQueueRef audio_queue_; | 66 AudioQueueRef audio_queue_; |
68 // Size of each of the buffers in |audio_buffers_| | 67 // Size of each of the buffers in |audio_buffers_| |
69 uint32 buffer_size_bytes_; | 68 uint32 buffer_size_bytes_; |
70 | 69 |
71 DISALLOW_COPY_AND_ASSIGN(PCMQueueInAudioInputStream); | 70 DISALLOW_COPY_AND_ASSIGN(PCMQueueInAudioInputStream); |
72 }; | 71 }; |
73 | 72 |
74 #endif // MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ | 73 #endif // MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ |
OLD | NEW |