Update overlay quick switch configuration [Disabled]
Fix Qcom Error/Mpeg4 Playback
Add missing includes for threads.h

The missing header was being transitively included through a
Skia header which is being removed.

Change-Id: I5a65bae076027951fe07d1e7eecd4732124fb0e4
frameworks/base: Use NUPLAYER as defult player for m3u URL's.

- Added M3U URL's check and redirect to NUPLAYER.

Change-Id: I2c3446ea8de394a05d81cf4744fe5091e6b19eeb
CRs-Fixed: 327320
libstagefright: Synchronize access to OMX class member variables

- Protect mLiveNodes KeyedVector member variable in freeNode function
- This variable might be accessed concurrently if two OMXNodeInstance objects
  are freed.

(cherry picked from commit 796ea3f006ccac48a1fa1eae904667238c0ebbf6)

Change-Id: I01b12da57f44c1dfa978763c19de0041dc231b2b
CRs-Fixed: 332651
frameworks/base: Fix for jump at the end of the video playback

- At the end of video playback, observing break/jump in video
due to delayed rendering of video frames after audio EOS

- Audioplayer delays the EOS propagation to AwesomePlayer until
all the pending pcm samples are played out even though EOS occurred
at output port. Until EOS sent, awesome player uses AudioPlayer as
time source. But as EOS on Audioplayer side already occurred, timestamp
doesn't get updated. This delays video frame rendering. when all
the pcm samples are played out, EOS is generated by Audio player.
At this point time source switches from Audioplayer to System clock,
forcing video to render pending frames immediately as it finds video
frames are delayed now.

- When AudioPlayer receives EOS from OMXCOdec, signal AwesomePlayer
with postAudioEOS event, which will set the mAudioEOD flag to true.
In onVideoEvent() function, AudioPlayer is set as time source only if
mAudioEOD flag is not set.

CRs-Fixed: 329417
(cherry picked from commit 4141642681c39bad0020974ad8ed1df8e20e5495)

Change-Id: Ie0b43ac6efd2ddf449bd6ead00ad2df50c3eb61a
framework/base: Add wrapper functions in several graphic functions

(cherry picked from commit 94009e5c6bdeb70a9f39e859a07c1a9d19488a41)

Change-Id: I827e7624bc2903d8d77b2fa5d358e871cae6cc14
AwesomePlayer - Check for audio eos event before pausing

 - pausing calls function to cancel all player events
 - in the case when pause is called between the time when an
   audioEOS event is posted and when it is handled, the event
   will be canceled and audioEOS is never acknowledged
 - this fixes the problem by first checking for audio EOS event
   and handling it immediately (rather than using the delay) to mark
   EOS before pausing, waiting based on a condition mAudioStatusCondition

CRs-Fixed: 326000
(cherry picked from commit fc5a9bb31386ee167e4d04d205899fbbac3310cf)

Change-Id: I1775462145466e8017cabf176d0202008239c97b
httplive: Allow seek even though all ts segemnts are downloaded

-Seek was allowed only until all the ts segments are downloaded.
-This causes an issue when audio only content is streamed as it
takes very short time to download all ts segments.
-Change made to allow seek even though all ts segemnts are
downloaded.

Change-Id: I7d541ad4dde661050ca734c557c5da98cae364cc
CRs-Fixed: 333939
(cherry picked from commit bf1344bbe0c16cf6622d1e44b5a94e36fe708dcd)
libstagefright: Flush ASM before closing the stream

- By calling pcm_prepare we can flush the driver and
  dsp so that playback close can issue an eos from kernel

Change-Id: Icb5249ff8c480405b4b8ac5ce5f995ed5d73bf0d
CRs-Fixed: 331532
(cherry picked from commit 8bdfa122ec7ff72f61ea01f932d96d94dc27f016)
libstagefright: Encoder state check before calling OMX_FreeBuffer
Add sanity check for battery capacity range.
libstagefright: Ensure pcm_prepare is called only when routing is
still active.

- LPAPlayer does Derouting, pcm_prepare and pcm_close during pause.
- pcm_prepare should not be called after derouting, as the driver
tries to prepare a session which is already derouted.
- This results in no backend errors in kernel for LPA Front end
session as the backend is already closed with derouting.
- Fix the issue by ensuring pcm_prepare is always called only
routing is still active.

Change-Id: I4b4eef7f9775b6141a5ec9a0eed82ca2f7a5c6d6
CRs-fixed: 341268
Surfaceflinger: Modify setFormat() API to set 3D format

setFormat() API is modified to accept 3D formats from applications.
This change is required for 3D game usecase so each layer can be
marked as 3D and can be sent to overlay for rendering.

(cherry picked from commit 92c0608296717db6582debddb6180b65394efd88)

Change-Id: Ifd2b64cc635d5efe9456311b66c0bd3eb13bd784
Revert "AwesomePlayer - Check for audio eos event before pausing"

-This reverts commit fc5a9bb31386ee167e4d04d205899fbbac3310cf.
-Above commit is not needed as time source has already switched in AwesomePlayer
 the moment audio EOS is posted.
-By reverting this commit, we ensure pause_l called from onBufferUpdate
 does not block indefinitely  on a signal from onCheckAudioStatus

Change-Id: I1669dfea2133312dcd31e878526964c77576505e
CRs-Fixed: 340398
(cherry picked from commit cc5a9846f9b33f09df4e5c073f239c6313c41115)
libstagefright: Add support in LPA for DSP timestamp.

Change-Id: Ie9525b0ab201b9de828a25ef1cd9731567f4610a
CRs-Fixed: 338065
(cherry picked from commit 2457cb32ec93a11e2a95d77557daaf6be0e1529a)
libstagefright: Secure o/p buffers only when i/p buffers are secure

ION allocation fails on o/p buffers when i/p buffers are not secure. Disabling
secure allocation of o/p buffers when i/p buffers are not secure.

(cherry picked from commit ea10201ece24a3c61b79202b93e440eddb624d65)

Change-Id: I329c8428d3e528f7d177a64b8605090357f34035
CRs-Fixed: 336727
stagefright aacenc: Avoid a division by zero

In rare cases, the result of normFactor * (*psfbNActiveLines)
could be zero, leading to a division by zero in pow2_xy.

In these cases, normFactor was INT_MIN, and if *psfbNActiveLines
was 2, the product was zero.

normFactor being INT_MIN is a bug in itself though.

Change-Id: Ib31bf02889615a7be3bd1bc028da8a7651a8dbee
stagefright aacenc: Avoid overflows when calculating normFactor

normFactor is calculated using the saturating L_add function,
but if the value added (*psfbPeFactors) is negative, the sum
can end up negative.

*psfbPeFactors can end up negative if redThrExp is less than
*psfbNActiveLines.

In cases where *psfbPeFactors ended up negative, normFactor
became INT_MIN, causing division by zero later.

Change-Id: I00c852e457b22f7eef4d6ed1887629828057206b
stagefright amrwbenc: Simplify the definition of static_vo

For GCC, all of inline, __inline and __inline__ work fine.
For MSVC, only __inline works. (__inline should also be accepted
by RVCT.)

Change-Id: Ifbb1c848b200a8c4080624a3d3bd8b6ee498edb2