framework/base: Add support for ADIF and ADTS

-Propagate extra codec specific data, from parser, to SoftAAC Decoder.
-Add partial frame support for ADIF files

Change-Id: I9762865ef28dade0e55f3dc813eddf4e14a6efc0
libstagefright: Enable hardware decoder for mp3

Enable hardware decoder for mp3 audio format

Change-Id: I8c4fcc14dbfa5748db5ba9e93b1dc16565abee5f
frameworks/base: Add support for FM Radio feature and FM Tx Device

- Enhanced Android framework to support FM Radio playback.
- Added support for audio playback on FM Tx device
- This change is merge of below commits:
commit 3fb81cbd00ea97fbfb7ff5918320848d1e8437ce
Author: Sidipotu Ashok <sashok@codeaurora.org>

    libstagefright: fix for FM playback Over A2DP.

commit 977f203c335301d698235a7bb0a1cec730ed597e
Author: Sidipotu Ashok <sashok@codeaurora.org>

    libstagefright: Changes in SF to support FM over A2DP.

commit 4efe970acd5e8c1f376385e5a434127e57d9e2d4
Author: Sidipotu Ashok <sashok@codeaurora.org>

    frameworks/base: Enabling FM transmisison of music streams.

commit 96739f564f07b37cdd4d9c62a9263171dfc8d893
Author: Yogesh Sadhu <ysadhu@codeaurora.org>

    frameworks/base: Fix for Number of volume levels in FM

commit 006ba3569b5e13bd91d42f6b42504c1c80c52e7a
Author: Channagoud Kadabi <ckadabi@codeaurora.org>

    frameworks/base: Add support for FM Volume Control

commit de9e99efa046c7425af40a16ebda53f94a49843d
Author: Srinivas Krovvidi <skrovvid@codeaurora.org>

    Frameworks:media: AudioManager change to expose STREAM_FM to Apps.

commit 286bac9b124fa6e6ef5892d456fb6f57ecb8b4e4
Author: Channagoud Kadabi <ckadabi@codeaurora.org>

    Framework: Add stream type for FM in Settings and fix AudioService crash

commit 164d2ab25003c76ffab969b0975a9b8e54c3d8fa
Author: Yogesh Sadhu <ysadhu@codeaurora.org>

    frameworks/base: Add FM radio feature

Change-Id: If6fc0d225f81a09f9a8bead92cc123383b325048
framework/base: Change creation order of AVI extractor

- Default AVI extractor is created before extended extractor even
when the confidence of the default extractor is less than Extended
extractor.
- Change is made to make sure default AVI extractor will be created
only when extended extractor is not created, when MIME type is AVI.

Change-Id: I9eb89b9f8157ce1de4e7e95e2e7e7ef32d23ae6a
libstagefright:Fix for progress bar update issue with ADIF clips

-Progress bar doesnt update while playing ADIF clips.
-Number of output samples is being set to zero resulting in mediatimestamp
getting calculated to zero.
-Fix is not to set number of output samples to zero when timestamp is zero.

Change-Id: I37f02e6e56127974cda8aee11e9dc49c0156d4aa
frameworks/base: Initial commit for tunnel mode encode

Initial commit for tunnel mode encode for AMRNB,
EVRC and QCELP audio formats.
- This change is merge of below commits:
commit 5a98184c78ad899bc318d8b594df6194adda09b7
Author: Haynes Mathew George <hgeorge@codeaurora.org>

libstagefright: Add QCELP/EVRC encode support

commit c67a26f4efa772bf0a45115e9c2941f2cbe957f5
Author: Y Mehta <ymehta@codeaurora.org>

frameworks/base: Add support for audio encoding for
	 amr, qcelp and evrc formats

commit 77ee267b7788a8b533c39736ecb88f8b80448535
Author: Haynes Mathew George <hgeorge@codeaurora.org>

libstagefright: Add support for tunneled audio source

Change-Id: Ibee25349773dfbcd730360c8b3313565d3ad3a85
frameworks/base: Retrieving the buffer size from AudioSystem

- Observed audio loss of last one second in EVRC/QCELP encoding.
- The value of buffer size being a constant value of 4096 causes
a delay in reading the first encoded sample. This delay remains
uptil the end causing the skipping of some encoded samples to be
written the file.
- The buffer size value is retrieved from AudioSystem HAL which
in turn retrieves from Audio HAL.

Change-Id: Iaba200f077f6bb23aa023e7e0183d4336d10a043
framework/base: Fixing ADIF clip play issue

-Few corner cases in ADIF frame assembling were missing, so few
ADIF clips were playing partially and exiting.

Change-Id: I61f07cc1ac74bea64769265998cc8f48d0a25b6a
CRs-Fixed: 321180
libstagefright: Enable HW decoder for AAC playback

-Enable HW decoder for aac clip except adif and ltp
 for 7627 and 7627a target
-Enable SW decoder for adif and ltp clips.

Change-Id: Idf3cb58f38e55806a1279e232684b8b1ba07e1c8
libstagefright: Add support to decode mp3 data in mp4 container

- Added support to decode mp3 data in mp4 container packed as mp4a atom
  and .mp3 atom as well.

Change-Id: Ib9401f79f99f33acc0b87d3ac01f728548406483
libstagefright: Fix out of bounds error for H264 software decoder

If decoded clip's level is 1.0, InitDPB() and AVCConfigureSequence()
compute different number of frames (num_fs) to allocate.  InitDPB()
holds an extra frame if num_fs is 1, where as AVCCS() does not. Since
InitDPB() sets the state and AVCCS() allocates the buffers, num_fs - 1
buffers will be allocated.  During decode, we'll attempt to access the
num_fs-th frame which will be out of bounds.

This fix sets AVCCS()'s copy of num_fs to be same as whatever InitDPB()
computes.

Change-Id: I9f1f395ba0baa640d9b46c1c003e84930d88ca1c
CRs-Fixed: 276145
Make sure we can properly shutdown even if

a) one of the two decoders has a pending discontinuity
b) the renderer holds on to all output buffers for that decoder
c) the renderer is paused

if all three conditions are met the decoder won't ask for more input data
and therefore never see the discontinuity.

To avoid this we briefly resume the renderer just before shutting down.

Change-Id: I9e08af2a1eb4298d1cd00497d6aa33f4ad184e9a
related-to-bug: 5655016
Camera : Framework changes for camcorder UI menu

Change-Id: Iff9e9021da44b67f81a24c828b960113ee249248
libstagefright: Fixing a crash in EOS for thumbnail generation.

Initializing an uninitialized variable and fixing
a crash. At EOS OMXCodec::read was returning OK and
a NULL buffer. This is not a valid return combination
as client expects buffer to be non-NULL when there
is no error. With this change OMXCodec::read
will return ERROR_END_OF_STREAM with a NULL buffer
which is a valid return combination. This change
is specific to hardware thumbnail generation.

Change-Id: I83ebdc69e2195b903ea652cb46bf91df48457eec
libstagefright: Software decoder is the first choice for thumbnail generation

Set the flag to use software decoder only for the first call to extract video
thumbnail.

Change-Id: I547e9d141f03958878f6278d6ac0837460972fce
libstagefright: Enable hardware thumbnail generation

Hardware video decoder will be used to generate
thumbnails if the software decoder fails.

- Enabled for 8660 and 8960
- Add property to disable use of sw decoders for thumbnail creation
- Additional debug logs in metadata retriever

Change-Id: I249d7be146b5d07468826f28f7843a208ed39c1b
libstagefright: OMXCodec error handling fix

- Drop messages in OMXCodec ERROR state only for s/w OMX component

Change-Id: If9940f1f1429821587938fe005c526ab7559ff8e
libstagefright: Ignoring some events in ERROR state.

Port disable, port enable and flush complete events
need to be ignored if the component is in ERROR
state.

Scenario for port enable:
While the output port is being reconfigured,
component might be parsing input buffers. If
component encounters an error in parsing,
it might move into Invalid state and
then generate a port enable complete on output
port. Adding fix to handle this scenario.

Scenario for port disable:
Port settings disable command complete need to
be ignored in error state. This scenario happens
when the component moves into ERROR state and
issue Port Disable command complete during Port
Reconfiguration.

Scenario for flush:
Component may move into invalid state and then
issue a FlushComplete command. In this case
we should not send any buffers to component
and report error to the client of OMXCodec.

Change-Id: I5385774d77f1a32f6947bb23c7792c0d8e33bda7
frameworks/base/nuplayer: Add logs to capture more debugging information.

- Added property for backing up data buffer to file.

- Changing error message to normal message.
  This is not an error message. The code block executes when end of
  streams reached.

Change-Id: I5bfad7475757360338103d4d7cfcbb534895725a
frameworks/base: Add rendering statistics to Stagefright (Adapted)

- this is an adaptation of change 514 (I88dd988c9) from HC to ICS
- functionality is the same as the forementioned patch
- added all statistics properties for AwesomePlayer into
  Google's Stats struct
- acquire locking before modifying/accessing mStats values
- moved mStatistics check in AwesomePlayer to inside the log functions

Change-Id: I553823b22403a0e5e9fc3998a27a54fec9e1b5c4