libstagefright: Fix crash in media server mpeg2 playback.

 -There is a check in dequeueAccessUnitMPEGAudio function in
  ESQueue that time stamp returned by fetchTimeStamp is always
  greater than 0
 -In the current scenario, valid time stamp set on the first
  frame is getting replaced in the sub sequent code by -1.
 -Fix is to reset the flag after first frame is identified

Change-Id: Ifcbb8ed95751efb8aded6cdeb217fab82762a782
CRs-Fixed: 512218
AudioTrack: fix position callback after restore

When restoring an AudioTrack, the next position callback point
should not be modified and set ahead of current buffer head.
Otherwise, as frames are dropped, the new position is never reached
and an application relying on position callbacks to reload the buffer
would be stalled.

Bug: 11868603.
Change-Id: I93b2a311642a0c89944b78bcc0482d4ceed98ae4
Increase kFastTrackMultiplier from 1 to 2

Change-Id: I158f147295eebcea96e4047d7618069bc48bdd7d
libstagefright: adjust AV sync late margin based on property

- Current AV late margin is 40 ms
- Read system property media.sf.set.late.margin and if
  new AV sync late margin is set then use the same
- Max AV sync late margin allowed is 250 ms
- Min AV sync late margin is default 40 ms

Change-Id: I65cd3dce9b31b87f1488c37af9618669b29c362c
audioflinger: Do not apply effect on multichannel content

-Do not apply effect on multichannel content.
-Effects are applied only for mono or stereo.
CRs-Fixed: 484078

Change-Id: I4af38ccb5e081e740121fd387d290e4f439c84ae
libstagefright: Flush the pending buffers when EOS is received

For the use case where the first frame in the buffer is EOS, decode
the aac config frame buffer to update the sample rate and channel
mode and flush out the buffer.
CRs-Fixed: 459334

Change-Id: I175dc531e00ec36a366a818366fa869cd6ccf5a1
stagefright: Relinquish lock in OMXCodec while waiting for ANW buffers

This lets CallbackDispatcher continue working in the background
to deliver the component's messages to OMXCodec.

Change-Id: I357e2da269671ef365c004276ea0601d696d2efa
libstagefright: set threshold for earliness

Change the threshold value for earliness to 40ms
This fixes the av sync loss issues.

Change-Id: Ib912048987e8e6187dc37d5dbaff5d1ead224c61
CRs-Fixed: 584417
frameworks/av: Fix LOG_NDEBUG compilation errors

- Cleans up undefined references due to scope & naming

Change-Id: Ib342e57c69353fb873c6c0e7ba66e62983676f61
rtsp: Add a property "rtsp.transport.TCP"

- Add property "rtsp.transport.TCP"
  Value "true" - TCP
  Value "false" - UDP
  default value - false

Change-Id: Ic27b440067af49e7e3bcc45d86eb7a17ae9db54f
CRs-Fixed: 435538
libstagefright:Revert timestamp reorder for h264 in non AVI container

Timestamp reorder is not supported for h264 codec in non-avi container.

Change-Id: Ib7dbd66e2399cba0885932af49d219714d06ea60
CRs-Fixed: 584417
Merge "rtsp: Add a property "rtsp.transport.TCP""
Merge "libstagefright: Fix crash in media server mpeg2 playback."
Merge "libstagefright: set threshold for earliness"
Merge "stagefright: Relinquish lock in OMXCodec while waiting for ANW buffers"
stagefright: Correct total duration of HFR clips

HFR leverages the mp4 track timescale parameter which is not
considered when calculating total clip duration. This makes tracks
report the correct duration so that total clip duration is computed
correctly.

Change-Id: I8ff556913317eea15030f9f6920cefa560133872
Merge "libstagefright:Revert timestamp reorder for h264 in non AVI container"
Dolby:  Add support for Dolby UDC DD/DD+ Decoder

- Add mime type definition for Dolby formats
- Add Dolby decoder in MP4 container
- Add Dolby decoder support in MPEG2 PS/TS container and ES
- Add OMX component/codec registration for Dolby

Change-Id: Ic8677c65e3ae29a23d456a7235c87812bd63cd8c
Audio: Enable QCOM's HW AAC encoder conditionally

- Check related system prop to enable QCOM's HW
  AAC encoder
- Use QCOM's HW AAC encoder only for supported
  channels/sample rate/bitrate.
- Use Google's SW AAC encoder if the required AAC
  audio parameter is not supported by QCOM's HW
  AAC encoder

Change-Id: Ifc2409107e48390a6268dc5d5694df8fb47f60aa
Merge "Audio: Enable QCOM's HW AAC encoder conditionally"