libstagefright: print file name in nuplayer playback path

Print the file name of clip being decoded by nuplayer.

Change-Id: I1e7f590019176b3722fa49f5a969d19d94c39bef
CRs-Fixed: 767244
libstagefright: remove duplicate call

getCodecSpecificDataFromInputFormatIfPossible is called twice in
Track constructor in MPEG4Writer. This is integration bug.
Second call is the correct place to call this function, remove first
call.

Change-Id: Icf5c2d136c734f9a0b21caf14faad5f5663ec846
libmedia: Add support to offload Audio Track

Add support to offload Audio Track. This is required
to offload tracks with PCM 16 bit data only
as padding is not done for 24 bit data. Offloading
is done transparent to the client of audiotrack

Change-Id: Ia63a30bd4bf431ceeda44731b53caa3add7cc521
libstagefright: Fix incall camcorder crash

-Starting camcorder during call is causing
 mediaserver crash on some targets.
-Audiorecord creation from AudioSource returns
 with error on some targets where this concurrent
 use case is not supported, furhter access to this
 record instance is causing crash.
-Preventing unnecessary call on Audiorecord instance
 in case of error, fixes this issue.

CRs-Fixed: 761747
Change-Id: Id5727a14cf320884f417413b0856b88035e382e5
libstagefright: use extended extractor for AC3/EAC3 formats

- Use extended extractor to parse Dolby AC3/EAC3 formats.
  Default extractor cannot parse multi-channel AC3/EAC3
  files properly

CRs-Fixed: 646269
Change-Id: Id097533790b69f5a26d5b92fb4fd64d03b622d68
libstagefright: Add support for JOC format to stagefright.

Add support for EAC3 JOC format to utils to allow offload path
to be selected for EAC3 JOC contents.

CRs-Fixed: 761339
Change-Id: Icf247136f4aa272e3294e81e776142fe4000548d
DOLBY UDC fixes for JOC

Compilation fixes for when DOLBY_UDC may not be defined

CRs-Fixed: 761339
Change-Id: I4976958fb9f88c3a17f81c78e75f89cad97eb6e3
frameworks/av: Use QC parser for aac audio only in MPEG4 container

- Default parser causes frequent standby for 'aac audio only' inside
  MPEG4 container - which is also larger than 75 minutes.
  This is due to perfomance issues during read()
- No such performance issue is seen with QC parser

Change-Id: I28eb5ecfeeaa1103cc149f346e20c5c232967bed
CRs-Fixed: 760668
audioflinger: Increase Client heap size

This increase is needed to accommodate higher sampling rate clip
playback over devices like BT and to support gapless playback with
larger buffer sizes. In both cases, the cblk memory allocated for a track
can be high enough that a new allocation (either due to restoreTrack_l or
opening a new track) can fail.

Change-Id: I96f674706184f029259802d5552f5ceeebc689c1
CRs-Fixed: 768106
NuPlayer: Implement pre-roll for poor network conditions

In poor network conditions, NuPlayer attempts to play out the
available cache. This leads to intermittent and jerky video
and an overall poor playback experience.

Implement pre-rolling (AwesomePlayer way) by setting low
and high buffering thresholds for available cache and
pause/resume player based on the cache duration available.
Also notify the MediaPlayer listeners about buffering
start/end.

CRs-Fixed: 761496
Change-Id: If3b1bad38725b7e2ebb0f195b8a04d3f423f3a1e
audio: Fix PCM offload selection for 16-bit and 24-bit

Fix PCM offload selection for 16-bit and 24-bit audio
formats.

Change-Id: Id3b3356c360e12fef6d72e92948427e3d7e2bc89
CRs-Fixed: 769991
DO NOT MERGE - audio policy: fix inifinite loop in clearAudioPatches()

releaseAudioPatch() does not necessarily remove the audio patch
from the list.
Scan the list from the top down to avoid adjusting the index.

Bug: 18621514.
Change-Id: I58787154680f7cb1818509017835b1693d62190f
RTSP: check MPEG4 DP in RTSP

Since the HW decoder doesn't support MPEG4 DP clips, detect DP format in
RTSP souce and report a new MIME for SW decoder.

Change-Id: I9df34538ede8d63a2a0826bc025c7ebef281bb49
media: Various fixes and cleanups

 * Clean up cruft from old QC property checks
 * Enable correct CFLAGS for libmedia to support track offload
 * Clean up warnings around variable ordering

Change-Id: I63026b0c3dbf9bf1eea29357136df0a4451f94d9
pre-kitkat audio policy blobs re-activated.

Change-Id: Idfcb03d0a4aa0a099bf5a17b7bf592ab402e3255
NuPlayer : Fix wrong time stamp update for offload playback

- Seekbar is updated continuously post offload audio tear down
- Pause start time is reset during session tear down causing the issue
- Fix is not to reset pause start time if clip is offload and in pause
  state

Change-Id: I4c7632dab1dddc73781e13cbf93b52afb4166c34
libstagefright: Ensure cache prefetch in underrun

NuCachedSource2::onFetch() will stop prefetching
if the total cache size exceeds highwater mark,
rather than considering the size of unaccessed data
for the calculation. If AwesomePlayer pauses due to
underrun, and NuCachedSource2 stop fetching, this
can lead to indefinite pause as AwesomePlayer will
use the unaccessed data for calculating buffered
duration while NuCachedSource2 uses the total cached
size

Added change to ensure cache prefetch in underrun so
that playback does not pause indefinitely

CRs-Fixed: 760796
Change-Id: I8124e04b18a6e200b59c9cf7d2a912a43e147db1
audio_policy: Fix for overwrite of ULL flags on record concurrency

- Touch tones are playing on Deep buffer path when
  record is in progress when record concurrency enabled

- ULL flags are over written on getoutput API when
  record session is active

- Add check for non ULL output request instead ULL output
  flags while forcing deep buffer path with record concurrency

Change-Id: Ic463cea0f9ec1d47b548e6e387f484f221ee92f7
DO NOT MERGE - NuPlayer: invalid anchor time when render is flushed.

Also rememeber the pause time in NuPlayerDriver.

Bug: 18436336
Change-Id: If09f680a0d0f9137bd55c5f94201eb3aa783278a
DO NOT MERGE - NuPlayer: open audio sink in offload mode when resuming from timeout teardown.

Also always recheck if a new stream can do offload.

Bug: 18154425
Change-Id: I121877834bd963eeeba91a2b951fd30d5dc36a8b