Revert "appop: reimplement OP_RECORD_AUDIO op check in mediaserver"

 * This breaks various applications which use the effects API, like
   visualizers.

This reverts commit eb48405109a6a2d2a1d9cb2aaac36e5c71bb5f5b.

Change-Id: I7993aaff67a0aa5f815cc42d3670f3397d7582ac
libstagefright: Decrease reference count before deleting AudioPlayer

-Reference count of AudioSource is not decreased to 1 before deleting
 AudioPlayer, and thus cause the thread blocked in an infinite loop
 due to the AudioSource object is not deleted
-Decrease the strong reference value of AudioSource before
 deleting AudioPlayer

Change-Id: I804211dcca91213c62a4d622baf2001f3cc9955b
CRs-Fixed: 691668
RTSP: Correct the data type in the check

The check for a race condition in RTSP flush has a mismatch
in its data type.
UNKNOWN_ERROR is used as a positive value and isn't equal to
the return value of feedMoreTSData().
Typecast it to fix this mismatch.

Change-Id: Ib8a88af13e5b43f5802052cb8a956c2f391e73b3
HLS: Queue discontinuity only for the first block

If a segment jump happens in HLS, the discontinuity gets
queued for every block read. This leads to continuous decoder
flushes and is observed as a long video freeze.

Changes done to queue the discontinuity only for the first block
after segment jump.

CRs-Fixed: 696452

Change-Id: I79409fe552611fcf3cb6ea9cbc76c8d4f9f5541f
midi audio: allow midi restart even upon stop state

Due to the limitation of EAS_XXX interfaces design, there's no way to
restart midi playback again once last track reaches EOS. To allow this
operation, seek the current track backwards and resume again.

Change-Id: Ib93993eb18e309ac7cb2a305d55ab63f2e86acb9
stagefright: Fix offload fallback for 24bit

Change I398d964a3c5b18f58fcc79376bc29222e796badc disables 24bit
playback on non-offloadable tracks, but tries to read the format
after clear()ing the audio source. Fix the operation order to
do the disable before resetting the source.

Change-Id: Idbbd5e21f9e8fc357a494fabe9028331ebfd2ac4
stagefright: Improve 24-bit support

 * Cleanup and fixes to allow FFMPEG codecs to output raw 24-bit PCM

Change-Id: Ideeb7cd7c6340f8054f99272796032939b561f81
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