audio_policy: Fix for mute count mismatch for sonification strategy

- Sometime ring tone is not heard while in MT call

- During call mode, primary output ringtone/alarm stream mute count
  is incremented on startOutput and decremented on stopoutput
  for all Output requests.
    This is resulting side effect if stop output for non-primary outputs
  called, when no active streams available on primary output(mute count
  will not decrement)

- Add requested output check on start & stop output before calling
  handleIncallSonification API

Change-Id: Id4f328e2f9fc6820cecfbd73df11c871f8587aad
audio_policy : Fix for incorrect input device selection

BLUETOOTH_SCO_HEADSET is not avaibale in input devices list
for recording usecases. Add the same to allow VOIP applications
to select BLUETOOTH_SCO_HEADSET as input device when
BT is connected.

Change-Id: I5d5010ab396f85bf58573943c91fd815f39f57c1
CRs-fixed: 712950
stagefright: httplive: Fix deadlock for low duration clips

PlaylistFetcher buffers up to 3 * target-duration bytes of data,
but if a stream is slow (ie due to bad network conditions), a
buffer threshold of 10s is used to resume playback. This results
in an indefinite freeze as PlaylistFetcher has stopped buffering
before this threshold. Reduce the 10s threshold to be more in-sync
with PlaylistFetcher's buffering size.

CRs-Fixed: 745835
Change-Id: Ife846e7c5b4f9645895873d08250c4bee0164972
stagefright: httplive: Reduce memcpy calls for chunked content

Streams using http chunking will not report the segment's total
content-length. In this case, a 64k buffer is allocated and is
increased by 32k each time the buffer is filled again. For high
bitrate content, this can lead to a large number of copies that
affect the HLS framework delay. Increase fetchFile buffer size
exponentially by 50% or at least 32k instead of by 32k each time
to reduce the number of memcpy calls.

Example for a chunked 6 MB 1080p segment (ie ~3s):
Adding 32k:
190 copies with 572.97 MB copied

Increasing by 50%:
12 copies with 16.09 MB copied

CRs-Fixed: 745835
Change-Id: Iedf0e4437e96026a58d50bce2660f85ac90d0ada
Added support for YEAR metadata key from VorbisComments

The OggExtractor wasn't extracting the YEAR key when the metadata in
the file was parsed. The YEAR key is now extracted when the file
metadata is parsed.

Change-Id: Idf0d1a37fb141491dce5de527703ca1b27f621e7
stagefright: Keep track of the bit width in the RAW codec

 * We need this to push 24-bit PCM around Stagefright and OMX

Change-Id: Ic94ec972162a01545d5dd0ad0bf3eb6c6731f42e
stagefright: Add FLAC support to MatroskaExtractor

Change-Id: Ib1b7d7e6fed617404eb5581a5f87ab67531f5bb8
stagefright: Support HEVC tracks in Matroska containers

 * Pass the HVCC atom to Stagefright.

Change-Id: I7fdca25e20b9051925936a34e594808b18a3a3bd
stagefright: Improve FLAC and WAV support for 24-bit

 * Forward-port changes from CM11
 * Remove truncation support as AudioFlinger handles
   rebuffering in case it can't go to the hardware.

Change-Id: Iad30d04ee051050e444c3d665fa8bb7a1cfef348
audioflinger: Enable floating point samples in AudioFlinger

 * Enable "new" mixer mode to enable mixing and reformatting
   of high precision (> 16-bit) streams.
 * Add missing 8_24 format to list of allowed formats.

Change-Id: I7d7b8ca7e34b25afda3af7e796d24cb94779715a
stagefright: Support for 24-bit audio in StageFright

 * Plumb bit depth thru ACodec and OMX
 * Add support for 24-bit PCM offload in NuPlayer on QC devices
 * Use new AudioFlinger features for mixing multi formats without offload
 * Clean up a bunch of code

Change-Id: I018d3a995b63450a38c6c43eaa37c86be30fd893
audiopolicy: Add missing AV_ENHANCEMENTS flag

 * Fix all the audio :(

Change-Id: If41e2b2f1cba1c0ed24ef6ae06f9ede78081d834
audioflinger: Bind new mixer code to the resampler property

Don't try to use the new mixer mode if af.resampler.quality is set,
since they're incompatible. It's recommended that devices switch
by dropping the property though.

Change-Id: I18179799361108776a3a1e051bc0e23cd480fa10
Revert "audioflinger: Bind new mixer code to the resampler property"

This reverts commit 9094602d5448482e63da2f56f8c637652a9e1a58.

Change-Id: I9f569082051916cd885c1bd140d5a2a766703407
audio: Do not delete PatchRecord before Peer is stopped

- PatchRecord is deleted before the Peer PatchTrack is completely
  stopped which is leading to a crash in getNextBuffer
- Fix is to delete PatchRecord and PatchTrack only after removing
  both of them from active tracks list

Change-Id: I8e982d9eece09c948ed448eb870d78830df1bfa8
nuplayer: Fix PCM offload turning on all the time

 * Remove the extra condition, since this will be set even if
   PCM offload was denied.

Change-Id: I8f33ef68562d8e057e7a86c5ae6187d0049bf3aa
libmedia: Add ICS AudioStreamType constructor

Needed for Samsung legacy camera libs.

Change-Id: If03d8525b55181ea20dc934dbcbfef85402c42c7
libmedia: Add legacy compatible overloads for some methods

These overloads are needed by Samsung legacy camera libs.

Change-Id: I12590b1e86c2e0fa9958c5baa714110ff77a5eec
av: Clean up QCOM build flags

 * Remove dead flags
 * Enable standard flags by default

Change-Id: I15b4743a2569360dcb5798f2f1d8f4390a68899a
Merge remote-tracking branch 'cm/cm-12.0' into aosp-5.0