Fixed sample video corrupted in MediaCodec mode.

Change-Id: I50c5660072d40f6e297e58fd026ea04c89d6a70a
related-to-bug: 6732061
Merge "Fixed sample video corrupted in MediaCodec mode." into jb-dev
merge in jb-mr0-release history after reset to jb-dev
merge in jb-release history after reset to jb-dev
merge in jb-release history after reset to jb-dev
libstagefright: Adding a work around for SurfaceMediaSource

- Do not stop on first call to onBuffersReleased, which presumably
  will be called when producer calls setBufferCount on BufferQueue.
- Do not flush the buffers when stop is issued via onBuffersReleased
  (producer calls disconnect on BufferQueue), instead flush when reset
  is called.

Change-Id: I91448bc87563f2245ad9c9c7150b82c358bfe9e2
CRs-Fixed: 387181
libstagefright: Fix to free buffers in error scenarios

    o MediaBuffer objects are not freed if component transition from IDLE->EXECUTING
      or EXECUTING->LOADED fails (or if the OMX_CmdComplete messages are dropped
      due to an earlier error)
    o Additionally with native buffers, the corresponding ANativeWindowBuffers are not
      cancelled back in the above scenarios.

Change-Id: Icdee687dab4883639f49ba0b38d6c80d7013873b
libstagefright: Accept vendor specific NV12 colorformat from component

Accept OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m color format which
is NV12 + 32 aligned stride and slice.  This different from vanilla NV12
which is 16 aligned.

Change-Id: Id6cd4295c7710b3f33ef082e3b644732fd85e3fb
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
libstagefright: Add flag to use MM heap for SurfaceMediaSource

 * Older QCOM camera drivers need to use the MM heap for effects
   recording. Add a a flag to enable this.

Change-Id: I4f78c3b370ba1ef7b6a0c567de0a211e85e8a2d0
frameworks/av: Use software decoders for LPA clips

Use software decoders for aac and mp3 LPA clips

Change-Id: I0310e128505ff383138c6a7dcb934ae64e86d6bd
audioflinger:  Avoid deadlock for sound recording - LPA concurrency.

-Rapid button press will cause next clip playback. If next clip is lpa
 clip, opening lpa clip triggers set parameter. The set parameter would
 acquire flinger lock and wait for completion. The wait can only be
 signalled from checkForNewParameters_l() in threadloop but the record
 thread loop will be blocked on processConfigEvents() on audio flinger
 lock resulting in deadlock and record failure.
-Release the lock before setParameter on threadbase is called to avoid
 the deadlock scenario.

Change-Id: Ib165210d16bcf661b6aa56aac1529375087e4e4e
CRs-Fixed: 390918
libstagefright: Fix crash during next clip playback

-Decoder/Extractor thread and reset was not synchronized and this
 resulting in write being called during destruction of session out.
-This causes crash during continuous next clip playback.

Change-Id: Id0c953541f2ba74b2321b16636852cbe59c4cdcb
CRs-Fixed: 392250
libstagefright: Pass aligned width to color convert routine

- NV12Tile requires aligned buffer sizes.
  The size passed was un-aligned.

Change-Id: I0d6c618aab7588998ef0e9cfa3fb8a51d9bce93a
Merge "libstagefright: Pass aligned width to color convert routine" into jellybean
AudioFlinger: mOutput->stream->get_latency must be inside mLock scope

Otherwise lock-ups during simultaneous playback of multiple
audio streams can happen.

Change-Id: Idd392761e50c1754f9740b7151fc90396542b909
camera: remove redundant QCOM_HARDWARE ifdefs

Change-Id: I9bccd7cb2fd3a7a7b3bda8002cf57ad21ce6b37e
camera: add missing symbols for HTC 8660 camera HAL

Forward port of patch from HTC 8660 missing symbols patch from ICS.

Change-Id: I9ed27e3bc1b0d63c437b3cf9518b36e0da546e81
AudioFlinger: Disable AUDIO_WATCHDOG to reduce high audio power

- AudioWatchDog daemon wakes up the app processor every 50ms.
  This causes audio power to increase by ~3.5-4mA.
- Disable AUDIO_WATCHDOG to reduce high audio power.

CRs-fixed: 386481

Change-Id: Id8f038bd082b9aa711411db33c5302e1d12cadd6
libstagefright: Enable suspension policy

- ADSP doesn't enter suspend state after audio playback.
- No support for suspension policy in stagefright.
- Enable suspension policy in stagefright to allow
  component to move into suspend mode.

CRs-fixed: 386381
(cherry picked from commit 735bc83e32e64af25a6163c07e2039eb4354ff00)

Change-Id: If32bfc63bbb25563e14b128712cc90639b15dc5b
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Merge "camera: remove redundant QCOM_HARDWARE ifdefs" into jellybean