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

Change-Id: I6241cf6667c97dfd7fb1c238b1fbadea5cdb863e
Fix some merge derps

Change-Id: Id9a5c09cd70f33f06da6be6917ffd51322961673
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
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
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
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
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: Add flag for enabling enhanced offload support

 * Some devices might not use the QCOM_HARDWARE flag, but still
   want to get the improved audio offload support.
 * Add TARGET_ENABLE_OFFLOAD_ENHANCEMENTS to enable support for
   PCM offload and 24-bit playback with no extra dependencies.

Change-Id: Ie1a92602c6c0cd59008db8dbf72125eecef08e85
av: media: Add audio/qti-flac MIME type definition

Change-Id: Ie52fd6696cc5efa6aaff20ea56c43615467e2649
audioflinger: decline track to be offloaded if there's active one

-If multiple offload tracks are activated at the same time,
 status of the tracks can be affected by each other and results
 in unexpected behavior
-Deny subsequent track to be offloaded and fall back to sw decoder
 if there's already actived one

Change-Id: Idaa9213d54b9bcdd0e5c25c1dec516d994ae006f
CRs-Fixed: 704382
frameworks/av: Avoid timestamp query to AudioPlayer during reset

-Timestamp query while in reset leads to ANR in few cases.
-Destruction of mutex in AudioTrack destructor during reset and
trying to lock the destroyed mutex as part of getPosition() call
in parallel leads to ANR.
-Avoid querying for timestamp in case reset operation is in progress.
Instead use mAudioTearDownPosition to retrieve current playback
position.

Change-Id: Ifaa7f6236ebce1b27a0cca621bbb188c94af142d
audio: Update timestamp for offload playback after EOS.

- After EOS of offload playback,audioplayer was not
  updating the timestamp.
- Query the HAL for the last rendered timestamp when
  HAL sends EOS notification.

Change-Id: Ifa25e0a9a1a245cc74c92294ab0a322db0ab4bec
stagefright: Fix NULL pointer access issues

Fix NULL pointer access issues in stagefright & move printFileName
to ExtendedUtils.

CRs-Fixed: 694900
Change-Id: I390f692b72fcb40e31a095abbb412afebde0a64f
stagefright: Fix compilation when ! ENABLE_AV_ENHANCEMENTS

Change-Id: I1418b563dcbb0a4709e64e406dd09a98947759d7
MatroskaExtractor: Letting the error be correctly handled

Do not blow up when parsing the header fails (like, say, a
corrupt or zero-byte file) and let the error handling that's
already in place exit the extractor cleanly

Change-Id: I457574d4279efdd3a08e159e755b563d6d98fbc6