diff options
author | Andy Hung <hunga@google.com> | 2014-05-09 15:02:21 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2014-05-19 12:27:46 -0700 |
commit | e8a1ced4da17dc6c07803dc2af8060f62a8389c1 (patch) | |
tree | eadb47a0d9349451773ef55adaa60317e1dbafad /services/audioflinger/AudioMixer.h | |
parent | 68112fc4f77ab8c4a744782f78e9792afe0cbfc1 (diff) | |
download | frameworks_av-e8a1ced4da17dc6c07803dc2af8060f62a8389c1.zip frameworks_av-e8a1ced4da17dc6c07803dc2af8060f62a8389c1.tar.gz frameworks_av-e8a1ced4da17dc6c07803dc2af8060f62a8389c1.tar.bz2 |
Add format parameter to getTrackName() and track_t
Change-Id: Ia152a839014e235fbfb656104c15d7c1b456d02e
Signed-off-by: Andy Hung <hunga@google.com>
Diffstat (limited to 'services/audioflinger/AudioMixer.h')
-rw-r--r-- | services/audioflinger/AudioMixer.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h index e5e120c..c945c2b 100644 --- a/services/audioflinger/AudioMixer.h +++ b/services/audioflinger/AudioMixer.h @@ -100,7 +100,10 @@ public: // For all APIs with "name": TRACK0 <= name < TRACK0 + MAX_NUM_TRACKS // Allocate a track name. Returns new track name if successful, -1 on failure. - int getTrackName(audio_channel_mask_t channelMask, int sessionId); + // The failure could be because of an invalid channelMask or format, or that + // the track capacity of the mixer is exceeded. + int getTrackName(audio_channel_mask_t channelMask, + audio_format_t format, int sessionId); // Free an allocated track by name void deleteTrackName(int name); @@ -118,6 +121,10 @@ public: size_t getUnreleasedFrames(int name) const; + static inline bool isValidPcmTrackFormat(audio_format_t format) { + return format == AUDIO_FORMAT_PCM_16_BIT; + } + private: enum { @@ -194,9 +201,8 @@ private: int32_t sessionId; - audio_format_t mMixerFormat; // at this time: AUDIO_FORMAT_PCM_(FLOAT|16_BIT) - - int32_t padding[1]; + audio_format_t mMixerFormat; // output mix format: AUDIO_FORMAT_PCM_(FLOAT|16_BIT) + audio_format_t mFormat; // input track format // 16-byte boundary |