[vlc-devel] [PATCH 00/17] Restart the display module on format changes

Steve Lhomme robux4 at ycbcr.xyz
Mon Nov 23 13:33:50 CET 2020


On 2020-11-20 21:03, Thomas Guillem wrote:
> 
> 
> On Fri, Nov 20, 2020, at 15:44, Steve Lhomme wrote:
>> As previously discussed, in push it's possible added filters will change the
>> output of the filter chain(s). The display may be able to cope with the change
>> but in case it doesn't we need to restart the display.
>>
>> This patchset adds support for this (worst case) scenario. If the last filter
>> chain output is different than the previous one, the display is restarted, no
>> matter what.
>>
>> The restart is done transparently for the decoder and the filters. When a
>> change is detected the pre-renderer code returns with a display_restart flag
>> set and no wait. The vout thread loop checks that and restarts the display
>> module. The last decoded picture is still kept for the next display.
>>
>> There can be some time between the time the old display is removed and the new
>> one is added and displays the new picture. So there is a display glitch. It's
>> different than the window glitch the push was supposed to get rid of but still
>> a glitch.
> 
> How to avoid this glitch? Add a RESTART control?  Does it happen with OpenGL?

I don't see how OpenGL would be immune from this. The display module is 
closed at some point so it's not rendering anything. Only the window/UI 
remains.

In the current Qt GUI it's not visible as when playing a video the UI 
becomes black (not sure if it's intended or some settings I have). It's 
clear when using a standalone window (which is not black).

Yes, a control or callback to notify the source format of the display 
module has changed would allow more seamless transitions. A patch Romain 
already sent does that. The new input is proposed to the display, it 
tells which input it will really want (just like we do in Open) and a 
converter is eventually added.

If the display can't find a suitable format for the given input it could 
refuse it and we fall back to restarting the display, as done in this 
patchset.

>>
>> This patchset and some previously set patches can be found here
>> https://code.videolan.org/robUx4/vlc/-/tree/hevc_interlace/33
>>
>> I tested with an HEVC interlaced source where adding the deinterlacing filter
>> double the height of the picture.
>>
>> Steve Lhomme (17):
>>    video_output: avoid potential double release of displayed.current
>>    video_output: rework the decision to use the next picture to display
>>    video_output: reindent
>>    video_output: keep the displayed.current in frame by frame if next is
>>      not ready
>>    video_output: remove always NULL displayed.next
>>    video_output: move the first picture reading in frame by frame/regular
>>      code
>>    video_output: remove decoded timestamp variable
>>    video_output: add description of the "source" sub-structure
>>    video_output: set filter.changed when an aspect-ratio/crop change is
>>      detected
>>    video_output: update displayed.current directly in
>>      ThreadDisplayPreparePicture()
>>    video_output: handle the filter change in ThreadDisplayPrerenderNext()
>>    vout_wrapper: constify the input video_format
>>    video_output: group the code to setup and load the display module in a
>>      function
>>    video_output: group the code to release/unload the display module in a
>>      function
>>    video_output: do the VoutFixFormat in vout_ChangeSource()
>>    video_output: initialize the filter chains with their default format
>>    video_output: restart display after filter change
>>
>>   src/video_output/video_output.c | 349 ++++++++++++++++++++------------
>>   src/video_output/vout_private.h |   2 +-
>>   src/video_output/vout_wrapper.c |   2 +-
>>   3 files changed, 224 insertions(+), 129 deletions(-)
>>
>> -- 
>> 2.26.2
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list