diff options
author | Andy Hung <hunga@google.com> | 2015-03-26 19:04:33 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2015-04-09 12:37:01 -0700 |
commit | c5656cc900aeb4a705e27508dd82c70030a97709 (patch) | |
tree | 930d4266db7b4d93eb7ade5629812a722dc7920f /services/audioflinger/AudioMixer.h | |
parent | 857d5a20a956ef61b64ae07b018ecc2f1eb0a503 (diff) | |
download | frameworks_av-c5656cc900aeb4a705e27508dd82c70030a97709.zip frameworks_av-c5656cc900aeb4a705e27508dd82c70030a97709.tar.gz frameworks_av-c5656cc900aeb4a705e27508dd82c70030a97709.tar.bz2 |
Add playback rate to AudioMixer
Bug: 19196501
Change-Id: I42d1f90e6297cf3f1304860d1691a5dfedd4c37d
Diffstat (limited to 'services/audioflinger/AudioMixer.h')
-rw-r--r-- | services/audioflinger/AudioMixer.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h index e283b83..e27a0d1 100644 --- a/services/audioflinger/AudioMixer.h +++ b/services/audioflinger/AudioMixer.h @@ -73,6 +73,7 @@ public: RESAMPLE = 0x3001, RAMP_VOLUME = 0x3002, // ramp to new volume VOLUME = 0x3003, // don't ramp + TIMESTRETCH = 0x3004, // set Parameter names // for target TRACK @@ -100,6 +101,9 @@ public: VOLUME0 = 0x4200, VOLUME1 = 0x4201, AUXLEVEL = 0x4210, + // for target TIMESTRETCH + PLAYBACK_RATE = 0x4300, // Configure timestretch on this track name; + // parameter 'value' is a pointer to the new playback rate. }; @@ -214,6 +218,9 @@ private: /* Buffer providers are constructed to translate the track input data as needed. * + * TODO: perhaps make a single PlaybackConverterProvider class to move + * all pre-mixer track buffer conversions outside the AudioMixer class. + * * 1) mInputBufferProvider: The AudioTrack buffer provider. * 2) mReformatBufferProvider: If not NULL, performs the audio reformat to * match either mMixerInFormat or mDownmixRequiresFormat, if the downmixer @@ -223,11 +230,13 @@ private: * the number of channels required by the mixer sink. * 4) mPostDownmixReformatBufferProvider: If not NULL, performs reformatting from * the downmixer requirements to the mixer engine input requirements. + * 5) mTimestretchBufferProvider: Adds timestretching for playback rate */ AudioBufferProvider* mInputBufferProvider; // externally provided buffer provider. PassthruBufferProvider* mReformatBufferProvider; // provider wrapper for reformatting. PassthruBufferProvider* downmixerBufferProvider; // wrapper for channel conversion. PassthruBufferProvider* mPostDownmixReformatBufferProvider; + PassthruBufferProvider* mTimestretchBufferProvider; int32_t sessionId; @@ -250,6 +259,9 @@ private: audio_channel_mask_t mMixerChannelMask; uint32_t mMixerChannelCount; + float mSpeed; + float mPitch; + bool needsRamp() { return (volumeInc[0] | volumeInc[1] | auxInc) != 0; } bool setResampler(uint32_t trackSampleRate, uint32_t devSampleRate); bool doesResample() const { return resampler != NULL; } @@ -262,6 +274,7 @@ private: void unprepareForDownmix(); status_t prepareForReformat(); void unprepareForReformat(); + bool setPlaybackRate(float speed, float pitch); void reconfigureBufferProviders(); }; |