LiveSession: Use the actual, possibly redirected url as base in the M3U

This fixes playback of HLS streams where the M3U playlists use
relative paths and the main playlist is opened via a redirect.

Change-Id: I787e1c050daddc566be4c8e3f84803d3f91eec46
SoftAVCEncoder: Support Surface input

This is pretty much based on a0a63e13788 by Andreas Huber.

The same restrictions as mentioned in that commit apply:

    This relies heavily on the fact that the "Nexus" devices use ARGB32
    as the colorspace for the data underlying a surface provided by
    SurfaceFlinger (mirroring). Generally there are no such guarantees.

Change-Id: I518fa2c13107e314d1912c60d1cdad742ab0a2e2
SoftAVCEncoder: Automatically select the right level for the chosen resolution

Previously a certain level was hardcoded, and unless the caller
(at the MediaCodec API level) explicitly specified a desired level
to use, the SW AVC failed to encode resolutions that require a
higher level.

This makes the 720p tests in EncodeDecodeTest pass with this
encoder.

Change-Id: Id0d47da5cdf6beb5dc17aae08c258b3490ce52a3
SoftAVCEncoder: Include all levels in the mapping table

There's no reason to not let callers use these levels
if the really want to.

This only matters if the caller explicitly requests a certain
level.

Change-Id: I8cadc3e87247d1891160898deac6abc2c1cfabdb
Latency optimization in bufferCount / MW (Audio android framework).

BufferCount for AudioSink/AudioTrack is changed to 2 from 4. This
is done to improve the latency for the audio buffer.

Change-Id: I25efc9ee6e9ed19daa727f78df2a1dfa1aeddb38
Author: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Signed-off-by: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 26849
libmediaplayerservice: fix the problem that streaming exist when change to low bandwidth

Httplive Bandwidth change: When change to low, the ts stream became only audio stream.
google's orignal design does not cover this case and will pop "can not play", try to
cover the case.

Change-Id: I4065ec9ee30d651338ce613bef9d94fe1083d2f2
Author: Yi Wang <yi.a.wang@intel.com>
Signed-off-by: Yi Wang <yi.a.wang@intel.com>
Signed-off-by: Dan Liang <dan.liang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 48710 20833
Avoid CHECK due to malformed rtsp packets

Three CHECKs were removed in AMPEG4ElementaryAssembler and the
malformed packets are ignored instead.

Change-Id: I0e3e82c6ab32dca9cee9b64960fa36ffc46c0e33