Fix the `display` stream output
Version 1
This MR is a draft attempt to pass 'slave' clocks to the stream outputs.
One of the main motivations for that is to fix the display
stream output [1].
Having clock exposed to the stream output could also be beneficial for the new
chromecast module.
The current patch-set is here to trigger discussions about the subject and eventually validate the solution presented here which, for now, is the simplest.
Once we eventually reach to an agreement that the clock API can be exposed to
libvlccore and clocks propagated to the stream output, the commits will be
cleaned up and stream out filters will be handled separately like currently
done with duplicate
(which I made first to illustrate one of the problematic).
Version 2
Try a simpler approach based on the MR reviews. Instead of forwarding the clock
via the pf_add
callbacks, lets just allow display
to create slave clocks as
this is our only use case for now. This has the benefit of being much simpler
and only require the main clock to be shared.
Given the way we currently select clocks (in the es_out at program creation).
Allowing audio master driving is still touchy, so as a consequence, the input
clock is selected by default. For now, I'm still unsure about that and would
appreciate some feedback.
Version 3
Fix the last version mainly by:
- Introducing a per-sout-instance context data structure to hold the main clock references.
- Making the clock references private
- Storing all the main clocks references (one by program)
Version 4
Dropped the idea to share the clock from the input for two main reasons:
- It broke the potential libvlc stream output API by making sout chains dependent of the input.
- It just didn't work with
--sout-keep
andgather
as the main clock reference was then outlived by the sout instance.
Instead, a main clock is created locally in every display
stream output modules. This is enough to mimic VLC 3.0 behavior. The newly integrated SetPCR
callback allows us to properly calibrate the main clock.
[1] #23220 (closed)