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
(cherry picked from commit 32661d0aa3322f8a6da6889d5bdbbb98c84ba0f0)
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
(cherry picked from commit 41fbca0bb98b09b29b1c71e02700660cc579e609)
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
(cherry picked from commit 16590077b38d350024989e032b7ea24689b808ff)
av: Cleanup a lot of QCOM cruft

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

Change-Id: I5c2ec1b7da9281adfcb1eb6ff9ca71d423a2e07b
(cherry picked from commit da25dec22174b93bf5a1531af289c1cd84139962)
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
(cherry picked from commit af6b79f9d49803d3d93ae5195b8c364474c6cc15)
audioflinger: update track ready condition

Signal track ready if the track isStopping().

Change-Id: Ie279995d5f90fa8211a20dfbeacc1cf9b921d0bf
CRs-Fixed: 592189
(cherry picked from commit f05697523555e4a1a587f83fdc274190756bc4c6)
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
(cherry picked from commit b8c58116a5850b2daf8d9dde91623dd335737635)
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
(cherry picked from commit ba12641f5939a3c991e550fb30fe34d20969b600)
frameworks/av: Fix LOG_NDEBUG compilation errors

- Cleans up undefined references due to scope & naming

Change-Id: Ib342e57c69353fb873c6c0e7ba66e62983676f61
(cherry picked from commit 1a9b49f3975e5398f01096a72dbb8ad80ba86a4f)
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
(cherry picked from commit f415766d2e6f159de0932f0fcf59a615f27b5b9c)
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
(cherry picked from commit 39c8969feeb04d9945371a71c71a1c18bb13b805)