[vlc-devel] [PATCH 0/5] variables: add VLC_VAR_LIST
Rémi Denis-Courmont
remi at remlab.net
Thu Nov 3 10:51:25 CET 2016
Le 2016-11-03 11:16, Thomas Guillem a écrit :
> This patch-set adds the possibility to store a list of
> int/bool/float/string/coords inside a VLC variable. The first 3
> patches rename
> old List functions that are only used for Choice variables
> ("video-es" for
> example) in order to avoid confusion with the new VLC_VAR_LIST.
That looks like a terrible idea to me.
If you need atomic read-modify-write, then this just won´t work,
because var_GetAndSet() will never scale up to it.
If you don´t need atomic read-modify-write, then why bother with VLC
variables. That subsystem has all the disadvantages of an abstract type
system:
- loss of compile-time sanity checks,
- artificially introduced error cases,
- lack of debugger support,
- boiler plate code,
- etc
and none of the benefits.
The only benefit of the VLC variables subsystem is its integration with
configuration items.
So re-adding list support seems really counter-productive to me.
> This new list variable could be used to get/set atomically (and maybe
> increment/decrement in a future patch) a set of values. The main
> purpose is to
> store the 3 yaw/pitch/roll variables, that will be needed for 360
> patches,
> inside one variable in the vout.
No, that won´t work as noted above.
You are better off defining a proper typed structure and defining
dedicated vout functions.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list