libstagefright: ExtendedCodec for ACodec usage

 - this adds support of ExtendedCodec for using ACodec
 - adds extended CSD support on both NuPlayerDecoder
   and MediaCodec
 - arbitrary mode is made default for ACodec
Change-Id: Id046b0d4bf96f029c1b6b5d78d753073e38ac841
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
libstagefright: adjust AV sync late margin based on property

- Current AV late margin is 40 ms
- Read system property media.sf.set.late.margin and if
  new AV sync late margin is set then use the same
- Max AV sync late margin allowed is 250 ms
- Min AV sync late margin is default 40 ms

Change-Id: I65cd3dce9b31b87f1488c37af9618669b29c362c
framework/av: Reduce LPA bufsize as to 128KB to save power for SA+

Root cause: SA+ bassboost takes more than two times the MIPS as NXP,
which causes normalized CPU load burst when AP is running, then firing
up 2nd core and consume more power unexpectedly.

Fix: Reducing the LPA buffer size from 256KB to 128KB will decrease the
MIPS required for each round of effect process and keeps the 2nd core
offline.

Change-Id: Ib1982dd2a7544c82971bf6b74ebc58216d247e77
Merge "audioflinger: Fix pops in LPA while effects are applied"
Merge "audioflinger: Fix pops in LPA while effects are applied"
Merge "Merge "audioflinger: Fix pops in LPA while effects are applied""
Merge "audioflinger: Fix pops in LPA while effects are applied"
Merge "Merge "Merge "audioflinger: Fix pops in LPA while effects are applied"""
Adding aec ns feature in audio_effects.conf

- Adding support for aec and ns support

Change-Id: Ic3cb6aecbe4862b27bcd9604d9118ef8c39d3da0
Merge "audioflinger: Fix pops in LPA while effects are applied"
Merge "libstagefright: adjust AV sync late margin based on property"
libstagefright: Reduce redundant logging

Modify the redundant logging to verbose level

Change-Id: Ib54217028f3a9ee3401791209e101938ca821565
Merge "libstagefright: ExtendedCodec for ACodec usage"
libstagefright: fix metadata key sizes

 - some wma metadata keys should be treated as 32 bit keys instead
   of 64 bits.
 - fixes wma lossless from failing

Change-Id: Ic6af8392aea6a1bd8810dac59e1d1c27c21c4059
frameworks/av: Fix a/v sync issue for playback over BT

-Audio and video are out of sync when a video is played/streamed
with a BT headset connected to the target.
-AudioTrack does not consider the BT latency.
-Latency of the BT stream added to the existing latency.

-query for tunnel mode latency
-During tunnel playback, we need to offset latency for audio plaback
 on BT devices by querying BT HAL.

Change-Id: I3142d8d70f1adaa6e7f5e37c812b13f69a84282a
libstagefright:OMXCodec:add QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m

--Qcom encoder component has used the
  QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m as the Qcom aligned YUV420SP
  format type.
  Add this format in related functions which determine the supported
  formats to avoid crash in these functions.

CRs-Fixed: 530956

Change-Id: Ifee4b5553d2900c1c61087f0947a288322c421ba
Merge "libstagefright: fix metadata key sizes"
frameworks/av: Fixed framecount in AudioRecord

- Incorrect frameCount is passed to AudioRecordClientProxy,
  which is used while user side pointer is incremented
  This is causing distortion in SIP call
- Fix is to use frameCount of the shared block instead of
  frameCount passed by the client
- InputBytes initialization is also done in AudioFlinger

Change-Id: I4470be49c44e0c86c8a6262f57cabbc609c32045
Crs-fixed:  525315
ExtendedCodec: Enable timestamp reordering for MPEG4 codec type clips

MPEG4 codec type video clips can contain B frames. This change will
enable timestamp reordering for all MPEG4 codec type clips

CRs-Fixed: 539036

Change-Id: I7682a3781e6aa1b8e73418e4e73ee266c6338770