libnbaio: Don't call get_presentation_position for pre KitKat blobs

This fixes a crash with the HTC Tegra3 audio blob where
mStream->get_presentation_position is not NULL but pointing to a unknown
position in memory.

Change-Id: I0ff0ab064c1ac16a128bb3f24d4a473b3164f36d
libstagefright: Return EOS after buffers are released

Return EOS from SurfaceMediaSource after buffers
have been released, due to disconnect from producer..

CRs-Fixed: 550868
Change-Id: I4b2f3ef1c2895f155260baa0c58d90df4b4210d9
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
libstagefright: Add hooks for extended media utils

Add following enhancements:
 - Shell property to disable audio
   property: persist.debug.sf.noaudio
   0 = all audio enabled
   1 = audio decode disabled (AwesomePlayer)
   2 = audio encode disabled (StagefrightRecorder)
   3 = audio encode & decode disabled
 - Shell property to override encoding profiles
   property: encoder.video.profile
   H264 profiles: base, main, high
   MPEG4 profiles: simple, asp

CRs: 573176

Change-Id: Iec32177cae40b0de606b52bbbd41eb24b1643c56
av: Cleanup a lot of QCOM cruft

 * Remove some legacy code to bring us closer to kk_3.5

Change-Id: I5c2ec1b7da9281adfcb1eb6ff9ca71d423a2e07b
libstagefright: Smooth Streaming in OMXCodec

This change is to address startup latency during playback.

Set smooth-streaming mode from OMXCodec by default
if mm.enable.smoothstreaming property is enabled

When crop change is detected, save the target crop/stride and apply
them just before the buffer is (potentially) rendered.
Applying the updates right away may cause artifacts as buffers with
previous resolution are not rendered yet.

This approach assumes that there will not be a crop change within
the detection and application of current crop

CRs-Fixed: 584629

Change-Id: Ia164309edf1c51ed28b929deabecc53fc56cbf33
audioflinger: update track ready condition

Signal track ready if the track isStopping().

Change-Id: Ie279995d5f90fa8211a20dfbeacc1cf9b921d0bf
CRs-Fixed: 592189
audio: ID3 tags of most chinese songs display messy

- ID3 coding format detect and convert issue
- Enhance the detect and convert function

Change-Id: Idf59dd100b8a01b65338a51109d752616abec81b
CRs-Fixed: 494956
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
frameworks/av: Fix LOG_NDEBUG compilation errors

- Cleans up undefined references due to scope & naming

Change-Id: Ib342e57c69353fb873c6c0e7ba66e62983676f61
libstagefright: Added mime-types for enca/encv atoms

- enca/encv are encrypted audio and video atoms for
  mp4a and mp4v. Hence returning aac and mpeg4 mime-types
  for enca and encv.

CRs-Fixed: 578506

Change-Id: Ie568ea7eec73e110eef07e2b1b921afefc8c54a7
audio: Add pause support for hardware omx component

-ADSP doesn't enter sleep state after wma playback is paused
and power suspended.
-No support for NT session pause in case of hardware component.
NT session need to be paused to put ADSP into power collapse.
-Add support of pause in stagefright to ensure device enters
suspend mode. Also add intermediate states to avoid concurrency
issues between read and pause.

(cherry picked from commit f0a2da308d5e683ccde2d3d6f52c651bff6634e6)
(cherry picked from commit 27dc50267c424242930afe4740f2ddf5161d6d2c)
(cherry picked from commit 20e8fd2241be5dcf48a03a6f2a7927b6cd1ac15f)
(cherry picked from commit 2a15a4bf9754bda6e53530f65f82fa64b27f0f4f)

Change-Id: I41b946b8c8805e6ee303646b63513b5b16514ef6
Merge remote-tracking branch 'upstream/cm-11.0' into cm-11.0