libstagefright: Increase LPA buffer size to 512 MB and reduce buffer count to 2

Change-Id: I3164199c4cec6de384aceeee0a1d2f6c426e0e0f
libstagefright: Add flush in reset during LPA playback

-If next operation is performed during LPA playback, delay is
observed before moving to next clip.
-Flush in reset happens only when playback is paused.
-Remove pause check to avoid delay and flush in cases where
next clip has been selected.

Change-Id: I561d83f70ef391f14bdb52bb8a6ee075e31e9531
CRs-Fixed: 395477
libstagefright: Fix for crash during lpa playback

-During lpa playback, flush() is not issued if mReachedOutputEOS
is true. This prevents flush reaching to HAL even during pause
state and causes crash.
-Issue flush() in all cases as these checks are handled in HAL.

Change-Id: I0029c851ba6a029afc01e6a30620b071f9828665
libstagefright: Avoid flush if LPA playback is not routed

-On a previously closed LPA playback due to pausetimeout, if
reset is called flush is issued on closed sink leading to crash.
-Check if audio is routed before calling flush to avoid such
issues.

Change-Id: Iec24d063425b0a0017adcf0b3a576fbea0d8ef25
libstagefright: Deregister audio flinger client during LPA session close

-Mediaserver crash is observed during BT disconnect.
-Audioflinger client registered during lpa playback is never
 deregistered.
-Fix this by deregistering audioflinger client during LPA
 session close.

CRs-Fixed: 407397
(cherry picked from commit d36aeb2d863a0ba42f45dbb59cd144dbf2c62cd6)

Change-Id: I19ef959a3d35476b4689e6c917a0cf6ccb4ffa78
libstagefright: Add support for TCXO shutdown

-Add support for onPauseTimeout to close the Audio path after
3sec of pause. This allows TCXO shudown to happen.

Change-Id: I747edf146475df8c828294f01ffe38aba5a3eccf
libstagefright: Detect defers-output-buffer-allocation quirk

Change-Id: I6e4c89e8d491db6a9e67c986b5efdbd19165782d
audioflinger: Initialize effectspool buffer size during allocation

-Crashes are observed during start of lpa playback with effects
enabled.
-Effectspool buffer size is invalid before initial two writes. If
effectsthread tries to access these buffers in such invalid state
it leads to crash.
-Initialize buffer size to 0 during effectspool buffer allocation.

CRs-Fixed: 415067
(cherry picked from commit 36591e0b53d869320d2a78b2f3c7f43924cb78b3)

Change-Id: I2616cfbfe914448e6489837f5d8686a8def7a883
Frameworks/av: Fix for mediaserver crash in AudioFlinger

- UI freeze is observed while playing LPA clips with sound effects.
- While moving to next clip, effect process is still applying
  effects on last buffers. Meanwhile de-allocating the local buffers
  in DirectAudioTrack destructor on which effects are currently
  applying. Due to this crash is observed in effect process.
- De-allocate buffers once the effects thread is killed.

Change-Id: I67431f298b8da114db60de5cc27376d9ddce7da5
CRs-Fixed: 416093
Add KEY_SUPPORTED_CAF and KEY_CAF camera parameters

Needed by TouchPad's froyo libcamera to work

Change-Id: If303b90443c27216b4706bbecbb49564efe5fd9c
libstagefright: Unbreak OMAP4 encoders

The "manual" construction of the h264 codec data is only needed
on OMAP3. Execution of this code on OMAP4 breaks the mpeg4 header
generation

Change-Id: I3ae52f2e685e2d9097796685c98dffa93cfa6430
Merge "libstagefright: Unbreak OMAP4 encoders" into jellybean
Merge remote-tracking branch 'cyanogen/jellybean' into jellybean

* cyanogen/jellybean:
  libstagefright: Unbreak OMAP4 encoders
  Add KEY_SUPPORTED_CAF and KEY_CAF camera parameters
  Frameworks/av: Fix for mediaserver crash in AudioFlinger
  audioflinger: Initialize effectspool buffer size during allocation
  libstagefright: Detect defers-output-buffer-allocation quirk
  libstagefright: Add support for TCXO shutdown
  libstagefright: Deregister audio flinger client during LPA session close
  libstagefright: Avoid flush if LPA playback is not routed
  libstagefright: Fix for crash during lpa playback
  libstagefright: Add flush in reset during LPA playback
  libstagefright: Increase LPA buffer size to 512 MB and reduce buffer count to 2

Conflicts:
	media/libstagefright/OMXCodec.cpp