audio: Temporary workaround for missing QCOM LPA

 * Temporary workaround to fix ABI

Change-Id: I7e7f44048b982ddbc843b3818861727fb473ae11
ACodec: Video bringup for NuPlayer and other fixes

- Add tile color format
- Handle Flush command in intermediate states

Change-Id: Id60e6a47d7dba39ea6febbfa55f64b6480ac54fa

Process EBD and FBD messages in ERROR state

- OMXCodec::on_message() function drops all OMX messages if
  OMXCodec is in ERROR state
- This can cause EBD/FBD messages containing valid buffers to be
  dropped
- Avoid dropping EBD/FBD messages so that buffer book-keeping is still
  possible

Change-Id: Idc1174b3fa946b26458d49394b87fba1738b228e
Signed-off-by: Iliyan Malchev <malchev@google.com>

nuplayer: Fixes in nuplayer Renderer

- Fix to allow EOS to be queued & handled even before
  a single frame is rendered. This can occur for suspend
  resume scenarios, where seek fails after resume.
- Reset the mSyncQueues flag when an EOS is queued immediately
  after seek
- Fix in AV sync calculation for video only stream's pause
  scenario

Change-Id: I881b9d0584dddde5f20da54f0501258649c9c600

NuPlayer: Fixes in NuPlayer

- Do not scan for sources during pause
- Do not create Video Decoder if Surface is not set
- Do not create Audio Decoder if Audio Sink is not set
- Enable fetchFile & BW estimate logs in LiveSession
- Enable format changed, and EOS logs in NuPlayer

Change-Id: Ia829dd6bb11fd4d1305caaa1dbac7434ea33e02f

ACodec: Support for dynamic port reconfig

- On port settings changed first flush output port
- Move ACodec to new state called FlushingOutputState
- Flush all output buffers, wait till all decoded buffers
  are rendered
- Then disable output port, and allocate output buffers
  with new resolution, and reset native window

Change-Id: Iafa266371ed2a87b909fbcb4eeae6b64208df617

NuPlayer-HLS: Support for handling seek from NuPlayer

- Seek was handled by the source by queuing discontinuity events
  individually for each stream.With this approach renderer will
  continue till discontinuity events are handled for each stream
- With the new approach Seek will be handled by NuPlayer directly
  Flush & reset decoders & renderer, then scan for sources
- Update meta data in ATSParser & AnotherPacketSource after seek
- Add a new discontinity type for HLS seek, and set it for seek

Change-Id: Iaff05b33f9a8d244cddbc53ae55219fb8568e614

libstagefright: Thumbnail mode initial commit

- DIVX and WMV are commented out for now
- Fix thumbnails for videos with non multiple of 4 width
- Fix source start assertion failure on MPEG4Source

Change-Id: I0e8974e088fdcc468e27764861c128cfe291499f
CRs-Fixed: 346285, 331371, 326063, 325461, 323538

libvideoeditor: Initial commit for VideoEditor bringup

- Add the color conversion routines of TILE4x2 to Planar and Planar
  to Semi-Planar to libI420colorconvert.so
- Set the native window buffer count to 3 for image preview
- All Features are supported, Resolutions upto 1080P are supported
  (constrained by available memory) as we need to support two codec
  instances at a time
- High and main profile clips cannot be imported
- Export is in H264 always (Coming from the app)

- NativeWindowRenderer: Fixed the green tint issue when applying
  negative effect
- M4xVSS_API: Do not go through the M4MCS path if there is an
  effect in the clip(avoid double encoding)
- M4MCS_API: Remove the limitBitRate function as we set the bitrate
  in Encoder
- VideoEditorVideoEncoder: Add a function to calculate proper bitrate
  for different quality and resolutions

- Remove the check for effects present in the project to get original
  functionality. This check would encode all clips in the project if
  an effects existed via the _EDIT path. But it fails for HP clips.
  Hence reverting it.
- Only encode in M4MCS for input profile > output profile

- When parsing a clip, add support for level 6 for simple profile
  MPEG4 clips
- However map it to level 5, since OpenMax does not have support for
  level 6

- When creating transitions, the bitrate is copied from the input file,
  if this bitrate is > 20Mbps, it results in an error.Limit this bitrate
  to max of 20Mbps

- During preview, after calling start on mVideoSource if the component
  runs into an out of memory error, then first stop the mVideoSource
  before clearing it.
  Once the source is NULL(cleared), add a check to handle that case
  and propogate it upwards to the app.

- If there is clip with begin cut time and MPEG4, then let it encode
  via the M4MCS path first. Null encoding leads to corruption - because
  in null encoding, if we have a begin cut time then it will decode
  upto that time, encode the frame at the cut time and just copy the
  rest from the reader and write to the intermediate file, resulting
  in corruption. Instead now this change will make it encode from the
  cut time all the way to the end of clip.

- For H263/MPEG4 encoding, bitrate is not reconfigured.We break out
 from the case to avoid getting into the default case.

Change-Id: I850edc1fcaad167250089644a4435bc549f1e31d

CRs-Fixed: 327213, 329321, 328501, 329324, 332373, 332959, 375291

libstagefright: Add support for mm-color-convertor

- Define structure and enums to be used by stagefright
  to interact with mm-color-convertor library
- Adds support of NV12 Tile to RGB565 color conversion
  using the qcom color convertor library.
- Use proper mangled name for color convertor API

Change-Id: Ifd87d0e56c5fe4c9f605321abdd39574415733f5
CRs-Fixed: 329591

libstagefright: Enable frame by frame mode

- Enable frame by frame for all formats - local playback & http
  streaming.
- Arbitrary mode is enabled only for specific formats by setting
  a new key (kKeyUseArbitraryMode) in extractor, for following
  formats :
  - H264 Interlaced clips
  - VC1 Advance profile clips
  - MPEG4 in AVI container
- If the arbitrary mode key is not set by the extractor, it will
  default to frame by frame mode for all video clips except
  interlaced clips.
- Adds SPS parsing functionality.

Change-Id: If8c47d0499720eead86b4c4fbe74696aba4423fb
CRs-Fixed: 322872

libstagefright: Fix to use correct HAL pixel format

Use correct HAL pixel format to update buffer geometry
using native window API for 7x27A/8x25.

Change-Id: I3602cf3e21d259a79f36db3103ab5f18ec2a1010

Conflicts:

	media/libstagefright/OMXCodec.cpp

libvideoeditor: remove header file added during bringup

This header file was added to this directory while merging
changes to JB.The header file exist in a different location.
Source code which need the header file is updated to include
correct path.

Change-Id: I95a8cb7dcc13ddb925d4e4f55fbeabbf54f9ca61

libstagefright: Ignore bad size error when parsing d263 atom.

Change-Id: Id71c6d55181d46671aba3e14bfbc4933687b180f
CRs-Fixed: 288020

libstagefright: Handle error on allocate buffer failure

Set state to error on allocate buffer failure at start(init)
of decoding.

Change-Id: Id16cb68aad95bf60aa520d1cc7378cfe0f88b65a
CRs-Fixed: 332373
Signed-off-by: Shalaj Jain <shalajj@codeaurora.org>

libstagefright: Add definitions for sync margins

- Added definitions for late and early margins in AwesomePlayer which
  are used to decide if frames should be delayed or dropped

CRs-Fixed: 276424, 297660

SampleTable: Add shortcut in getMaxSampleSize() to avoid ANR in corrupted clips

-for very large/corrupt values of mNumSampleSizes, getMaxSampleSize will
 run a very long forloop that will cause an ANR
-for cases where mDefaultSampleSize is zero, this ANR issue will not
 occur becase a check is in place for checking mNumSampleSizes corruption
-for cases where mDefaultSampleSize is non-zero, getMaxSampleSize will proceed
 to process each sample for finding max size.  But each run of
 SampleIterator::getSampleSizeDirect will return mDefaultSampleSize as the size
-a check for mDefaultSampleSize being non-zero is placed before the for loop,
 and will return mDefaultSampleSize if it is the case, skipping the entire for loop
 and avoids ANR

Change-Id: Ib2af5f18a2d15fb8efa6e1edaa2e5b46f6746fe8
CRs-Fixed: 316017
Merge commit 'refs/changes/20/19120/1' of http://review.cyanogenmod.com/CyanogenMod/android_frameworks_av into jb

Conflicts:
	services/audioflinger/AudioPolicyService.cpp
Merge commit 'refs/changes/11/19411/2' of http://review.cyanogenmod.com/CyanogenMod/android_frameworks_av into jb