libstagefright: bring back mistakenly removed codec quirks

http://review.cyanogenmod.org/#/c/59396/ has mistakenly removed
3 of the codec quirks that are required for certain audio codecs
on OMAP3.

https://github.com/CyanogenMod/android_device_lge_p970/blob/cm-10.1/configs/media_codecs.xml#L28

The implementation of the quirks are still in the upstream code
and they have nothing to do with Legacy HTC.

Change-Id: I2d47bc9cbb451675c5bac6e725c59b367ff458dc
libstagefright: Set initial buffer size for H264 codec

For Google h264 decoder, the input port buffer size is
set to 8192 bytes, and for usecases where data source
does not specify input buffer size, there is a crash on
assert when the buffer size is larger than 8192 bytes.

Added change to set input buffer size for H264 to 80k.

Change-Id: I5bc177cc5078b2acfc930ee2746960dc26ab9662
stagefright: OMXCodec: free allocated port-buffers if init fails

If an error is encountered while allocating port buffers, init
would fail and buffers already allocated would not be freed.
Move OMXCodec to ERROR state and explicitly stop omx component,
hence forcing free-ing up of allocated buffers.
Also defer setting port-status to ENABLED only after having
moved the component to IDLE and add graphicBuffer to port-
buffers-list only if setBuffer is successful.

Change-Id: I54ffb2a299376bf1716473e94948c36648d24b92
CRs-Fixed: 610702
NuPlayer: Fix parsing RTSP play response from special server

- In some non-standard server, a different play response will be returned,
  which will cause CHECK failure
- Change in parsePlayResponse(), to get the current track index

Change-Id: I467e3000732cf1506095b17dc29eed25e6701150
CRs-Fixed: 621854
stagefright: Omit audio from timelapse recording use-case

Timelapse recording is only valid for video encoding, but audio
is subjected to the same infinite wait. This can result in an ANR
if encoded data is not being produced. Only wait forever in video
use cases.

Change-Id: I37d34c2235d110dc8954b66d830891fdccc50c0c
Camera: Remove merge artifact

Change-Id: I5817d9f2a9410ef6ba4f5f0242406b410afbf0be
Camera: Avoid redefinition of ISO params

Change-Id: I5f283f6d3affb35ef6a24f00fdaac0ca8aa348ba
disable camera sounds (3/3)

Change-Id: Iff4eb5ca7dd13038bf852a76d0c605814864497a
Signed-off-by: Jonathan Steadman <xxwhitehawk@gmail.com>
screenrecord: Add audio support

Adds audio recording to the screenrecord system. Note that
while recording, the audio is muted from the device output,
and that the audio volume is controlled separately (so make
sure to turn up your volume if you hear nothing).
Audio from the microphone can also be recorded by adding
--microphone to the command line.

Change-Id: I97dfcaf3d93b786c5466e1f4215549e3d015bcf0
screenrecord: Enable SUBMIX_IN as well and cleanup on exit

While on Nexus 5/Nexus 7 (AOSP QCOM audio), trying to turn on
SUBMIX_IN fails and is not needed, it is required on Find 5
and N1 (CAF QCOM audio), or otherwise SUBMIX_OUT won't turn
on.
We also now release the audio routing as it wouldn't revive
the audio speakers otherwise.

Change-Id: I0f80a232304733e0b0a834b188b8cfa5b88915f3