RTSP: Return the buffers in source side while the source is disconnected

There is a race condition, some buffers are held by the source
because of the poor network environment. If the client tries to flush at
this time, the flush operation will be blocked because not all the buffers
are returned to the client.
At this time, sometimes, the source will be disconnected from the server,
then these buffers held by the source won't be returned any more.
Without this patch, flush operation maybe won't finish, and blocks
other operations, causing ANR.

Change-Id: I19581498d17a29b637d5468932438ea862e1c7ff
libstagefright: Polish MPEG4Writer for MediaMuxer.

     1. Fixed bug in Utils, which ignore 'ESDS' data for MPEG4 video.

    2. Add format limitation for MPEG4Writer.
       only support H.263/AVC/MPEG4 video and AAC/AMR-NB/AMR-WB audio.

Change-Id: I6daa9fa7c487d6cd95983d8b8da6f7fa53a2c44d
Signed-off-by: Anjun Wen <ajwen@marvell.com>
Support MPEG4 codec in Matroska files

For MPEG4 the matroska parser must handle files with and without
configinfo in the codec private data.

Change-Id: I7025772c87ee24bc074bd3837f6877552245e389
Support AAC audio (WaveFormat = 0xFF) in AVI container.

Present AVIExtractor doesn't support AAC audio. So some AVI clip with AAC,
AAC-HEv1, AAC-HEv2 audio, can't be played from gallery.
With this fix, added support for AAC audio (WaveFormat = 0xFF) in AVI container.
Also added a condition to check the sampling rates which are supported and return
error if unsupported sampling rate is encountered, to avoid tombstone crash.

Change-Id: Ic8f081ed254ce8c0b3c0cbd1c3811b89b18c6e8e
Signed-off-by: gbhakteX <gurudattax.bhakte@intel.com>
Signed-off-by: Mazhar <mazharx.sameullah@intel.com>
Support MP2 contents in AVI container.

In present code only "Wave Format = 0x55 (MPEG Layer 3)" is supported in AVI container.
With this fix, adding support for "Wave Format = 0x50 (MPEG)".
As per "RFC 2361 - WAVE and AVI Codec Registries":
A.45 MPEG
WAVE form Registration Number (hex): 0x0050
Codec ID in the IANA Namespace:      audio/vnd.wave;codec=50
WAVE form wFormatTag ID:             WAVE_FORMAT_MPEG

Change-Id: I7cc9d3c8bd8da7a079ac8d50a6d61ccbdedb6f82
Signed-off-by: gbhakteX <gurudattax.bhakte@intel.com>
AwesomePlayer: improve scheduling of video event to hit PTS

Change-Id: I7b19911acbde9b592b757b952d4ad63cd8efebed

AwesomePlayer: use PTS for queueBuffer

Change-Id: I1c14ad4784c799c46cf06a14b0f00c5e4d01f718
Fix decoder EOS handling

Conceptually it should be the same whether EOS is signalled on the last
buffer holding data, or an empty buffer that follows. Make it so that
this actually behaves the same for mp3, AAC and Vorbis.

b/8747869

Change-Id: Idece8ef45689a3ffaf70fb45d19862d7b93b2f92
AACExtractor: Added support for APE tag

To support aac audio with APE tag we need parse
this tag. Otherwise AACExtractor stops reading of
audio file.

DR: OMAPS00267689

Change-Id: Ic697b90dbc9f2b93aeb227411359c36c113cb71e
Signed-off-by: Daniel Levin <dendy@ti.com>
AC3 support ATS (MPEG2TS) Parser

Added support for AC3 in TS parser.

Change-Id: Iaa7d29a7f791e1ca68156fa43a69d835dc4596ae
audioflinger: Cleanups

Change-Id: I23279f0602544320a191464ecde006bbfca6ab55
AudioTrack: When paused, return cached playback position

An offload output can be re-used between two audio tracks having
the same configuration. A timestamp query for a paused track
while the other is running would return an incorrect time.
To fix this, cache the playback position on a pause() and return
this time when requested until the track is resumed.

CRs-Fixed: 612943

Change-Id: I54b5a851ee3fa2ceadc37e3f5c6af4f37b8f404a
Do partial reads in MemoryLeakTrackUtil

Do partial read in MemoryLeakTrackUtil dumpMemoryAddresses
to avoid using more memory than what is allocated.

Change-Id: I94feb4e00647407f938571167b981c7371f39e3d
libmedia: ensure mCaptureThread exit within Visualizer destructor

If mCaptureThread doesn't exit when Visualizer instance gets destroyed,
recycled member variables with random value such as danger pointer will
be accessed again and causes crash.

Thread which is created within Visualizer instance lifecycle should be
terminated before or within destructor.

CRs-Fixed: 688546
Change-Id: Ie0b12ae8a3b9735b6ecbac0353781b8358cad644
stagefright: Fix pause logic

 * This code can race during CTS. Only wait for HW decoders.

Change-Id: I4cfa049f06d27ca7ca9107ae31772f38392a8bc2
audio: compress offload to pcm fallback on SSR

- Add support for error propagation on
  time stamp query for playback session

- Add support for compress to pcm fallback
  during SSR

Change-Id: I4fa793de95bfe58cde7a05735d8f70a672ea19fc
Merge branch 'cm-11.0' of https://github.com/CyanogenMod/android_frameworks_av into kk4.4