[vlc-devel] [PATCH 08/13] player: add the timer API

Thomas Guillem thomas at gllm.fr
Thu Aug 22 17:46:46 CEST 2019



On Thu, Aug 22, 2019, at 17:12, Rémi Denis-Courmont wrote:
> Le torstaina 22. elokuuta 2019, 12.06.00 EEST Thomas Guillem a écrit :
> > On Wed, Aug 21, 2019, at 19:28, Rémi Denis-Courmont wrote:
> > > Le keskiviikkona 21. elokuuta 2019, 17.13.59 EEST Thomas Guillem a écrit :
> > > > Any interface or control modules could request a timer from the player.
> > > > This> > 
> > > > player timer is like the player event listener except that:
> > > >  - It is only used to receive time update
> > > >  
> > > >  - The timer is not locked by the player lock. Indeed the player lock
> > > >  can be
> > > > 
> > > > too "slow" (it can be recursive, it is used by the playlist, and is it
> > > > held
> > > > when sending all events). So it's not a good idea to hold this lock for
> > > > every frame/sample updates.
> > > > 
> > > >  - The minimum delay between each updates can be configured: it avoids
> > > >  to
> > > > 
> > > > flood the UI when playing a media file with very high fps or very low
> > > > audio
> > > > sample size.
> > > 
> > > I don't think that works.
> > 
> > cf. Qt implementation.
> 
> I don't think any existing implementation around the clumsy existing API is a 
> good reference.

What is clumsy about this API ?

> 
> > > A UI would typically want to know when the clock crosses a certain
> > > threshold, e.g. everytime the value of lround(play_time / CLOCK_FREQ)
> > > changes. In other words, it wants to know when to replace 00:00 with
> > > 00:01.
> > 
> > It can't work, some inputs have audio samples size that are bigger than one
> > seconds,
> 
> I did write "e.g. (...) CLOCK_FREQ". The threshold could be whole second, 
> whole frame interval, whole slider pixel, or whatever. Point is that typically 
> GUI wants to know when a play time interval starts, rather than the play time 
> poll at a regular interval.

What do you mean with "when a play time interval starts" ?

In my Qt example, the UI receives time updates,every few ms (depending on the input type), or when discontinuity/change_rate happens. Then the UI is free to setup its own timer to interpolate the last time received to the current date. So the UI is free to do what you said, updating the time every few seconds/ms/pixels...

> 
> If user seeks to 00:12:42.931, the UI wants to update the display at 
> 00:12:43.000, not at 00:12:43.931.

> 
> -- 
> レミ・デニ-クールモン
> http://www.remlab.net/
> 
> 
> 
> _______________________________________________
> 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