libstagefright: Collection of fixes for TunnelPlayer

-Handling of EOS, and triggering EOS was wrong
in TunnelPlayer. Seeking when EOS was posted
to the HAL was wrong. EOS should
not be posted till seek is complete
-Also, EOS should not be posted to
the app if we are seeking
-Player should wake up when seeked,
even after EOS was posted from player
to HAL
-Fixed this issue by cleaning up the code for EOS
-Disable tunnel mode playback for streaming use cases
 to avoid jittery playback

Change-Id: I21699d2d5874bde6cbfe549ce0251b252e9a4090
CRs-Fixed: 433346
CRs-Fixed: 432233
CRs-Fixed: 429868

libstagefright: Add new mime for QC TS container

- Add new mime type for TS container that is sniffed by extended
  extractor. This is needed for media extractor to determine which
  parser to create.

Change-Id: I18dcebbbf3b31cea7db29a4dd65385638343bec1

libstagefright: Use software decoder for ADTS content.

Use software decoder for widevine content which uses ADTS
format.

CRs-fixed: 431096
(cherry picked from commit 3edf2e703bcdc47f122864865056d5cb65b7ab43)

Change-Id: I50eba673ddd6ec2bbb737577978e61902ff68d13

audioflinger: Fix to release wakelock after closeoutput

-In DirectTrack destructor, closeOutput is called after
releaseWakelock is done. This may sometimes result in
power collapse happening even before actual close
sequence of Audio path is completed and will result
in high power consumption.
-Release wakelock only after closeOutput is done
in directtrack destructor.

CRs-fixed: 438179
Change-Id: Ibe103804daf2cb09bade998d6d34c3a34508dd09

libstagefright: Add support to change clip duration to enable LPA

Added support to change the clip duration threshold value for LPA
playback. A new system property 'lpa.min_duration' has been added
which controls the minimum clip length for enabling LPA.
The default threshold value has been retained as 60sec.

Change-Id: I6a8be6d6bf67495977d8c75e5be14723a31353b1

frameworks/av: Skip tunnel mode for playback through AudioCache

In the use case of playback using SoundPool, decoded data is
cached from player and further rendered through AudioCache.
Avoid Tunnel mode for the use case AAC format through SoundPool

Change-Id: I21005a5b39f9fb480ae0d525ecb560fec4382620
CRs-Fixed: 437539

frameworks/base: dumpsys rendering statistics for Stagefright

- this adds extra fps statisticis
- report via dumpsys

Change-Id: I7b4d4582c4eb2ccf2d11557844dade92f9e587c0
CRs-Fixed: 435013

libstagefright: Stop extractor source after start in TunnelPlayer

Issue: In the use case of frequent suspend resume during Video
Playback with HDMI Connected, we encounter a scenario where tunnel
player is created and destroyed without the extractor source
started. In such use case, stopping the source in reset during the
tunnel player destruction leads to failure during assertion check.

Fix: Check for mStarted flag to ensure that stop on source is
called only after they are started.

Change-Id: Ib18e7ee3d10b2cc706944e358046f163d156706c
CRs-Fixed: 440239
[3/3] libstagefright/videoeditor: Allow custom DOMX source instead of Google DOMX default

Part 3 of 3 patches: To allow omap4 devices to use custom "domx" source
via a new BoardConfig.mk item:
TI_CUSTOM_DOMX_PATH := device/<manufacturer>/<device-name>/domx

This setting provides for 3 changes during the build:
1. In hardware/ti/omap4xxx this settings stops standard Google domx
source from being built and changes the domx reference for tiutils.
2. In frameworks/base it changes the default openmax references for
frameworks/base/media/jni/mediaeditor/Android.mk to the new location
3. In frameworks/av changes the openmax references in 5 places, and adds
new includes in ACodec.cpp, CameraSource.cpp and OMXCodec.cpp

This is a combination of cherry-picks from omapzoom (with a more descriptive
BoardConfig setting name):
http://www.omapzoom.org/?p=platform/frameworks/av.git;a=commit;h=8044105ca117c2e99b35ad9f341d630fc5a9d2e0
http://www.omapzoom.org/?p=platform/frameworks/av.git;a=commit;h=4adf712d1f3f2050fe0010652bbba7ecb8468870
http://www.omapzoom.org/?p=platform/frameworks/av.git;a=commit;h=fa37231ca59872ac491461ca3c14e019834848e5

Change-Id: I53dbf120d515eaf5ec82688dcea4c670c173ed01
Signed-off-by: Hashcode <hashcode0f@gmail.com>