AudioMixer uses downmix effect for multichannel content

In the AudioMixer structure associated with each track, add an object
  that acts as the buffer provider when the track has more than two
  channels of input in the mixer. This object, DownmixerBufferProvider,
  gets audio from the actual buffer provider of the track, and applies
  a downmix effect on it.
The downmix effect is created and configured when the track gets
  created in AudioFlinger, which causes AudioMixer::getTrackName()
  to be called with the new track's channel mask. It is released
  when the track is disabled in the mixer.

Change-Id: I05281ed5f61bef663a8af7ca7d5ceac3517c82db
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index e493a9a..8a787e1 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -964,8 +964,9 @@
     protected:
         SortedVector< wp<Track> >       mActiveTracks;
 
-        // Allocate a track name.  Returns name >= 0 if successful, -1 on failure.
-        virtual int             getTrackName_l() = 0;
+        // Allocate a track name for a given channel mask.
+        //   Returns name >= 0 if successful, -1 on failure.
+        virtual int             getTrackName_l(audio_channel_mask_t channelMask) = 0;
         virtual void            deleteTrackName_l(int name) = 0;
 
         // Time to sleep between cycles when:
@@ -1057,7 +1058,7 @@
 
     protected:
         virtual     mixer_state prepareTracks_l(Vector< sp<Track> > *tracksToRemove);
-        virtual     int         getTrackName_l();
+        virtual     int         getTrackName_l(audio_channel_mask_t channelMask);
         virtual     void        deleteTrackName_l(int name);
         virtual     uint32_t    idleSleepTimeUs() const;
         virtual     uint32_t    suspendSleepTimeUs() const;
@@ -1082,7 +1083,7 @@
         virtual     bool        checkForNewParameters_l();
 
     protected:
-        virtual     int         getTrackName_l();
+        virtual     int         getTrackName_l(audio_channel_mask_t channelMask);
         virtual     void        deleteTrackName_l(int name);
         virtual     uint32_t    activeSleepTimeUs() const;
         virtual     uint32_t    idleSleepTimeUs() const;