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

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Compat



Sign in to add a comment
link

Issue 653548: MediaRecorder + canvas.captureStream when element is hidden deosn't produce anything

Reported by tristan....@gmail.com, Oct 6 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:50.0) Gecko/20100101 Firefox/50.0

Example URL:
https://jsfiddle.net/nnspow3a/

Steps to reproduce the problem:
1. Create a canvas element and don't append it to the document or set its style to `display:none`
2. do some animated drawings on the canvas
3. start a MediaRecorder fed by the result of `canvas.captureStream()` method

What is the expected behavior?
The recorder should be able to get new frames, even if not displayed on screen.

What went wrong?
The recorder doesn't get anything, and this even if we do call CanvasCaptureMediaStreamTrack.requestFrame() in the animation loop (https://jsfiddle.net/nnspow3a/1/)

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes 

Chrome version: 53.0.2785.143 (64-bit)  Channel: stable
OS Version: OS X 10.9
Flash Version: Shockwave Flash 23.0 r0
 

Comment 1 by dtapu...@chromium.org, Oct 6 2016

Components: Blink>Canvas

Comment 2 by junov@chromium.org, Oct 7 2016

Owner: emir...@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 3 by emir...@chromium.org, Jan 12 2017

Cc: emir...@chromium.org
Owner: junov@chromium.org
junov@, this is case for hidden 2D canvas that does not produce any frames. Let me know if there is a way around it.

Comment 4 by junov@chromium.org, Jan 25 2017

Fix is on the way.

Comment 5 by bugdroid1@chromium.org, Feb 11 2017

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2a5eabadc87a335563364fd77061a5d46e05d38a

commit 2a5eabadc87a335563364fd77061a5d46e05d38a
Author: junov <junov@chromium.org>
Date: Sat Feb 11 05:05:41 2017

Make stream captures work on canvases that are not in the DOM.

This CL refactors part of the internal workings of 2D canvas in order to
decouple the notions animation frame boundaries and paint invalidations.
The two used to be considered as one, which caused frame boundaries to
stop being processed on object not attached to the DOM due to the lack
of paint invalidations.

TBR=kbr@chromium.org, esprehn@chromium.org
BUG= 653548 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2653933003
Cr-Commit-Position: refs/heads/master@{#449845}

[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/content/renderer/gpu/render_widget_compositor.cc
[add] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/ImageBufferClient.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h
[modify] https://crrev.com/2a5eabadc87a335563364fd77061a5d46e05d38a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp

Comment 6 by junov@chromium.org, Feb 16 2017

Status: Fixed (was: Assigned)

Comment 7 by tristan....@gmail.com, Feb 17 2017

I confirm it does work in 58.0.3014.0 Canary. Great job !

Comment 8 by junov@chromium.org, Feb 21 2017

Status: Verified (was: Fixed)

Comment 9 by bugdroid1@chromium.org, Feb 22 2017

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9ac0ae9669662fadaf27f247d0c46d6e14e075fe

commit 9ac0ae9669662fadaf27f247d0c46d6e14e075fe
Author: junov <junov@chromium.org>
Date: Wed Feb 22 16:03:54 2017

Simplify rate limiter logic in Canvas2DLayerBridge

This CL is a follow-up to https://codereview.chromium.org/2653933003/.
It refactors the rate-limiter code to make it stop using it own task
observer, in favor of piggy-backing on top of the finalize frame signal

BUG= 653548 , 673469 

Review-Url: https://codereview.chromium.org/2700833002
Cr-Commit-Position: refs/heads/master@{#452071}

[modify] https://crrev.com/9ac0ae9669662fadaf27f247d0c46d6e14e075fe/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
[modify] https://crrev.com/9ac0ae9669662fadaf27f247d0c46d6e14e075fe/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h

Sign in to add a comment