Camera service: fix deadlock

release lock before return from CameraService::dump

Change-Id: I89d75f13bf82490929eafa1da9e88e7023abfb49
Orig-Change-Id: I7cedc834d13e180c9c9f43fe5ffb955f0a0c4755
Signed-off-by: Kalle Lampila <kallex.lampila@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 104720
Abort the port poking if socket not available

If a RTSP stream is aborted shortly after the connection request,
the status message from the server may be received after
interrupting the connection. In that case an attempt to resolve
the current IP address when no socket is available will cause
force closing. This can happen if a server is quite slow. In this
fix assumption that the socket exists is replaced by handling the
situation when the socket is not available.

Change-Id: I0ed25deaffa460bf2c35c2130ef29bc3f0654db4
libstagefright: remove 10ms polling in AwesomePlayer

AwesomePlayer will wake up every 10ms while video is playing.

This patch will remove the 10ms polling.

Change-Id: Iae3ec6dac7ab5722c708b44e019d3aba09c3aea7
Author: Richard Tang <richard.tang@intel.com>
Signed-off-by: Richard Tang <richard.tang@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: 34320

Conflicts:

	media/libstagefright/AwesomePlayer.cpp
libstagefright: Optimize h263/mpeg4 assambler to reduce frame dropping in the assambler layer.

If current rtp packet lost, when submitting the last access unit to construct a
video frame it will set the last access unit to be damaged and will drop it. It
is the google orignal design. But if the last access unit is a whole frame it will
cause an additional frame dropping. So use "M" marker to detect the frame boundary,
if the last accecc unit "M" is set, we don't drop it, this can improve streaming
video quality when rtp packet dropping too much.

Change-Id: I895ef7fd86fbdc391ba5e84e6dd68ee2fc87e3b8
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: 49120, 23827, 26068
Patches related to Matroska Extractor.

Video Frame drops seen during playback of certain mkv files
and mediaserver crash issue (mka extractor fatal error) have
been fixed with these patches.

Change-Id: Ida6f03fa855679e632917a7d4359906face31262
Author: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Signed-off-by: Gurudatta Bhakte <gurudattax.bhakte@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: 48377, 24170, 27388
Audio streaming error when playing a stream that contains "end of file".

Although EOS is being post from Myhandler.h file upon receipt of BYE message from RTSP
server. This happens because the Nuplayer::Renderer::onDrainAudioQueue() funtion
returns false after mAudioSink->getPosition() call , and the EOS message present in
mAudioQueue was lost.
The mAudioSink->getPosition() returns NO_INIT as mAudioSink->open() is not yet called,
hence no audio track exists in MediaPlayerService::AudioOutput.

Change-Id: I90d76943d3c10986171da3bc85a2a931af79ad30
Author: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Signed-off-by: Gurudatta Bhakte <gurudattax.bhakte@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: 24194
MediaCodec: Pass the crop rect to SoftwareRenderer

Change-Id: I434411516eb5fafe9d7aeac9882bbc7f1a8415d8
Added support for 3GPP meta data atoms

3GPP metadata is not supported, only iTunes Metadata
Format is supported.

Change-Id: I78b41c88788d5a43800c936e0ac0f98424515c62
Fix crash in MyHandler when sockets are not set.

-When going quickly in and out of the video view during an rtsp
streaming session, a race condition occurs and MyHandler tries to
connect to a socket that has been reset. To avoid this,
checks are added.
- If there are errors during setupTrack 1, it is no use
setting up track 2. It will cause new errors.
- No assert for socket connect since there is a normal
status check already.

Change-Id: Ie06221d6c0d78ce0449f76c782ed5120fa646bfd
Typo in CameraParameters::set

Typo: 'key' --> 'value'

Change-Id: Idd0426263cf2125a796406abaf6f29f04f425fe4
Handle undefined NAL type for h264 streaming

Packages of undefined NAL type (0) was observed but lead to deleting
the subsequent package due to the current assembler implementation.
Identifying and ignoring this package without returning an error
handles undefined packages without side-effects.

Change-Id: I02e15b8682bee3154b3c4acf82639a28417f0c85
To fix the green title edge problem (Native)

The problem was caused by alpha blending between some useless
green lines in the title image and the input image. In the
patch, we correct this wrong title boundary and only perform
blending between input image and title area.
There is also a very great side effect that: the computation
complexity is significantly reduced. It saves the exporting
time up to 60% for 1080P video with title effect.

Change-Id: I087df61564047b4a1a6b91759e47c700e0d250b1
Orig-Change-Id: I27adefc65a6fc7d77df5bb7b6093b6c804164e09
Signed-off-by: wfeng6 <wei.feng@intel.com>
Signed-off-by: Gu, Wangyi <wangyi.gu@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 39058
libmediaplayerservice: fix hls can not pause/play issue in HTML5 fullscreen mode

fix hls can not pause/play issue in HTML5 fullscreen mode which is introduced in Android 4.3

Change-Id: I165e561a01faee95b3db599f13c397122b359dcd
Signed-off-by: ywan171 <yi.a.wang@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 107204
RTSPSouce: add check for mHandler in release

fix the media server issue in RTSP release
duplicate quit msg may cause mHandler null and it may cause crash in onDisconnect

Change-Id: Ib04158603eea3fecc70035f4054729ef8ab40dc0
Author: Yi Wang <yi.a.wang@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: 49222, 44103
NuPlayerRender: Fix uint32_t numFramesPendingPlayout overrun issue

Add protection to avoid uint32_t numFramesPendingPlayout overrun.
If overrun happens, the video will be post a large delay time casuing video frozen.

Change-Id: Ia5d3aa06a61d40ea08cec525ec315ce0858c8854
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: 48710, 27202
Add ThreadedSource to Stagefright framework

This patch adds ThreadedSource to Stagefright framework. It
allows to start Media Source in separate threads and can
significantly improve software codec (such as VP8 decoder)
performance.

Change-Id: I5fabb1e565feab8306a6ab524cd3c22b3d9976a1
Orig-Change-Id: Id1f94a1859bde7b6ff6f7a552796f75fe141e085
Signed-off-by: wfeng6 <wei.feng@intel.com>
Reviewed-on: http://android.intel.com:8080/75085
Reviewed-by: Yao, Yong <yong.yao@intel.com>
Reviewed-by: lab_cactus <lab_cactus@intel.com>
Tested-by: Tong, BoX <box.tong@intel.com>
Reviewed-by: Tong, BoX <box.tong@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 48043

Conflicts:

	media/libstagefright/Android.mk