Bug 225511 - [GStreamer][MediaStream] Emit black frames for disabled video tracks
Summary: [GStreamer][MediaStream] Emit black frames for disabled video tracks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-07 05:53 PDT by Philippe Normand
Modified: 2021-05-10 01:08 PDT (History)
10 users (show)

See Also:


Attachments
Patch (5.76 KB, patch)
2021-05-07 05:56 PDT, Philippe Normand
calvaris: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2021-05-07 05:53:43 PDT
imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-MediaElement-disabled-video-is-black.https.html fails.
Comment 1 Philippe Normand 2021-05-07 05:56:30 PDT
Created attachment 427995 [details]
Patch
Comment 2 Xabier Rodríguez Calvar 2021-05-07 08:24:54 PDT
Comment on attachment 427995 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=427995&action=review

> Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:276
> +        pushSample(blackSample.get());

Nit (maybe for other time): wouldn't it be nice pushSample was void pushSample(GRefPtr<GstSample>&&) ?
Comment 3 Philippe Normand 2021-05-07 08:39:13 PDT
Comment on attachment 427995 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=427995&action=review

>> Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:276
>> +        pushSample(blackSample.get());
> 
> Nit (maybe for other time): wouldn't it be nice pushSample was void pushSample(GRefPtr<GstSample>&&) ?

I don't think that's possible currently because when the track is enabled the sample being pushed is not owned by the observer, but by the track that generates it. And a track can have more than one observer.
Comment 4 Philippe Normand 2021-05-07 08:52:22 PDT
Committed r277175 (237461@main): <https://commits.webkit.org/237461@main>
Comment 5 Radar WebKit Bug Importer 2021-05-07 08:53:32 PDT
<rdar://problem/77658069>
Comment 6 Xabier Rodríguez Calvar 2021-05-10 01:08:55 PDT
(In reply to Philippe Normand from comment #3)
> Comment on attachment 427995 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=427995&action=review
> 
> >> Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:276
> >> +        pushSample(blackSample.get());
> > 
> > Nit (maybe for other time): wouldn't it be nice pushSample was void pushSample(GRefPtr<GstSample>&&) ?
> 
> I don't think that's possible currently because when the track is enabled
> the sample being pushed is not owned by the observer, but by the track that
> generates it. And a track can have more than one observer.

It doesn't mean you can't create another GRefPtr<GstSample> by reffing the sampled owned by the track, right?