audioflinger: exchange AUDIO_SOURCE_HOTWORD with AUDIO_SOURCE_VOICE_RECOGNITION for pre-kitkat blobs.

Change-Id: I6241cf6667c97dfd7fb1c238b1fbadea5cdb863e
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
Merge "audioflinger: exchange AUDIO_SOURCE_HOTWORD with AUDIO_SOURCE_VOICE_RECOGNITION for pre-kitkat blobs." into cm-11.0
Revert "libstagefright: Keep LOOPING/AUTO_LOOPING flag during teardown"

This reverts commit 9a59488dae2c70ab0c55cda7721824ca1a71340d.

Change-Id: I9af6fe9f2086cfe17f55b214d5093d7acece791c
stagefright: Set bit_width if ENABLE_AV_ENHANCEMENTS is defined

the compiler failed with error "has no member named bit_width" because bit_width is set only ifdef ENABLE_AV_ENHANCEMENTS

https://github.com/CyanogenMod/android_frameworks_av/blob/cm-11.0/media/libstagefright/AudioPlayer.cpp#L228

Change-Id: I931879f09164482fc09e53a4135d88537b05c7ff
libstagefright: refactor Legacy LPA makefile

  - add in msm7x27a
  - remove unused USE_LPA_MODE flag

Change-Id: I9e8d9376e1cfbd37e6457c0fd8e6252848f6b24d
libstagefright: Enable meta mode for 7x27a video encoder

msm7627a family of chipsets supports only one input frame at
one time. camera expects the input frame to be released before
sending another frame. so send one input buffer and available
output bufefrs to video encoder component. Release the input
buffer to camera (to get another frame) after receiving input
frame done callback from video encoder component.

Change-Id: I8fbc911f046ff7e2a3047dd65d8c09ac2d8608e2
libstagefright: Add support for custom LPA buffer size in legacy LPAPlayer

     - on msm7x27a with bootloader heap for lpa audio during audio playback with,
       DSP Manager effects enabled there is a lot of stuttering with the default buffer size.
       with bl heap we need buffer size of 480, but that breaks audio at in cm. So we have,
       to use buffer size of 512 to get audio working but it makes stuttering as mentioned.
       so add support for a custom buffer size so we can use 480 buffer size.

Change-Id: Ib4b5222b4b64d42288e0ad5c95910e385d172374
Revert "audio:Avoid AudioTrackThread if Track creation fails"

This reverts commit b96f07930159ebbdcd44645ac62604ff6cbddfc7.

Change-Id: Iae20ed1c59a206450b3de18118b1b9c4a8a469c5
audioflinger: only exchange AUDIO_SOURCE_HOTWORD when using pre-kitkat audio-policy

Change-Id: I46bb3074484853682c75ddc417e77b6ae846136c
Revert "Fix decoder EOS handling"

 * This is causing carnage for apps and games which make assumptions
   about the (bad) behavior of EOS handling. While this patch makes
   it consistent across the board, let's stay bug-for-bug compatible.
 * L is going to break a lot of shit :(

This reverts commit ff9a42d3c4460714dcb963f1a9f22f06a8f7fc8d.

Change-Id: Iab33edf64f5ec02e4391713e2bd0630ea056b3fd
Merge "Revert "Fix decoder EOS handling"" into cm-11.0
ENGR00294739 coreimage, screenrecord sometimes fail when shift different video

The recorder exit because can't request encoder buffer. In this case,
sample table is not written to the mp4 file, so can't play.
Make sure the sample table is written can fix it.

Change-Id: Ia38e28d4a9a10a70bb352b03dd17a62d090c9ad4
stagefright: Move to 64 available tracks

Many games use numerous tracks.  If the system
runs out of tracks, new tracks won't be able
to be created.  This has been causing notifications
not to play if many apps are holding open tracks.

Issue: BACON-6

Change-Id: I9cea51b9bd678feba31a88e17dd22083b01d81de