Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(770)

Issue 1162903004: FileVideoCaptureDevice: Regulate framerate without drifting (Closed)

Created:
5 years, 6 months ago by magjed_chromium
Modified:
5 years, 6 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, mcasas+watch_chromium.org, posciak+watch_chromium.org, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

FileVideoCaptureDevice: Regulate framerate without drifting We currently rely on PostDelayedTask with a constant frame interval to get a specified frame rate. This CL dynamically adapts the delay to PostDelayedTask to keep the frame rate in sync. BUG=492189 Committed: https://crrev.com/fa660905fb2f7cd1dc12ea4c3bc609c6fa85966d Cr-Commit-Position: refs/heads/master@{#332827}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -8 lines) Patch
M media/video/capture/file_video_capture_device.h View 1 chunk +2 lines, -0 lines 0 comments Download
M media/video/capture/file_video_capture_device.cc View 3 chunks +8 lines, -8 lines 0 comments Download

Messages

Total messages: 14 (5 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1162903004/1
5 years, 6 months ago (2015-06-04 09:17:15 UTC) #2
magjed_chromium
tommi - Please take a look.
5 years, 6 months ago (2015-06-04 09:18:01 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 6 months ago (2015-06-04 10:14:32 UTC) #6
tommi (sloooow) - chröme
lgtm
5 years, 6 months ago (2015-06-04 12:34:09 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1162903004/1
5 years, 6 months ago (2015-06-04 13:25:29 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 6 months ago (2015-06-04 13:58:52 UTC) #10
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/fa660905fb2f7cd1dc12ea4c3bc609c6fa85966d Cr-Commit-Position: refs/heads/master@{#332827}
5 years, 6 months ago (2015-06-04 13:59:51 UTC) #11
brucedawson
This looks great and should be much more stable. However it looks like the code ...
5 years, 6 months ago (2015-06-04 20:16:45 UTC) #13
magjed_chromium
5 years, 6 months ago (2015-06-05 12:26:55 UTC) #14
Message was sent while issue was closed.
On 2015/06/04 20:16:45, brucedawson wrote:
> This looks great and should be much more stable.
> 
> However it looks like the code could hit problems if it is ever unable to meet
> frame rate. If the target frame rate is 60 fps and it runs at 30 fps for a
> second then I think that next_frame_time will be half a second in the past
which
> means that a negative time will be passed to PostDelayedTask. That should
cause
> the task to run immediately, so there would be no immediate bad consequences.
> 
> If the code then started running at 1,000 fps (unlikely, but let's
hypothesize)
> then all of the skipped frames would be generated as quickly as possible --
the
> code would try to 'catch up'.
> 
> I think that 'catch up' is not the desired behavior. Should this check be
added?
> 
> if (next_frame_time_ < current_time)
>     next_frame_time_ = current_time;

I agree, your change makes the behavior more similar to a normal webcam. I
uploaded a new CL here: https://codereview.chromium.org/1170573003/

Powered by Google App Engine
This is Rietveld 408576698