dashplayer: Squashed update from CodeAurora

DashPlayer:call unregisterHandler in DashPlayer, avoid memory leak

AHandler objects in mediaplayer registred with ALooper
but did not call unregister at shutdown.

Change-Id: If9140d30ace0423c8181a1a64707ddcdc448d525
CRs-Fixed: 461906

dashplayer: Fix seek bar jump during seek

Fix to update current position with seek time.

Change-Id: I3febf7a46f2c0a85fbbc36ec0898adc58ec2e2a9

dashplayer: Adjust buffer count for native window

When allocating buffers from native window, adjust the
buffer count based on the minimum undequed buffer count,
and allocate an extra buffer for smooth streaming.

Change-Id: I72ad33872b68bb0bfe41fcb565d61b429f76b892

DashPlayer: enable secure output buffers for drm use cases

 - sets GRALLOC_USAGE_PROTECTED for output buffers if
   content is DRM

Change-Id: Ib1bdab9e88dbac41aa336c906bbba897699a9402

dashplayer: Fix green frame issue on session timeout

* Avoid rendering video buffer which signals EOS as it does
  not contain valid video data.

CRs-Fixed: 476333

Change-Id: I10e3a0cb1e2dc9e1574d5e2b05f6339e868ac6fe

DashCodec: keep cache of formats to support b2b format change

     - when format change takes place too fast, it will pick up wrong
       format.
     - keep a cache of formats and only issue one sendFormatChange per
       crop change.
     - clear format cache when flushing

Change-Id: Ib45f3c5ac7764b4dd1edc4ac6c6f11390c33c151
CRs-Fixed: 475092

Fix for the flicker while changing the resolution in DashPlayer

- Just notify the message of MEDIA_SET_VIDEO_SIZE to JAVA Layer,
  while beginning to play the streaming.
- After the streaming begin to play, don't notify this message,
  while changing the resolution or seek operation finished.
- If we don't set video size,
  windowsmanager will adapt the dimension of the clip by itself.

Change-Id: I6a79d13159cd9bf33e0f483c7e1b71690f071011

CRs-fixed: 451993

DashPlayer: Notify position for video EOS buffer immediately

Notify current rendering position for video EOS buffer immediately,
without waiting for 100ms between subsequent updates.

CRs-Fixed: 489546
Change-Id: I9a8f346a68ff5c333d96e5ae24980e0ed1b27903

DashPlayer: Add support for dumpsys in DashPlayer

Added functionality in DashPlayer to dump playback statistics to file.

Change-Id: I0f95684f10db376731f622f06d17cc262480ecd3

DashPlayer: Notify seek position to dash source

Notify seek position to dash source to make sure that
if text samples arrive before audio/video, the time
out for sending text samples is not wrongly calculated.

CRs-Fixed: 492376

Change-Id: I952e474d92936532956c1d456b6ad1d554402405

DashPlayer: make jb_mr2 compatible .

 - ISurfaceTexture is called IGraphicBufferProducer in jb_mr2
 - SurfaceTextureClient is called Surface in jb_mr2

Change-Id: I790f49dd0cd2a155918155a6bae3badb5e412976

DashCodec: Changes to bringup DASH on MR2

*Disable AMR_WB audio support.
*Remove OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m from supported
 output color format

Change-Id: I4e675199a7e012d81f71dc027baa722b5eaa5281