MediaStream behavior when a new sink is added |
||
Issue descriptionMediaStream does not hold onto the last video frame. Therefore, when a new sink is added, we do not send anything down until a new frame is provided by the source. This caused issues in canvas capture interoperability with Firefox, as it has been discussed on issue 587789 and https://github.com/w3c/mediacapture-fromelement/issues/29#issuecomment-194277907. In addition, this caused issues in Tab/Desktop capture, pointed by miu and some work can be seen on https://codereview.chromium.org/1826643003/. So, I wanted to move the discussion to a seperate bug. As pointed out by many people, VideoFrame holding onto a video frame is a risky approach. Instead, I propose adding a new functionality such that MediaStreamTrack would ask for the source to send a new frame when a new sink is added. This is a completely Chrome side solution, and doesn't cause any state changes in MediaStream or blink. The initial CL can be seen on https://codereview.chromium.org/1829193003/. Let me know WDYT.
,
Mar 28 2016
,
Mar 29 2016
Asking here since there's a good change it'll be lost in the review: Is there an issue to make the matching change to the spec? If this CL does what I think it does, it's the opposite of how I thought https://github.com/w3c/mediacapture-fromelement/issues/29 was going to be resolved.
,
Mar 29 2016
Note that this doesn't hold onto last frame in MediaStreamTrack or change state. It propagates RequestRefreshFrame() calls down to the Source when a new Sink is added, and Source decides to send a refresh frame or not. It was a part of the plan on issue 486274 about tab capture. I decided to take the same approach to canvas capture so that it solves interoperability issues with Firefox in those examples and we don't have the side effects of holding onto the last frame in the MediaStreamTrack. I think this solution is the ideal to address at this point, unless MediaStream holding onto frame is defined in the spec and Firefox or Chrome changes implementation. I can easily change RequestRefreshFrame() overrides in canvas capture to change the behavior then. There isn't an issue to make the change in the spec, since AFAIK there isn't any description of MediaStreamTrack behavior, holding onto frames or adding sinks on mediacapture-main spec. I am not sure if tab capture follows a spec, maybe miu@ can help on that. |
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Mar 26 2016