Chromium Code Reviews| Index: media/audio/mac/audio_low_latency_input_mac.h |
| =================================================================== |
| --- media/audio/mac/audio_low_latency_input_mac.h (revision 106304) |
| +++ media/audio/mac/audio_low_latency_input_mac.h (working copy) |
| @@ -27,6 +27,11 @@ |
| // input device and then use the same rate when creating this object. |
| // Use AUAudioInputStream::HardwareSampleRate() to retrieve the sample rate. |
| // - Calling Close() also leads to self destruction. |
| +// - The latency consists of two parts: |
| +// 1, Hardware latency, which includes Audio Unit latency, audio device |
|
henrika (OOO until Aug 14)
2011/10/21 07:27:23
I would use 1) and 2)
no longer working on chromium
2011/10/21 12:21:46
Done.
|
| +// latency and audio stream latency; |
| +// 2, The delay between now and the scheduled time stamp that tells when the |
|
henrika (OOO until Aug 14)
2011/10/21 07:27:23
Please rewrite this comment from scratch since it
no longer working on chromium
2011/10/21 12:21:46
Done.
|
| +// data we are providing is going to reach the hardware. |
| // |
| #ifndef MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
| #define MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
| @@ -73,8 +78,16 @@ |
| AudioBufferList* io_data); |
| // Pushes recorded data to consumer of the input audio stream. |
| - OSStatus Provide(UInt32 number_of_frames, AudioBufferList* io_data); |
| + OSStatus Provide(UInt32 number_of_frames, AudioBufferList* io_data, |
| + const AudioTimeStamp* time_stamp); |
| + // Gets the fixed capture hardware latency and store it during initialization. |
| + // Returns 0 if not available. |
| + double GetHardwareLatency(); |
| + |
| + // Gets the current capture delay value. |
| + double GetCaptureLatency(const AudioTimeStamp* input_time_stamp); |
| + |
| // Issues the OnError() callback to the |sink_|. |
| void HandleError(OSStatus err); |
| @@ -96,6 +109,9 @@ |
| // The AUHAL also enables selection of non default devices. |
| AudioUnit audio_unit_; |
| + // The UID refers to the current input audio device. |
| + AudioDeviceID input_device_id_; |
| + |
| // Provides a mechanism for encapsulating one or more buffers of audio data. |
| AudioBufferList audio_buffer_list_; |
| @@ -106,6 +122,9 @@ |
| // True after successfull Start(), false after successful Stop(). |
| bool started_; |
| + // Fixed capture hardware latency in frames. |
| + double hardware_latency_frames_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); |
| }; |