[vlc-devel] [RFC PATCH 1/2] core: add vlc_player_t (input manager)

Romain Vimont rom1v at videolabs.io
Mon Sep 17 10:16:35 CEST 2018


On Fri, Sep 14, 2018 at 04:32:12PM +0300, Rémi Denis-Courmont wrote:
> Le jeudi 6 septembre 2018, 14:11:31 EEST Thomas Guillem a écrit :
> > +/**
> > + * Get the started state.
> > + *
> > + * @param player locked player instance
> > + * @return true if the player is started (vlc_player_Start() succeeded and
> > + * vlc_player_cbs.on_playback_event didn't send a stopped/dead event).
> > + */
> > +VLC_API bool
> > +vlc_player_IsStarted(vlc_player_t *player);
> 
> const? Ditto following functions.

Since C (contrary to C++) has no "logical const" (and no "mutable"
keyword for fields that do "not affect the externally visible state of
the class" (1)), as a general rule I would say that the
"this"-equivalent argument should never be a pointer to const (at least
I personnaly try to stick to it).

Otherwise, a change in implementation details (like adding lazy
evaluation, cache, internal mutexes, etc) would require a change of the
function signature in the API (unless implementation adds an unnecessary
level of indirection).

(1) <https://en.cppreference.com/w/cpp/language/cv>


More information about the vlc-devel mailing list