summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioMixer.h
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-05-23 23:51:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-23 23:51:17 +0000
commitc62476f0c0c1cf9283a38852bde0a4c9434df712 (patch)
tree6249b263dba1e91017e9debfe4c2e8f79b1be2c7 /services/audioflinger/AudioMixer.h
parent7a470c375c2cef8b186fbadd9915b30e5d757453 (diff)
parente8a1ced4da17dc6c07803dc2af8060f62a8389c1 (diff)
downloadframeworks_av-c62476f0c0c1cf9283a38852bde0a4c9434df712.zip
frameworks_av-c62476f0c0c1cf9283a38852bde0a4c9434df712.tar.gz
frameworks_av-c62476f0c0c1cf9283a38852bde0a4c9434df712.tar.bz2
Merge "Add format parameter to getTrackName() and track_t"
Diffstat (limited to 'services/audioflinger/AudioMixer.h')
-rw-r--r--services/audioflinger/AudioMixer.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index 09e63a6..4a39f88 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -104,7 +104,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);
@@ -122,6 +125,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 {
@@ -198,9 +205,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