stagefright: support multiple tunnel instances

There is a need of supporting more than 1 instance of TunnelPlayer.
When one tunnel playback is run and if we try to play a video
having audio format supported in tunnel mode only, that can not be
played due to this limitation, so implement upto 4 tunnel instances
support

Change-Id: I6305840134ba1e2eb71199120187c13ac88d1ddf

CRs-Fixed: 483603
Proper cleanup of Tunnel and LPA during Error

 - Cleanup of tunnel and lpa during error

Change-Id: Ia9113cc6fed5d5d841ab35203e195188ccf7591d
libstagefright: print all statistics when seek or resume

 - print all statistics when seek or resume is issued.

Change-Id: I5f787fb5006c9f8365ee7b33d7b619ba4ba6d39d
ACodec: Enable smooth-streaming and notify stride change to ANW

When crop changes due to resolution change in the stream, decoder
changes the stride implicitly. This needs to be set on the Native
Window along with the updated crop.
Defer sending the format change till the buffer with updated
resolution is due for display.

Change-Id: I51ca5ede181f5893b2bcd5f66996c9d8c0dea23e
CRs-Fixed: 491377
libstagefright: Enable smoothstreaming from OMXCodec

Enable smooth-streaming from OMXCodec as a default setting.
If stream resolution is different from that in metadata,
a crop change may be notified rather than port-reconfig.
Notify stride change to ANW in such case.

Change-Id: I4ae24fe2b969311b58b13372c92e1ec32ab1fda3
Adding a Property for proxy state

- Adding a property for proxy to let know if
  proxy is used by HAL or not.
- Adding this for other modules like WFD to acess
  proxy depending on the property state.
- Also added proxy open retry during proxy open fail
  for 20 times at 20ms gap to give time for other
  modules to close proxy when property is changed

Change-Id: I9c2807cfc4a1903c574a2cade318fcd5e494cc8c
Merge "Adding a Property for proxy state"
Merge "stagefright: support multiple tunnel instances"
Merge "ACodec: Enable smooth-streaming and notify stride change to ANW"
Merge "libstagefright: Enable smoothstreaming from OMXCodec"
Merge "Proper cleanup of Tunnel and LPA during Error"
CameraClient: Enables meta data notifications

- Adds the needed functionality for enabling/disabling
  metadata messages depending on the camera client
  commands.

Change-Id: Iab597d5519b8fb85ee21c824ec19e9aaec9b5219
Add Dolby pre-gain calculations for DirectAudioTracks

Change-Id: Iea968e46fcea2c11dabc88c745fc06fac025cffc
Indicate client process during streaming rebuffering

 - Audio was not playing after buffering done during streaming
   of audio-video playback
 - Changed to indicate to client process that the track was disabled
   because of underrun.
 - It will then automatically call start() when data is available

CRs-Fixed: 491525
Change-Id: I9dd2c95daaea33fbf5c42983399b88090675fc9d
Merge "Indicate client process during streaming rebuffering"
Merge "Add Dolby pre-gain calculations for DirectAudioTracks"
libstagefright: Release output buffer when file limit is reached

There is a memory leak in video recording when the
file size or duration limits are reached. The output
buffer copy is not released before exiting the track
thread in the mpeg4 writer.

To avoid the memory leak, the buffer copy is released
when a limit condition is detected in the mpeg4 writer.

Change-Id: Idfde2083fdd9997b3025c7c12e00f3ae4665b8da
CRs-Fixed: 315255
Merge "libstagefright: print all statistics when seek or resume"
audioflinger: Fix crash in flinger during monkey runs

The trackrefptr in DirectTrack descriptor can be invalid and
this can result in a crash is stability runs. Add check for
validity of the trackrefptr before accessing it

Change-Id: I8e7c29a8c234e502981af6e64ad6d1fc5618108d
libstagefright: thumbnail mode support for interlaced clips

 - need to make sure 2 frames have been decoded before we inject
   EOS.
 - change api for checking interlaced mode to return bool

Change-Id: Icccd8c8f5111665c62b85929c7e69e08b03b5ee4