summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2010-01-19 17:37:09 -0800
committerEric Laurent <elaurent@google.com>2010-01-26 18:40:39 -0800
commit342e9cf388cceb807def720e40e8b0a217f4bcaa (patch)
tree2d443e1de1a10b628016a5ceffb4b5a1cb031dd7 /include
parent2dce41ad26cb3e9e15c9e456a84bcf5309548ca0 (diff)
downloadframeworks_av-342e9cf388cceb807def720e40e8b0a217f4bcaa.zip
frameworks_av-342e9cf388cceb807def720e40e8b0a217f4bcaa.tar.gz
frameworks_av-342e9cf388cceb807def720e40e8b0a217f4bcaa.tar.bz2
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.
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioSystem.h11
-rw-r--r--include/media/IAudioFlinger.h1
-rw-r--r--include/media/MediaPlayerInterface.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index b42bf54..42bb4df 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -222,6 +222,17 @@ public:
static status_t setVoiceVolume(float volume);
+ // return the number of audio frames written by AudioFlinger to audio HAL and
+ // audio dsp to DAC since the output on which the specificed stream is playing
+ // has exited standby.
+ // returned status (from utils/Errors.h) can be:
+ // - NO_ERROR: successful operation, halFrames and dspFrames point to valid data
+ // - INVALID_OPERATION: Not supported on current hardware platform
+ // - BAD_VALUE: invalid parameter
+ // NOTE: this feature is not supported on all hardware platforms and it is
+ // necessary to check returned status before using the returned values.
+ static status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int stream = DEFAULT);
+
//
// AudioPolicyService interface
//
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index b689dcb..bddd23e 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -130,6 +130,7 @@ 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;
};
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 6575da6..588c51a 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -72,6 +72,7 @@ public:
virtual ssize_t frameSize() const = 0;
virtual uint32_t latency() const = 0;
virtual float msecsPerFrame() const = 0;
+ virtual status_t getPosition(uint32_t *position) = 0;
// If no callback is specified, use the "write" API below to submit
// audio data. Otherwise return a full buffer of audio data on each