RESOLVED FIXED 210335
Add a timer to AVVideoCaptureSource to verify reception of frames
https://bugs.webkit.org/show_bug.cgi?id=210335
Summary Add a timer to AVVideoCaptureSource to verify reception of frames
youenn fablet
Reported 2020-04-10 08:16:03 PDT
Add a timer to AVVideoCaptureSource to verify reception of frames
Attachments
Patch (7.21 KB, patch)
2020-04-10 08:24 PDT, youenn fablet
no flags
Patch (7.04 KB, patch)
2020-04-10 08:28 PDT, youenn fablet
no flags
Patch (6.61 KB, patch)
2020-04-11 16:25 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2020-04-10 08:24:54 PDT
youenn fablet
Comment 2 2020-04-10 08:28:53 PDT
youenn fablet
Comment 3 2020-04-11 16:25:58 PDT
Eric Carlson
Comment 4 2020-04-13 09:38:20 PDT
Comment on attachment 396197 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=396197&action=review > Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h:143 > + static constexpr Seconds verifyCaptureInterval = 3_s; Is three seconds long enough? > Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h:144 > + static const uint64_t framesToDropWhenStarting = 4; Shouldn't this be relative to the capture rate? > Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:163 > + RELEASE_LOG_ERROR(WebRTC, "AVVideoCaptureSource::verifyIsCapturing - no frame received in %d seconds, failing", static_cast<int>(m_verifyCapturingTimer.repeatInterval().value())); > + captureFailed(); Failing capture completely is quite severe. Should we try to stop and restart the camera one time?
youenn fablet
Comment 5 2020-04-14 02:32:40 PDT
(In reply to Eric Carlson from comment #4) > Comment on attachment 396197 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=396197&action=review > > > Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h:143 > > + static constexpr Seconds verifyCaptureInterval = 3_s; > > Is three seconds long enough? I tried to pick something not too short but not too long either. Timer starts when session is running so frames should flow very quickly in theory. > > Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h:144 > > + static const uint64_t framesToDropWhenStarting = 4; > > Shouldn't this be relative to the capture rate? Might be the case. IIRC, from your testing, the first frames were bad, probably at 30 fps. I am guessing that we could reduce this number at lower frame rate. > > Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:163 > > + RELEASE_LOG_ERROR(WebRTC, "AVVideoCaptureSource::verifyIsCapturing - no frame received in %d seconds, failing", static_cast<int>(m_verifyCapturingTimer.repeatInterval().value())); > > + captureFailed(); > > Failing capture completely is quite severe. Should we try to stop and > restart the camera one time? I was wondering the same thing and went this way following what we are doing for audio capture. At the same time, the application can always call getUserMedia if it wants to restart capture. Let's try that as a follow-up.
EWS
Comment 6 2020-04-14 02:36:11 PDT
Committed r260064: <https://trac.webkit.org/changeset/260064> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396197 [details].
Radar WebKit Bug Importer
Comment 7 2020-04-14 02:37:13 PDT
Note You need to log in before you can comment on or make changes to this bug.