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
Stagefright: use get(Input/Output)Buffer in async mode

Non-async mode uses get(Input/Output)Buffers to get the
buffer handles at start; buffer-IDs obtained after
dequeue() are used to directly reference the handles.
In async mode, MediaCodec calls-back when an input/output
is available. Relying on the initial buffer-list can lead
to race conditions when buffers are allocated or changed.
Hence use get(Input/Output)Buffer to query the buffer
handle each time and just-in-time.

CRs-Fixed: 765324
Change-Id: Ifc0b7558564a57bd9316d0f80ae9cf88dfd6a1f3
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: Fix heap corruption from AudioSource

AudioSource allocates memory for member variable
mTempBuf in its constructor and deallocates during
reset, but mTempBuf can be dereferenced on event
EVENT_NEW_POS even after reset, since AudioRecord
instance can post this event while exiting threadloop
even after stop is called on AudioRecord.
Also reset is called from destructor only if mStarted
is true, which means the memory can miss deallocation
if start is not called before AudioSource instance is
destroyed.
Moving deallocation of mTempBuf to destructor
will solve both the issues.

Change-Id: Ie42f0894e6b3e7c7ea734814ab90d46ee2d7c753
libstagefright: Fixed PCM Offload format check

Small buffer hint is getting enabled for other formats
too due to in-correct checks in AudioTrack and AudioPlayer

Fixed the checks so that it gets enabled only for PCM
Offload formats

CRs-Fixed: 767824

Change-Id: I46cce8d66d0299c8ec8b8b12592c69cfe0abde18
libstagefright: add NULL pointer check for audio extended APIs

- Add NULL pointer check in ExtendedUtils for auido APIs

Change-Id: I41e0658acb5855e1708b729fbbf58038ad3c6983
CRs-Fixed: 768650
libstagefright: add NULL pointer check for audio mime type

- Add NULL pointer check before using audio meta data and
  pcmOffloadException

Change-Id: I5711f6649de67de4bb14bcb2acc2e5e21748fb2a
CRs-Fixed: 768650
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
Merge "libstagefright: Fix incall camcorder crash"
Merge "libmedia: Add support to offload Audio Track"
Merge "Stagefright: use get(Input/Output)Buffer in async mode"
Merge "libstagefright: print file name in nuplayer playback path"
Merge "libstagefright: Fixed PCM Offload format check"
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
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
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
stagefright: add dts audio input format support in Acodec

Add dts audio input format support in Acodec.

CRs-fixed: 769244
Change-Id: I8496729dea4b7bcb0df19a08773952d4916c750e
Merge "audio: Fix PCM offload selection for 16-bit and 24-bit"