captureStream: Frames requested in sequence overlap during playback |
||||||||||||
Issue descriptionVersion: M51 51.0.2704.28 OS: Mac, Win 7 What steps will reproduce the problem? (1) Open https://cdn.rawgit.com/uysalere/js-demos/master/canvascapture6.html (2) Click 'Create Stream from < canvas >' button (3) Click 'Play back captured Stream to a < video >' button (4) After a few secs, click 'Request frame from <canvas>' button (5) Repeat step 4 a few more times, to capture a few more frames in sequence What is the expected output? The requested frame that is captured should be seen completely, during playback What do you see instead? Frames requested are not seen completely. There's overlap of frames as seen in screenshots. Please use labels and text to provide additional information. This issue is not seen in Linux. Attached webm video of behavior on linux
,
Apr 26 2016
,
Apr 26 2016
,
Apr 26 2016
,
Apr 28 2016
After my investigation, this could be an issue related to the compositor tile. As the "splitting" line depends on the location of the player. When WMPMSCompositor::UpdateCurrentFrame always returns true, it forces chrome compositor to redraw the player, regardless whether there is a new frame or not. When WMPMSCompositor::UpdateCurrentFrame return value is based on whether we have a new frame or not, then in this test case, for most of the time it will return false, and when "request frame" is clicked, it will return true. (Obviously you cannot make your click rate close to 60FPS) Then I think something is wrong in the compositor that different tiles are not sync. So I think this is not a duplicate of 606890.
,
Apr 28 2016
Emircan@, do you know anyone familiar with compositor? I do not think there is anything wrong with your generated stream, or with the player. One evidence is that when the players shows a half-half frame, click any blank area (which invalidates the page and forces compositor to redraw the frame), the frame will look good. This means WebMediaPlayerMS does submit a good frame.
,
Apr 29 2016
Thanks for the analysis Qiang. The alpha channel is triggering both these threading issues, but it indeed looks like the root cause of this issue might be different than 606890. As you said, when we have a partially rendered frame and click any blank area, the frame gets rendered properly. That would validate WebMediaPlayerMS's submission. I am going to add ccameron@ and jbauman@ to see if they have any leads. ccameron@, this looks like it might be related to DirectRenderer::DrawFrame() that you mentioned in email. Can you take a look?
,
Apr 29 2016
I'm not sure, but this can happen if, similar to bug 606890 , the damage rect does not include the entirety of the changes in the frame. In bug 606890 , the damage rect did not include the video, so none of the video updated. If the damage rect happens to include part of the video (maybe due to redrawing the button when it's clicked on) then part of the video will be updated and part won't.
,
Apr 29 2016
Btw for bug 606890 , qiangchen@ prepared this CL [0] to address. The issue there was WebMediaPlayerMSCompositor::UpdateCurrentFrame() falsely returning false when there was a race.
,
Apr 29 2016
Also, you can try with --show-surface-damage-rects to see the actual damage rects that are reported (though the issue won't actually happen with it enabled).
,
Apr 29 2016
Sounds potentially related to issue 595245 -- canvas synchronization issues. I'm pretty surprised that we're seeing temporal tearing, but I could imagine that to happen.
,
Apr 29 2016
,
Apr 29 2016
This issue is reproducible on Windows as well. So I am not sure if it would be related to bug 595245 . Also, I tried --show-surface-damage-rects as jbauman@ suggested. The partially rendered areas completely correspond to the the damage-rect borders shown there. My question now is that how is damage rect decided from WebMediaPlayerMSCompositor. AFAIU, WebMediaPlayerMSCompositor only reports that frame is changed via UpdateCurrentFrame() but not a certain area.
,
Apr 29 2016
If WebMediaPlayerMSCompositor::UpdateCurrentFrame returns true then VideoFrameProviderClientImpl::DidReceiveFrame will make the entire video frame as damaged. Damage rects that don't cover it completely are caused by damage to other layers.
,
May 10 2016
Merge Blink>CaptureStream into Blink>MediaCaptureFromElement
,
May 24 2016
Renamed Blink>MediaCaptureFromElement to Blink>MediaStream>CaptureFromElement. Moving issues to the new component.
,
Jun 21 2016
,
Jan 11 2018
Not reproducible on Mac any more. |
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by srnarayanan@chromium.org
, Apr 26 20166.0 MB
6.0 MB Download