crosswalk-project/chromium-crosswalk — pull request #193 by js0701 (2014-09-29 01:20:52+00:00)
Title: [Android] Fix getUserMedia low FPS problem if constraint out of range

@xingnan @hmin
eg. Constraints requires minFramerate at 31 FPS, while the camera only support FPS range 10 to 30.
In this case, VideoCapture Android will return a min Framerate 10(or 11), and it is used to calurate
the expectedNextFrameTime when one frame of data is captured from camera: in video_capture_android.cc,
on FrameAvailable function, if it judge the frame arrive too early, it will discard the frame.
The problem is that Android Camera device can only accept setting of a FPS range, when set the range of
FPS from 11 to 30, the FPS can be 11 or 30. If the actual FPS is 30 and the returned FPS to calculate the
expectedNextFrameTime is 11, many frames will be thought to arrive too early, but it is not fact. To avoid
this problem, use the default setting to be max FPS of the range. If the range is 11 to 30, use 30 instead
avoid the frames to be discard.
The strategy here is avoid discard frame as much as possible sine the frame has been captured from Camera.
BUG=XWALK-2643