Camera2/3: Fix deadlock when starting recording before preview.

Move 3A notification synthesis for HAL3 devices from
Camera3Device::processCaptureResult to Camera2Client's
FrameProcessor. This will ensure that calls to processCaptureResult
from HAL can never block on Camera2Client internal mutexes.

Bug: 9923891
Change-Id: I5184649bf45c0807babe6b8c0e1239e959cd3480
libstagefright: support for disabling buffer metadata

- Metada mode video recording is enabled by default.
- use setprop debug.camcorder.disablemeta 1 to disable metadata mode recording.

Change-Id: I422c49c0ace0c3a3e1f4459c7e4bf29e70af763a
Add LG camera HAL parameters

Change-Id: I0a1d8c4216654abeb3de9882637ad15bc9c23dc9
libstagefright: Add support for custom LPA buffer size

 * On msm8930, during playback over A2DP with DSP Manager effects enabled,
   there's a lot of stuttering with the default buffer size. Stock kernel
   used a buffer size of 32, but that caused no audio at all in CM because
   of mismatch in buffer size between kernel and user space. So up until
   now I've been using a buffer size of 256 to get audio working at all,
   but unfortunately it causes stuttering as mentioned. Hence add support
   for a custom buffer size so we can revert to stock value used in kernel,
   and enjoy no stuttering.

Change-Id: Id4d090bc6cf90782c24f3832a35ddeca43bd72fc
Added ifndef ICS_AUDIO_BLOB around non-existent functions (3/3)

For older audio blobs where is_source_active and is_stream_active_remotely
doesn't exist, receiving a notification and dumpsys crashes the audio service.

Change-Id: I554f00ba7f171d2ea91627cae2281623383b3ca7
libstagefright: optimize thumbnail generation path

- Checking for YUV420SP format support is not intended for software
  decoders and can be skipped. This avoids unnecessary creation of
  hardware decoders for checking supported output formats.
- Change the flag from kPreferSoftwareCodecs to kSoftwareCodecsOnly.
  This will force software codecs to be tried first and not just "prefer"
  which helps when a software codec for a particular type of codec (like
  divx) doesn't exist and avods creation of hardware codecs twice in case
  of hardware failure.

Change-Id: I682bca5b6bac5a56f46fe3655cd722fe5f08e1e6
audio: fix for deadlock issue during LPA playback

EffectModule::setEnable for LPA playback was modified to lock
AudioFligner::mLock with EffectModule::mLock held.
And at the same time ~DirectAudioTrack is trying to lock
EffectModule::mLock with AudioFlinger::mLock held and this
results in deadlock.
Fix this issue by reverting previous change and acquire
locks in certain sequence to avoid deadlock in setEnabled_l

Change-Id: Iea74eb3591a728275c655074a4d2017bd38f99ab
libstagefright: Add pause support for hardware omx component

-ADSP doesn't enter sleep state after wma playback is paused
and power suspended.
-No support for NT session pause in case of hardware component.
NT session need to be paused to put ADSP into power collapse.
-Add support of pause in stagefright to ensure device enters
suspend mode. Also add intermediate states to avoid concurrency
issues between read and pause.

Change-Id: I87b0992f3d4d580c3a68d27fbed6b65d2200dda9
CRs-Fixed: 496256
Merge "libstagefright: support for disabling buffer metadata" into cm-10.2
Merge "libstagefright: Add support for custom LPA buffer size" into cm-10.2
Merge changes I87b0992f,Iea74eb35,I682bca5b into cm-10.2

* changes:
  libstagefright: Add pause support for hardware omx component
  audio: fix for deadlock issue during LPA playback
  libstagefright: optimize thumbnail generation path
Merge tag 'android-4.3_r3.1' of https://android.googlesource.com/platform/frameworks/av into cm-10.2

Android 4.3 Release 3.1
Enable Tunnel Playback for msm8974

Change-Id: I3ca4e06f74a4e994cedaba16df3bd9b20c95bac7
cleanup media variant ifdef

Change-Id: Iedc6cfcaa6706c6614a638cede7fd560d104d8a2
Enable LPA/Tunnel audio for QCOM B-Family

Change-Id: If17b40ade698bbbccd28728bf65d8fdc3758d306
Merge "Enable Tunnel Playback for msm8974" into cm-10.2
Merge "Added ifndef ICS_AUDIO_BLOB around non-existent functions (3/3)" into cm-10.2
Add camera parameters for htc evo 3D. (1/2)

Use BOARD_HTC_3D_SUPPORT to enable.

Change-Id: I28fa3f1586071bcc78b8e887bbbf699d338a0ceb
audioflinger: Fix delay in enabling effect for LPA

 - Enable/disable of effects for LPA is taking time
 - Enable notification is not sent to effects thread till
   configure is called on each effect with isForLPA flag
   set to true, this happens only when applyEffcts is
   called in write of directoutput thread, so till that time
   effects are not applied and there is a delay in effects
   getting applied.
 - Insted of checking effcts LPA flag check the effectchain's
   LPA flag while sending notification to effects thread

Change-Id: I8d7559a60e5c6769d72022517daa05c84df54885
CRs-Fixed: 525510
audioflinger: Fix pops in LPA while effects are applied

 -Issue: LPA playback while effect are applied, has pops/noise
  as below scenarios
  1) LPA Playback + taking snapshot with camera
  2) LPA Playback + changing media volume from settings app
  3) LPA plaback after non-LPA playback
 -Rootcause:Effects meant for LPA are getting applied in
  normal playback path
 -Fix: In threadloop of mixerthread if current effect
  chain is equal to LPAeffectchain, don't apply effects.

CRs-Fixed: 526799

Change-Id: Ic255ef2db81545abd119633e8fc6a7bae5d2f38c