[vlc-devel] [PATCH 1/3] core: add a variable type for 3D angles

Rémi Denis-Courmont remi at remlab.net
Tue Feb 28 21:16:38 CET 2017

Le tiistaina 28. helmikuuta 2017, 9.25.47 EET Steve Lhomme a écrit :
> > This is really three floating point values. If you care about atomicity,
> > you really shouldn´t be using variables in any case given the design
> > limitations in event handling. If you don´t, then you can use three
> > variables.
> It depends what you mean by atomicity. If you mean that all 3 values
> are updated at the same time, yes this is important. Just like it is
> when you move the mouse, you don't want your window(video) to go up
> and then sideways.
> What kind of limitations are we talking about ?

AFAICT, there is no generic race-free way to keep track of a variable. In 
particular, there are no ways to atomically get the current value and install 
a callback.

There may be tricks that work in some constrained scenarii.

> The order wouldn't matter too much as it's relative values. If you can write
> a value, then another value overwriting the previous one would be a problem.
> The sensor data may not come in the UI thread and at high refresh
> rate.
> > And generally, please no more VLC variable base types. We need to draw a
> > line somewhere.
> I agree that 3 floats in a union is having an impact on all the rest.

Well, thing is, variables are a convenient programming "shortcut" insofar as 
they are automatically visible to Lua scripts (and previously Laurent's RPN 
a.k.a. FenrirPHP), the skin engine and have wrappers in Qt.

But that only works if you use an existing variable type on an existing 
object. If you create a new type, your work gets worse rather than better.

> On the other hand I don't really see another mechanism to pass data to
> the vout thread asynchronously.

vout_ChangeAspectRatio() ?


More information about the vlc-devel mailing list