stagefright: Fix 24-bit WAV

 * When 24-bit output is enabled, we need to ensure that padding
   to 32 bits is done correctly.
 * Create new output buffers which conform to the correct format.

Change-Id: I5c07027ee8d3040147698c1f484b40991f943c03
cameraservice: Resolve message vs start/stop preview races

Move the mutex in start/stopPreview to include the metadata message
management. Fast start/stop sequences could (and would) eventually
cause the messages to be enabled/disabled out of sequence (or while
the camera wasn't ready for it)

Fixes BACON-173

Change-Id: I367bc45729ce2e858fea972f35e881a755c6021a
Revert "audio: ID3 tags of most chinese songs display messy"

This reverts commit b8c58116a5850b2daf8d9dde91623dd335737635.

This change causes encoding issues if one has files in a non-UTF8
encoding and uses en_US locale. For details, refer to the JIRA ticket.

JIRA: CYAN-3511
Change-Id: I64751297283038b570cce1eec173f3fbc08db83f
libstagefright: stop audio source before deleting AudioPlayer

-audio source won't be stopped during AudioPlayer destruction
 due to start failed and AUDIOPLAYER_STARTED not set
-handle audio source stop in AwesomePlayer if AUDIOPLAYER_STARTED
 not set

Change-Id: I395c045a0a8a5d5b6ea8cc762d6a2636bb885b0e
CRs-Fixed: 704605
libstagefright: fix drainInputBuffers for FlushCompleteEmulation Quirk

Codecs which use the "requires-flush-complete-emulation" require
flushing (draining) the buffers before filling them. The change
"accelerate camera recording start up speed" has changed the order
of filling and draining the buffers which doesn't work well with
the FlushCompleteEmulation quirk

Change-Id: I78193f0aca4a85455393a4cf20d33b919ea6a57e
stagefright: update OMAP3 h264 codec data construction

Changes are based on gingerbread branch and they help improve
video stuttering on OMAP3.

Change-Id: Ic886a4c555c2a7a41204e7a18f38560744b782f6
libstagefright: update OMAP3 support

* Move the OMAP_ENHANCENEMENT flag to make sure that the
  buffer is not modified futher on.
* Don't queue more than 4 buffers to the component. This
  greatly improved the video recording framerates both for
  480P and 720P.

Change-Id: Iacc983214d873099e8f6218f374717a2ae4ffcc8
stagefright: ifdef "libstagefright: Use proper ctts offset"

Causes A/V sync issues or corrupted recordings on NON-QCOM hardware

Change-Id: I8c8625c41936c3ecc9a70f82ddc17e6e66503fd3
stagefright: fix YV12 chroma stride align for Exynos4

Commit 906eba (exynos4: libstragefright: add support for samsung colorformat/omx/mfc)
was supposed to apply YV12 chroma stride align to 16 for the Planar format but was
mistakenly applied for all the other formats.

Source: http://git.insignal.co.kr/samsung/exynos/android/platform/frameworks/base/tree/media/libstagefright/colorconversion/SoftwareRenderer.cpp?h=exynos-ics&id=ede5597dcf8e9626b6a0ecf1a025c1e4bf57411e#n161

Change-Id: Iae0e785a908be8a452f6c5e947cd0175d777165b
Merge remote-tracking branch 'cm/cm-11.0' into kk-mr2