From 0986e7907ffc8387b04fb201e285784bcd11b9b7 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Tue, 19 Jan 2010 17:37:09 -0800 Subject: Fix issue 2285561: New AudioFlinger and audio driver API needed for A/V sync Added getRenderPosition() API to IAudioFlinger to retreive number of audio frames written by AudioFlinger to audio HAL and by DSP to DAC. Added getRenderPosition() API to AudioHardwareInterface to retreive number of audio frames written by DSP to DAC. Exposed AudioTrack::getPosition() to AudioSink() to make it available to media player. Removed excessive log in AudioHardwareGeneric. --- libs/audioflinger/AudioHardwareGeneric.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libs/audioflinger/AudioHardwareGeneric.cpp') diff --git a/libs/audioflinger/AudioHardwareGeneric.cpp b/libs/audioflinger/AudioHardwareGeneric.cpp index 57874f3ce1ab..d63c0318d4a8 100644 --- a/libs/audioflinger/AudioHardwareGeneric.cpp +++ b/libs/audioflinger/AudioHardwareGeneric.cpp @@ -298,6 +298,11 @@ String8 AudioStreamOutGeneric::getParameters(const String8& keys) return param.toString(); } +status_t AudioStreamOutGeneric::getRenderPosition(uint32_t *dspFrames) +{ + return INVALID_OPERATION; +} + // ---------------------------------------------------------------------------- // record functions @@ -310,9 +315,8 @@ status_t AudioStreamInGeneric::set( uint32_t *pRate, AudioSystem::audio_in_acoustics acoustics) { - // FIXME: remove logging if (pFormat == 0 || pChannels == 0 || pRate == 0) return BAD_VALUE; - LOGD("AudioStreamInGeneric::set(%p, %d, %d, %d, %u)", hw, fd, *pFormat, *pChannels, *pRate); + LOGV("AudioStreamInGeneric::set(%p, %d, %d, %d, %u)", hw, fd, *pFormat, *pChannels, *pRate); // check values if ((*pFormat != format()) || (*pChannels != channels()) || @@ -332,14 +336,10 @@ status_t AudioStreamInGeneric::set( AudioStreamInGeneric::~AudioStreamInGeneric() { - // FIXME: remove logging - LOGD("AudioStreamInGeneric destructor"); } ssize_t AudioStreamInGeneric::read(void* buffer, ssize_t bytes) { - // FIXME: remove logging - LOGD("AudioStreamInGeneric::read(%p, %d) from fd %d", buffer, (int)bytes, mFd); AutoMutex lock(mLock); if (mFd < 0) { LOGE("Attempt to read from unopened device"); -- cgit v1.2.3-59-g8ed1b