diff options
author | Eric Laurent <elaurent@google.com> | 2010-02-26 02:47:27 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2010-03-02 08:20:13 -0800 |
commit | 47d0a9264fa5297db6333697ad750e6bc06822aa (patch) | |
tree | 2b688202179ab906b44a413b8b27fd1a0ae9f75a /include | |
parent | 04218254ec1129e329cac71479b309cfb8a28d88 (diff) | |
download | frameworks_base-47d0a9264fa5297db6333697ad750e6bc06822aa.zip frameworks_base-47d0a9264fa5297db6333697ad750e6bc06822aa.tar.gz frameworks_base-47d0a9264fa5297db6333697ad750e6bc06822aa.tar.bz2 |
Issue 2071329: audio track is shorter than video track for video capture on sholes
Add API to retrieve number of frames dropped by audio input kernel driver.
Submitted on behalf of Masaki Sato <masaki.sato@motorola.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioRecord.h | 8 | ||||
-rw-r--r-- | include/media/AudioSystem.h | 1 | ||||
-rw-r--r-- | include/media/IAudioFlinger.h | 3 |
3 files changed, 12 insertions, 0 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 622c596..92bc126 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -294,6 +294,13 @@ public: */ ssize_t read(void* buffer, size_t size); + /* Return the amount of input frames lost in the audio driver since the last call of this function. + * Audio driver is expected to reset the value to 0 and restart counting upon returning the current value by this function call. + * Such loss typically occurs when the user space process is blocked longer than the capacity of audio driver buffers. + * Unit: the number of input audio frames + */ + unsigned int getInputFramesLost(); + private: /* copying audio tracks is not allowed */ AudioRecord(const AudioRecord& other); @@ -348,6 +355,7 @@ private: uint32_t mUpdatePeriod; uint32_t mFlags; uint32_t mChannels; + audio_io_handle_t mInput; }; }; // namespace android diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index 42bb4df..d0ccc50 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -233,6 +233,7 @@ public: // necessary to check returned status before using the returned values. static status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int stream = DEFAULT); + static unsigned int getInputFramesLost(audio_io_handle_t ioHandle); // // AudioPolicyService interface // diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h index bddd23e..c147632 100644 --- a/include/media/IAudioFlinger.h +++ b/include/media/IAudioFlinger.h @@ -130,7 +130,10 @@ public: virtual status_t setStreamOutput(uint32_t stream, int output) = 0; virtual status_t setVoiceVolume(float volume) = 0; + virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) = 0; + + virtual unsigned int getInputFramesLost(int ioHandle) = 0; }; |