Fix hanging when seeking near end in NuPlayer

If the decoder has already reached EOS when a seek is performed, the
decoder will hang in NuPlayer.

This fix makes sure to restart the decoder in the above case, which
is needed in order to resume playback.

Change-Id: Ia7bce331a5bf787f75e4071fe1308d8c0b392c2c
Solved problem with hanging decode call

Improved error handling in Mediaplayer service,
stops decode from hanging when player->start()
fails.

Change-Id: Ia160ff6eb9aeef0971c004e8baa90750e5636479
OMXCodec: Set profile/level to Intel OMX components

Set profile/level to Intel OMX components which is critical to buffer management
and low delay mode, and the initial purpose of this patch is to move dbp calculation
from AOSP to Intel BSP, then we can touch AOSP code less.

Change-Id: Ifba25c73157b4e734fa15716a53c8f5ebe4a3788
Author: Weian Chen <weian.chen@intel.com>
Signed-off-by: Weian Chen <weian.chen@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: 48913, 24384

Conflicts:
	include/media/stagefright/OMXCodec.h
	media/libstagefright/OMXCodec.cpp
Awesomeplayer: adjust the seek for audio

The seek of audio is not correct, for every audio frame
is keyframe. Also when the video seek to the end, the audio should also to
be the end, so the media will be complete.

Change-Id: Id7a45b5a1cc50d1e482b50c570e299dd7b710fda
Author: Weian Chen <weian.chen@intel.com>
Signed-off-by: Weian Chen <weian.chen@intel.com>
Signed-off-by: Feng Xiao <fengx.xiao@intel.com>
Signed-off-by: Yi Wang <yi.a.wang@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: 48604, 18523, 6907
h263 streaming: make SDP size optional, adding OnVideoSizeChanged

According to rfc4629 all ftmp parameters in the sdp are optional,
the codec has been tested to handle this and parse out size itself.
When the renderer is created a callback with the size is now sent,
as described in the MediaPlayer:getVideoHeight/Width documentation.

Change-Id: Ic49b4dd317e84e678a2c8c7b58e62deb6cf7774d
Avoid mediaserver crash when failing to set input port size

The mediaserver will crash when passing an invalid input port size
to the OMX codec plugins. For example, if the sample size in stsz
table is negtive, this will make kKeyMaxInputSize value very large.
The value will be passed to OMX plugins to set the input port size.
OMX plugins will detect this invalid value and report errors. But
the return error is not properly handled in setMinBufferSize and
the CHECK() will crash the mediaserver directly.

This patch will handle this situation and allows OMXCodec to exit
elegantly.

Change-Id: Ie5bc2ba15f158ac2a4fc448017845b956f137aff
Author: Wei Feng <wei.feng@intel.com>
Signed-off-by: Wei Feng <wei.feng@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: 68835
fix crash issue while playing certain streaming media

In the play response of certain streaming media, the url just contains part of the full url.
Change the url matching method to enable this case rather than crash as before.

Change-Id: Iacf46286ad5b9a1ef8e6fc4919d9fb0ee57ed31f
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: 49305 7540 18533
libvideoeditor: set second clip flag true for video edit in saving phase of clip generation

there may be green frame when previewing image with both effect and transition added if not setting the flag

Change-Id: Id26893abd87be49b6b4f0f8c59c163028dec2070
Signed-off-by: beanz <beanz@marvell.com>
Fix wrong live stream duration

StageFright has a default duration of 1 hour for all streams that
do not report a duration. Most streams that do not have a duration
are live streams, so the duration is not relevant. This fix
changes the default value to 0 seconds instead, so that the user
does not think that a live stream will end in 1 hour.

Change-Id: If80fb9d6eac7e1ccc751c0979d09526f65189217
libstagefright: Ignore stsd box flag check for MPEG4Extractor

Ignore stsd box flag check to have more MP4 files played.

Change-Id: I91e6ceaf817f20b838f475145989e69b1c295075
Author: Tianmi Chen <tianmi.chen@intel.com>
Signed-off-by: Tianmi Chen <tianmi.chen@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: 50109
Fix rtsp streaming continuously seeking, video freeze issue.

After seeking, the video rtcp packet receives too late, and the rtp packets
which receives before the rtcp packets are cached, if we don't clear these packets,
when finish the nextseeking it will use the cache rtp packets to calculate the
timestamp and it will get a wrong timestamp for A/V sync.

Change-Id: I19996f9f3da3cb63249aa33ae464ff272f870b4a
Author: Feng Xiao<fengx.xiao@intel.com>
Signed-off-by: Feng Xiao<fengx.xiao@intel.com>
Signed-off-by: Yi Wang<yi.a.wang@intel.com>
Singed-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: 49305, 35189
Handle malformed audio packets received during RTSP stream switching

During RTSP stream switching (for example channel switching in a
Mobile TV application) we occasionally receive packets that
don't contain valid data, so we cannot remove LATM framing (as per
the MPEG4 Audio Assembler).  This fix allows the frame remover
to exit gracefully (instead of crashing), when such frames are
encountered, and as a consequence, Mobile TV apps can change
channels properly.

Change-Id: Ie4c3d2766c87b43f31624192de96bc47180ca514
Disconnect the mediaplayer when reset

When the mediaplayer is reset the strong pointer to the
media service client is destroyed and the client should
deconstruct. However this could take some time and if a new
client is connected before the old client is disconnected
there could be problems. By assuring that the client disconnects
these problems can be avoided.

Change-Id: I5d2cf6d22860aa616b14397b1f523ddc35197b83
User-selectable camera click sound [3/3]: (stock(bloop)/realistic/disabled)

Originally: Option to disable camera sounds (3/3) by Jonathan Steadman

Change-Id: Iff4eb5ca7dd13038bf852a76d0c605814864497a
Signed-off-by: nuclearmistake <nuclearmistake@gmail.com>

Conflicts:
	services/camera/libcameraservice/CameraService.cpp