Chromium Code Reviews| Index: media/audio/mac/audio_low_latency_input_mac.h |
| =================================================================== |
| --- media/audio/mac/audio_low_latency_input_mac.h (revision 104447) |
| +++ 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 |
| +// latency and audio stream latency; |
| +// 2, The delay between now and the scheduled time stamp that tells when the |
| +// 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,15 @@ |
| 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); |
| + // Get the fixed capture hardware latency and store it during initialization. |
| + void StoreHardwareLatency(); |
| + |
| + // Updates the current capture delay value. |
| + void UpdateCaptureLatency(const AudioTimeStamp* input_time_stamp); |
| + |
| // Issues the OnError() callback to the |sink_|. |
| void HandleError(OSStatus err); |
| @@ -96,6 +108,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 +121,12 @@ |
| // True after successfull Start(), false after successful Stop(). |
| bool started_; |
| + // Fixed capture hardware latency in frames. |
| + double hardware_latency_frames_; |
|
scherkus (not reviewing)
2011/10/19 16:35:15
frames are typically integers -- any reason why we
|
| + |
| + // Current capture latency in frames. |
| + double capture_latency_frames_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); |
| }; |