audioflinger: Allow FAST tracks for any supported sample rate

Change-Id: I3c749c8ec5d3b372ed186fb2e706fcbd63e07625
stagefright: More high-resolution audio support

 * Clean up the "error driven" fallback code we had before and
   reconfigure components if the output bit width needs to change
   (a2dp/usb fallback).
 * Decode various formats (AC3/DTS/EAC3) which output floating point
   samples using FFMPEG, which will output 24-bit PCM for us.

Change-Id: I94f5fa59f5f737be8969df4c5ad4295c45cb8657
stagefright: Use multiaac decoder for multiaac :)

 * Fix the channel count and use the non-OMX multiaac codec.
 * This fixes a DSP crash with certain files.

Change-Id: I7fe14b7b647db8017724676f87c083301c2295a8
audio: Audio resampler support for 192Khz playback

-Current AudioResampler limits input sampling rate to be
maximum of twice of output sampling rate to downsample.
The output sampling rate being 48khz, maximum input sampling
rate that be supported is 96khz.
Support is added to use qti resampler for playback upto 192khz.

Change-Id: Ia8f24a0874ebf6e16ef7bd1f2759a14f47149875
stagefright: Resolve turf war between FFMPEG and mm-parser

 * There is overlap between the supported codecs, and the extractors
   generally do the right thing. The current code will blindly call
   into the FFMPEG specific functions when some QC codec should
   be used though, so add checks on the component name first.
 * This resolves hitting asserts when using hardware WMA/WMV codecs.
 * Also add a contraint to block the VC1 codec from try to play ancient
   WMV formats, as it will fail.

Change-Id: I3b8aafaef7ae7c0f2e058f78b043380f04a41e73
libmedia: Add flag for non-native FAST tracks.

Change-Id: Ied9004c0bdc6314541b12095ca1defd0f291eb1a
stagefright: STEVE BUYS DONUTS

 * Unbreak the Hammerhead build.

Change-Id: I139a8a15d05c3b1bf8811b50a3d0b33292b0eb63
stagefright: Scan for ".ts" files

Change-Id: Icd837ccbb188524a393de07a6c261b9f95ffb0ca
stagefright: Fix CTS failures

Change-Id: Ibe30029409667912ff150df47e3be8dd2956844b
effects: miscellaneous fixes

fixes of KW issues 8887, 8888

Change-Id: I824daa76d23456fed2c299c59f934d3e2ac78b84
libstagefright: Handle INFO_FORMAT_CHANGED for dolby clips

  -For dolby clips when device is switched from headset to
   BT multiple times, media error is observed, and playback
   stops
  -When end device is changed, s/w Dolby decoder generates
   format change event which in certain condition leads to
   media error and playback stops
  -Make sure format change error is handled in AudioPlayer
   layer

CRs-Fixed: 706801

Change-Id: I3ff3ef84b15ea5f9d3288215c1491dc30d17a413
libstagefright: extend the interface to switch rtp transport

- rtp transport can be changed by setting property "rtsp.
  transport.TCP" and udp is the first choice as
  default. But the property is the global variable and
  affects each instance's behaviour.
  Extend the interface of MyHandler to let each client make
  its own choice. If the client wants to choose tcp first,
  add the string/value "rtp.transport.TCP"/"true" in the headers
  when calling MediaPlayer.setDataSource.

Change-Id: I19b6192da36d5c00e62c9f69de446f366f10c75c
Crs-Fixed: 696569
Support MPEG4 and H263 FourCC types in Matroska files

Handles MPEG4 and H263 content with FourCC header in Matroska files
based on how these are handled in the AVI parser.

Also adding placehoders for DivX.

Change-Id: I38b2c2fd429b6e4810a7b118bf60823d502320ae
stagefright: Fix crash if PCM offload gets a null source

Change-Id: I4db08355fb132288cec2ba99ec4dcb77f1618add
media: Cleanup some unnecessary old code

Change-Id: Id204180026b701bbf4c565c34a6fbba8b120eb0a
Remove potential cause of underrun.

1. This part of ProcessAudioBuffer function can make underrun issue.
   Because AudioTrackThread::threadLoop's default case is 'pauseInternal'.

2. Without removed part : If AudioTrack obtain small buffer, then it can request small decoded data to player service without waiting.

3. We already have 'waiting codes' in 'AudioTrackshared.cpp ClientProxy::obtainBuffer', it using '__futex_syscall'.
   If we got 'full shared buffer', then 'ClientProxy::obtainBuffer' waits 'ServerProxy::releaseBuffer'.
   It means, there are duplicated 'waiting codes' for ProcessAudioBuffer.

So I removed this part for preventing underrun issue.

Change-Id: Idcca686054d92a4d123873b78b3b9c2e87d3bdca
Signed-off-by: Jinhyuk Seong <jin.seong@lge.com>
Revert "libmedia: Add flag for non-native FAST tracks."

 * Changing design of this, no longer needed.

This reverts commit a667d25f10063679829f3eca39d6d6d84d3ac05e.

Change-Id: If8e348cdf53f01314a05fa4ea1a5dfdec6cc24ba
libstagefright: LPA playback fails when non-LPA clip is next clip

-When non-LPA clip follows an LPA clip in Music App,
 playback of LPA clip fails.
-setNextPlayer causes the loading of decoder omx component
 and acquires the DSP resources for non-LPA clip, even before
 LPA clip acquires DSP resources.
-Add property to check if hardware decoder needs to be overridden.
 If LPA is in progress, the select software decoder for next
 clip.

[mikeioannina]: Adjust for android 4.4

Change-Id: I0e40fa9859faf84f241e721cdbcb88302c698b8b
libstagefright: Stability issue with LPA play back.

- ANR is observed during LPA playback when there is song switch for
  every few seconds
- The song switch does not happen when the song is played till the end
-Avoid creating threads and calling reset if lpa start fails.
Initiate audio sink mutex before using it and return immediately
from setupAudioSink() in error cases.
Also remove unwanted code related to a2dp thread in lpaplayer as
no such thread is created. Make decoderthreadAlive variable false
before returning from decoder thread.
Update mInternalSeeking in pausetimeout to make sure source is
updated to the timeplayed before pause and resumes at correct position.
During onPauseTimeout if resume is issued even before closing
the LPA driver, causing decoder thread to wake up and trying to
write data. When decoder thread trying to write data LPA driver
is closed as part of the pause timeout.Synchronize these two functions
using a mutex to prevent concurrent execution.
Mono clips are now converted to stereo by copying the left
sample to right.This is same as what Resampler does in Non-LPA Playback.
This is to avoid crash in the sound effects library during repetative
calling of effects_configure and effect_process for mono clips.

[mikeioannina]: Adjust for android 4.4

Change-Id: If1652db80624a888924da22d690b2a34e176cb0e
CRs-Fixed: 463272

Conflicts:
	media/libstagefright/LPAPlayer.cpp