diff options
author | John Grossman <johngro@google.com> | 2012-02-08 16:37:41 -0800 |
---|---|---|
committer | John Grossman <johngro@google.com> | 2012-02-16 13:45:11 -0800 |
commit | 4ff14bae91075eb274eb1c2975982358946e7e63 (patch) | |
tree | e9e54fddb9832d30b69c2a11c9ed2884397f2f95 /services/audioflinger/AudioMixer.h | |
parent | 951bd8d1ad9581a414e171ad8605a9515d0ad667 (diff) | |
download | frameworks_av-4ff14bae91075eb274eb1c2975982358946e7e63.zip frameworks_av-4ff14bae91075eb274eb1c2975982358946e7e63.tar.gz frameworks_av-4ff14bae91075eb274eb1c2975982358946e7e63.tar.bz2 |
Upintegrate Audio Flinger changes from ICS_AAH
Bring in changes to audio flinger made to support timed audio tracks
and HW master volume control.
Change-Id: Ide52d48809bdbed13acf35fd59b24637e35064ae
Signed-off-by: John Grossman <johngro@google.com>
Diffstat (limited to 'services/audioflinger/AudioMixer.h')
-rw-r--r-- | services/audioflinger/AudioMixer.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h index c956918..f442671 100644 --- a/services/audioflinger/AudioMixer.h +++ b/services/audioflinger/AudioMixer.h @@ -79,7 +79,7 @@ public: void setParameter(int name, int target, int param, void *value); void setBufferProvider(int name, AudioBufferProvider* bufferProvider); - void process(); + void process(int64_t pts); uint32_t trackNames() const { return mTrackNames; } @@ -114,7 +114,7 @@ private: struct state_t; struct track_t; - typedef void (*mix_t)(state_t* state); + typedef void (*mix_t)(state_t* state, int64_t pts); typedef void (*hook_t)(track_t* t, int32_t* output, size_t numOutFrames, int32_t* temp, int32_t* aux); static const int BLOCKSIZE = 16; // 4 cache lines @@ -152,6 +152,8 @@ private: int32_t* mainBuffer; int32_t* auxBuffer; + uint64_t localTimeFreq; + bool setResampler(uint32_t sampleRate, uint32_t devSampleRate); bool doesResample() const { return resampler != NULL; } void resetResampler() { if (resampler != NULL) resampler->reset(); } @@ -187,14 +189,19 @@ private: static void volumeRampStereo(track_t* t, int32_t* out, size_t frameCount, int32_t* temp, int32_t* aux); static void volumeStereo(track_t* t, int32_t* out, size_t frameCount, int32_t* temp, int32_t* aux); - static void process__validate(state_t* state); - static void process__nop(state_t* state); - static void process__genericNoResampling(state_t* state); - static void process__genericResampling(state_t* state); - static void process__OneTrack16BitsStereoNoResampling(state_t* state); + static void process__validate(state_t* state, int64_t pts); + static void process__nop(state_t* state, int64_t pts); + static void process__genericNoResampling(state_t* state, int64_t pts); + static void process__genericResampling(state_t* state, int64_t pts); + static void process__OneTrack16BitsStereoNoResampling(state_t* state, + int64_t pts); #if 0 - static void process__TwoTracks16BitsStereoNoResampling(state_t* state); + static void process__TwoTracks16BitsStereoNoResampling(state_t* state, + int64_t pts); #endif + + static int64_t calculateOutputPTS(const track_t& t, int64_t basePTS, + int outputFrameIndex); }; // ---------------------------------------------------------------------------- |