diff options
author | Glenn Kasten <gkasten@google.com> | 2012-04-12 09:39:07 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-04-16 17:43:58 -0700 |
commit | 4e2293f29f2e719af1245d365747ea06d074b345 (patch) | |
tree | d07878412ffeca6ccd4e7e4bbbc0b4fb68370a59 /services/audioflinger/AudioMixer.h | |
parent | 99a80e10f2d0e88c0509a298bdd1df0308b55a7b (diff) | |
download | frameworks_av-4e2293f29f2e719af1245d365747ea06d074b345.zip frameworks_av-4e2293f29f2e719af1245d365747ea06d074b345.tar.gz frameworks_av-4e2293f29f2e719af1245d365747ea06d074b345.tar.bz2 |
AudioMixer new cmd: remove sample rate converter
Add a new command REMOVE to remove any sample rate converter
on a track, without having to delete the track name.
Add comments.
Remove some dead code.
Fix whitespace and comparison to NULL.
Change-Id: Id55a23ab5ee673189e99675b4e6fa5df7b617987
Diffstat (limited to 'services/audioflinger/AudioMixer.h')
-rw-r--r-- | services/audioflinger/AudioMixer.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h index a04fe95..9698d0c 100644 --- a/services/audioflinger/AudioMixer.h +++ b/services/audioflinger/AudioMixer.h @@ -70,8 +70,17 @@ public: AUX_BUFFER = 0x4003, DOWNMIX_TYPE = 0X4004, // for target RESAMPLE - SAMPLE_RATE = 0x4100, - RESET = 0x4101, + SAMPLE_RATE = 0x4100, // Configure sample rate conversion on this track name; + // parameter 'value' is the new sample rate in Hz. + // Only creates a sample rate converter the first time that + // the track sample rate is different from the mix sample rate. + // If the new sample rate is the same as the mix sample rate, + // and a sample rate converter already exists, + // then the sample rate converter remains present but is a no-op. + RESET = 0x4101, // Reset sample rate converter without changing sample rate. + // This clears out the resampler's input buffer. + REMOVE = 0x4102, // Remove the sample rate converter on this track name; + // the track is restored to the mix sample rate. // for target RAMP_VOLUME and VOLUME (8 channels max) VOLUME0 = 0x4200, VOLUME1 = 0x4201, @@ -237,7 +246,10 @@ private: // indicates whether a downmix effect has been found and is usable by this mixer static bool isMultichannelCapable; + // Call after changing either the enabled status of a track, or parameters of an enabled track. + // OK to call more often than that, but unnecessary. void invalidateState(uint32_t mask); + static status_t prepareTrackForDownmix(track_t* pTrack, int trackNum); static void track__genericResample(track_t* t, int32_t* out, size_t numFrames, int32_t* temp, int32_t* aux); |