Add LG camera HAL parameters

Change-Id: I0a1d8c4216654abeb3de9882637ad15bc9c23dc9
libmedia: Featurize QCOM's VOIP feature

 * Not all targets will support this.

Change-Id: I89a444c9ac8be3dfcaeedb599179e31383fdfec2
audioflinger: Fix for race conditions in direct audio track

-Issue: Mediaserver crash is observed in direct track functions.
-Rootcause: Between write and flush functions, write and destructor
effectpool buffers are accessed without any synchronization that
might lead to operations on null buffers and cause crash.
-Fix: Use mEffectLock to synchronize access of effectpool buffers.

CRs-Fixed: 515107
cherrypicked from Ib071361c65b390f9486c0a080a9391f176392b30

Change-Id: Id9e14a054d699ec803e23619ef475696b0021d4f
Camera: Fix deadlock due to mLock in pcb and takepicture

In non-zsl case of takepicture, we do streamoff for preview
stream which is waiting on preview callback thread to exit.
By that time the lock has already been acquired by takePicture.
So preivew callback will not exit until it acquires lock and
takePicture cannot continue until PCB call back is returned.
Fix: Avoid the mLock at services when both Preview cb &
Compressed cb are enabled.

Change-Id: I61ffa60af34a3fc19b8f45c119535243b53c7d3c
Camera: Disable TakePicture related messages in stopPreview,stopRecording

This change fixes the race condition and avoid the deadlock
in abnormal snapshot stop I.e, Observed DeadLock when Data
or Notify Callbacks is sent to App after StopPreview is
triggered and so disabling the corresponding take picture messages.

Change-Id: Ifc20e495091c75cc718c24d29db3334fbf7ceb07
audioflinger: Fix to prevent deadlock in AudioEffects

-Write is blocked waiting for effect chain lock and this causes
decoder thread to wait indefintely.
-Sometimes it is observed that effectschain is locked before
mLPAEffectChain is initialized and but unlocking is skipped if
mLPAEffectChain is initialized in between.Due to this LPA
silence and framework reboot issues are observed as
applyEffectsOn() cannot acquire lock to progress further.
-Use flag to check if all effects have been locked and unlock
accordingly to prevent the deadlock scenario.

Change-Id: Iaedb03c05406e79ef0eadbf2ae4681ba9fe0f3c3
CRs-Fixed: 524759

Conflicts:
	services/audioflinger/Threads.cpp
libstagefright: Reset the decoder while performing seek

-Observed noise when seeking to beginning of file for the recorded
AMR clip.
-While performing seek, the AMR decoder states are not being reset.
In AMR decoder, the current frame output is predicted using the states
from previous frame. If these states are not cleared, it might cause
noise when seek is performed.
-Fixed by resetting the decoder when seek is issued and port flush
completion is notified to the decoder.

CRs-Fixed: 500851
Change-Id: Ia8480b88521abc09c8b01d6052df4730a0359518
LPAPlayer: Update condition to ignore seek

- Reject seek if the new seek time is greater than the current
  position and within an empirical limit (default 60ms).
- This limit must be measured for each target. CRs-Fixed: 453067

Change-Id: I4eec9c139a261c9e246986a74f25114d24987547
audioflinger: Use channel count for buffer size calculation

- For VOIP(hangout) usecase, when the ringtone is played,
  application sets flag as VOIP and the channel as stereo.
  But , on the server (audioflinger) side , the channel
  was always considered as MONO. This was leading to a
  corruption of the Cblk.
- Added changes to consider channel count in allocating the
  buffer size.

CRs-Fixed: 523984 522525

Change-Id: I160d7cf7855161efa201a86846aec67cb24d35dd
Merge "libmedia: Featurize QCOM's VOIP feature" into jb4.3
Merge "audioflinger: Fix for race conditions in direct audio track" into jb4.3
Merge "Camera: Fix deadlock due to mLock in pcb and takepicture" into jb4.3
Merge "Camera: Disable TakePicture related messages in stopPreview,stopRecording" into jb4.3
Merge "audioflinger: Fix to prevent deadlock in AudioEffects" into jb4.3
Merge "libstagefright: Reset the decoder while performing seek" into jb4.3
Merge "LPAPlayer: Update condition to ignore seek" into jb4.3
Merge "audioflinger: Use channel count for buffer size calculation" into jb4.3
Movie studio: fix a memory leak issue in the AOSP code

It's an android defect, connect()/disconnect() of OMXClient need be called in a pair,
if miss calling disconnect() while connect() is called, a memory leak will happen.

Change-Id: I9acc19242faa5c981bb77caba52170e0f96dbf96
Orig-Change-Id: I0fa40422aa54dc97dadd850e8a4cb5a9697cb685
Signed-off-by: Gu, Wangyi <wangyi.gu@intel.com>
Signed-off-by: Dan Liang <dan.liang@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 80150
Merge remote-tracking branch 'slim/jb4.3'; commit 'HEAD' into HEAD