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

Unified Diff: media/audio/mac/audio_low_latency_input_mac.h

Issue 8234009: Adding input and output delay estimation for mac. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
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,10 @@
// 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
henrika (OOO until Aug 14) 2011/10/12 12:10:11 Can be cleaned up. Thanks.
no longer working on chromium 2011/10/12 15:28:47 Done.
+// 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 hit the hardware.
//
#ifndef MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_
#define MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_
@@ -67,14 +71,22 @@
// AudioOutputUnit callback.
static OSStatus InputProc(void* user_data,
AudioUnitRenderActionFlags* flags,
- const AudioTimeStamp* time_stamp,
+ const AudioTimeStamp* output_time_stamp,
henrika (OOO until Aug 14) 2011/10/12 12:10:11 remove output
no longer working on chromium 2011/10/12 15:28:47 Done.
UInt32 bus_number,
UInt32 number_of_frames,
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 capture hardware latency, this is called only when initiating
henrika (OOO until Aug 14) 2011/10/12 12:10:11 "Gets the fixed capture hardware latency and store
no longer working on chromium 2011/10/12 15:28:47 Done.
+ // the input Audio Unit.
henrika (OOO until Aug 14) 2011/10/12 12:10:11 I would remove 'input' and call the method StoreHa
no longer working on chromium 2011/10/12 15:28:47 Done.
+ void UpdateHardwareLatency();
+
+ // Update capture delay value.
henrika (OOO until Aug 14) 2011/10/12 12:10:11 Updates the current capture delay value.
no longer working on chromium 2011/10/12 15:28:47 Done.
+ 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 input audio device.
henrika (OOO until Aug 14) 2011/10/12 12:10:11 Which device?
no longer working on chromium 2011/10/12 15:28:47 Done.
+ AudioDeviceID input_device_id_;
+
// Provides a mechanism for encapsulating one or more buffers of audio data.
AudioBufferList audio_buffer_list_;
@@ -106,6 +121,13 @@
// True after successfull Start(), false after successful Stop().
bool started_;
+ // Capture hardware latency in millisecond, the value is updated when
henrika (OOO until Aug 14) 2011/10/12 12:10:11 Remove last part (, the value). Add 'fixed'.
no longer working on chromium 2011/10/12 15:28:47 Done.
+ // initiating the input Audio Unit.
+ uint32 hardware_latency_ms_;
+
+ // Capture latency in millisecond.
henrika (OOO until Aug 14) 2011/10/12 12:10:11 Current ..
no longer working on chromium 2011/10/12 15:28:47 Done.
+ uint32 capture_latency_ms_;
+
DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream);
};
« no previous file with comments | « no previous file | media/audio/mac/audio_low_latency_input_mac.cc » ('j') | media/audio/mac/audio_low_latency_input_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698