New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 606943 link

Starred by 3 users

Issue metadata

Status: WontFix
Merged: issue 606890
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

captureStream: Frames requested in sequence overlap during playback

Project Member Reported by srnarayanan@chromium.org, Apr 26 2016

Issue description

Version: 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

 
Screen Shot 2016-04-26 at 1.23.49 PM.png
448 KB View Download
Screen Shot 2016-04-26 at 1.24.00 PM.png
407 KB View Download
test.webm
6.0 MB Download
Labels: M-51
Cc: -emir...@chromium.org
Owner: emir...@chromium.org
Status: Started (was: Untriaged)
Mergedinto: 606890
Status: Duplicate (was: Started)
Status: Available (was: Duplicate)
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.
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.
Cc: jbau...@chromium.org ccameron@chromium.org
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?
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.
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. 
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).
Cc: erikc...@chromium.org
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.
Cc: qiangchen@chromium.org
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.
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.

Comment 15 by tkent@chromium.org, May 10 2016

Components: -Blink>CaptureStream Blink>MediaCaptureFromElement
Merge Blink>CaptureStream into Blink>MediaCaptureFromElement

Components: -Blink>MediaCaptureFromElement Blink>MediaStream>CaptureFromElement
Renamed Blink>MediaCaptureFromElement to Blink>MediaStream>CaptureFromElement. Moving issues to the new component.
Status: Assigned (was: Available)
Status: WontFix (was: Assigned)
Not reproducible on Mac any more.

Sign in to add a comment