libstagefright: back off exynos4 hacks

Change-Id: I953f502171bc98854b5d59165057c57b3c65cdaa

(cherry picked from commit 15dea23fd7bb62070fbf9b5f0d4e8d7baf549e20)
libstagefright: align YV12 for software codecs on exynos4

YV12 chroma stide should be aligned to 16 according to the
android framework. But, GSC & Mali couldn't accept a seperate
stride for U & V components. They just use Y_stride/2 as a
UV Stride.

Change-Id: Ibeeb3439ee10a4666420e5fa34ff0a6d6ea7c003

(cherry picked from commit 5fb467b6e9e3c84402bc51060578737e6f93eafb)
libstagefright: fix YV12 stride for software codecs on exynos4

Change-Id: I3612899d2bffa474eb6447788858911757a7f45d

(cherry picked from commit d4a2d811b45bb8e6a82b75690db6fb9bf01e1124)
omx: exynos4: bring inline with jellybean

Change-Id: Ic275fd30a721f8161dcc44c2706b86ab5ea213ba

(cherry picked from commit 55e817fdf6855d54a7bee3c36f92c6f8b7fc0a2a)
Fix overload of SoftVideoDecoderOMXComponent::updatePortDefinitions

An overloaded function should take the same parameters as the function
it is overloading.

Change-Id: I8327fe1b363917515cf76c8f76bdbc05b2c0fbf0
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>

(cherry picked from commit 7d5926b0736ff717f4ccea5c124cf885f46d57de)
MPEG4Writer: fix mMoovBoxBuffer memory leak

In some cirumstances the writing of the moov box
leaks memory since mMoovBoxBuffer is not freed.

Change-Id: I441360f6c7e84e31fea06067eca98b66b86b54bc

(cherry picked from commit 9708b718c9466654d73b955f0b1b71468c6e7e05)
Prevent ANR when AudioTrack is paused or re-routed

If ClientProxy was interrupted by AudioTrack::pause() just before futex syscall() in obtainBuffer() was called,
It will not call releaseBuffer to wake up AudioTrackThread.
It puts the AudioTrackThread to sleep and then a deadlock occurs.

In this case, CBLK_INTERRUPT flags can't prevent a deadlock,
so this patch set mFutex to FUTEX_WAKE during interrupt() to avoid deadlock.

A similar problem could occur due to re-route or recovery after mediaserver death.

Bug: 18641665
Change-Id: I66fcae43af9a91eb55f6cdb52c644ee6c0999772

(cherry picked from commit af86753df8661e90a0fc4e8116ebd790569e9890)
Fix AAC recording issue

Fix uninitialized variable that caused ADTS recording to incorrectly
specify LTP object in the header.

Bug: 17895547
Change-Id: I75650f4963f4f371cd191bc635e32c9ab17fa8c9

(cherry picked from commit f0c8c1a2d613ce1bae81b033cc811c4bd5031e59)
Truncate file before recording into it.

Recording into an existing file of non-zero length could leave old
data in the file after the recording ends. Best case that wastes
space, worst case it results in a file that's considered corrupt
on playback.

Change-Id: I2c77a107603b2b36790958360ff0856c2b28d677

(cherry picked from commit ddbbd5b10c97d5084fc4b3e38aa15e0373ee9e82)
Correctly handle unsupported OMX color format

MediaServer was caught in an infinite loop at OMX::getParameter.

OMX::getParameter returns status_t, using OMX_ErrorNoMore to loop
until the index passes beyond the last supported format
will not work since this function only returns ERROR_UNSUPPORTED.

Change-Id: Idde94a46af24641c0e5f1db909335db4c7e2b7f7

(cherry picked from commit 83d0c2493678ad3c4e8831697fd2e256da807925)