WA: Queue extra buffers on output port during reconfig if input EOS-ed

Some codecs may return input buffers before having them processed.
This causes a halt if we already signaled an EOS on the input
port.  For now keep submitting output meta buffers one at a time if
the input EOS-ed, but the output not yet.

Normally, we submit an output buffer for each input buffer that is
with the component (waiting to be processed).

Change-Id: I8a1251bfb504f40f1e4085a1e220bf9a4d0b05d9
Signed-off-by: Lajos Molnar <lajos@google.com>
Bug: 11433909
Merge "WA: Queue extra buffers on output port during reconfig if input EOS-ed" into klp-dev
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
audioflinger: OffloadThread state fix

When switching from one offload session to another that
reuses the same offload output, audio HAL is paused & flushed in
preparation for the new track.

OffloadThread must reset mHwPaused to allow proper state transitions
for the second track.

CRs-Fixed: 578165
Change-Id: I8173845e1782b5a8b372a82c7d337299a61e0efe
nuplayer: Fixes in nuplayer Renderer

- Fix in AV sync calculation for video only stream's pause
  scenario

Change-Id: Ie4fae760ca485ee21121cf4018a62d5d86eacb57
Nuplayer: Fix no image or image will be delay issue

- Fix no image or image will be delay issue
  while using Wifi VOD RTSP program

Change-Id: I7b32fb2ef80f46557c6c76118783245f8488812f
libstagefright: Fix for video can't be played if BT is connected

-Issue: Video can't be played if BT is connected.
-Rootcause: Source code to handle fallback to software decoder
 if offload audio track creation fails is not present.
-Fix: Add source code to handle fallback to software decoder
 if offload audio track creation fails.

Change-Id: Ie136a2117dd3f028c962b8b73ebc238bc982d79b
CRs-Fixed:  593230
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: customize delay to post video events

Calculate delay as a function of lateness rather
than fixed 10ms.
When video frames are decoded quite early, this
change will delay the wake up of video events.

We save some unwanted wake up of video events
which save power.

Change-Id: I12839b9df62d453f394894b499491e2cac3a0c8a
CRs-Fixed: 578988
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
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