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
libstagefright: support media-legacy usage

Change-Id: Ibcac0333ed4f79d71b38c26eba8cc665f2532cd0
libmediaplayerservice: fix for media-legacy usage

Change-Id: Idc6b0d9e976ece23d73ef81cebf72c4e6905647a
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
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 changes Idc6b0d9e,Ibcac0333 into jb4.3

* changes:
  libmediaplayerservice: fix for media-legacy usage
  libstagefright: support media-legacy usage
cleanup media variant ifdef

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

Change-Id: If17b40ade698bbbccd28728bf65d8fdc3758d306
Enable Tunnel Playback for msm8974

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

Change-Id: I6e8c153e36e09451a69e9c3f8a52782f09b5d5d1
Merge "libstagefright: support for disabling buffer metadata" into jb4.3
Merge "Added ifndef ICS_AUDIO_BLOB around non-existent functions (3/3)" into jb4.3
Merge "cleanup media variant ifdef" into jb4.3
Merge "Enable LPA/Tunnel audio for QCOM B-Family" into jb4.3
Merge "Enable Tunnel Playback for msm8974" into jb4.3
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
audioflinger: Add missing code for FM volume

 * If we used a proper MR2 audio HAL, this wouldn't be needed,
   but building FM support with the hacked up MR1 audio HAL we
   uses fails miserably. Adding this back fixes that.

Change-Id: If2f6ee9e417732eaf4df8718bf73b2dfd1062011