Bug 48824

Summary: [GStreamer] pause webkitvideosink during fullscreen video playback
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: menard, slomo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
proposed patch xan.lopez: review+

Description Philippe Normand 2010-11-02 02:19:13 PDT
Because the fullscreen video sink (autovideosink) takes the whole screen estate anyway and it doesn't make much sense to have the webkitvideosink rolling if it's not visible
Comment 1 Sebastian Dröge (slomo) 2010-11-02 02:40:45 PDT
The current video sink pipeline is essentially like:

         ----- webkitvideosink
tee --|
         ----- fullscreenvideosink

right?

So there are two possibilities here. Either you only link in the required sink when it's required or you add a "do nothing" mode to the sinks where they get the buffers but don't display them.

Linking only when required is probably the cleaner and better solution but requires some work. You have to add an element before the tee (or a data/event probe on the tee's sinkpad) to keep track of the currently configured segment, running time, etc. And then when linking in the new sink you have to tell the sink about the segment and the running time via multiple newsegment events (details follow when you need them). Also you have to use pad-blocks for the re-linking, otherwise stuff will explode because the tee is not linked anywhere.
Comment 2 Philippe Normand 2010-11-02 02:46:55 PDT
I had some success adding identity before webkitvideosink and dropping the buffers when required. So the video appears paused in the webkitvideosink while autovideosink in fullscreen works fine.

When I close the fullscreen window I configure identity to let buffers pass through again.

I agree this is probably not the best solution though ;)
Comment 3 Philippe Normand 2010-11-02 02:56:45 PDT
(In reply to comment #1)
> The current video sink pipeline is essentially like:
> 
>          ----- webkitvideosink
> tee --|
>          ----- fullscreenvideosink
> 
> right?
> 

Well I add the fullscreen videosink (autovideosink) only when required (enterFullscreen) and I remove it during exitFullscreen().
Comment 4 Sebastian Dröge (slomo) 2010-11-02 03:01:08 PDT
(In reply to comment #3)
> Well I add the fullscreen videosink (autovideosink) only when required (enterFullscreen) and I remove it during exitFullscreen().

And you don't get any interesting problems with QoS or A/V sync or warnings about missing newsegment events?
Comment 5 Philippe Normand 2010-11-02 03:07:36 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > Well I add the fullscreen videosink (autovideosink) only when required (enterFullscreen) and I remove it during exitFullscreen().
> 
> And you don't get any interesting problems with QoS or A/V sync or warnings about missing newsegment events?

In enterFullscreen() I get the current position, format, rate, start/stop values and create a new-segment event that I push to the new tee srcpad.

Haven't noticed issues yet, IIRC you reviewed that code :)
Comment 6 Philippe Normand 2010-11-02 07:10:46 PDT
Created attachment 72660 [details]
proposed patch
Comment 7 Alexis Menard (darktears) 2010-11-02 13:58:13 PDT
Comment on attachment 72660 [details]
proposed patch

I tested that patch and it works like a charm.
Comment 8 Xan Lopez 2010-11-24 05:35:06 PST
Comment on attachment 72660 [details]
proposed patch

Seems reasonable.
Comment 9 Philippe Normand 2010-11-24 09:50:37 PST
Committed r72679: <http://trac.webkit.org/changeset/72679>
Comment 10 Philippe Normand 2010-11-24 09:53:59 PST
I meant http://trac.webkit.org/changeset/72680 :)