[vlc-devel] [PATCH] Merge PrintMsg and PrintColorMsg to avoid duplicated code

ludovic segarral at free.fr
Sat Sep 10 12:18:59 CEST 2011


About messages on stderr, I would suggest to add a new built-in singleton
object (src/misc/msgstderr.c or in src/misc/messages). This object would be
referenced in libvlc_priv_t (src/libvlc.h), in the "singleton object" part.

This object would subscribe to messages queue in libvlc_InternalInit and
unsubscribe in libvlc_InternalDestroy.

This pretty simple mecanism could be the first step to unify all loggers in
the core. Hope that this object make your LibVLC initialization changes
easier for messages part.

Would you be interested by this stuff that I could do ?


2011/9/7 Rémi Denis-Courmont <remi at remlab.net>

> Le mercredi 7 septembre 2011 01:17:35 ludovic, vous avez écrit :
> > Ok, I understand that I have to use the "message subscribers" mecanism
> > which calls "msg_callback_t  func".
> > Sorry to disturb you again with some (stupid) questions about your
> answer,
> > but I'd like to avoid a new mistake...
> > - Do you mean that I should integrate PrintMsg in a new object (solution
> 1)
> > or in the logger object (solution 2) ?
>
> I don't mean you should do anything particular. I just mean your patch is
> going against a change that I did on purpose.
>
> Ultimately, my goal is to unify all loggers in the core, and provide a sane
> LibVLC logging API. But that depends on LibVLC initialization changes,
> which I
> might not be allowed to push until the 1.3.0 merge window opens.
>
> > - If it's solution 1 : this new object could be in
> > modules/misc/mesgstderr.c ?
>
> Logging is needed before the plug-in subsystem is ready, so everything will
> need to be merged in the core.
>
> > - if it's solution 2 : - Can I try to merge TextPrint and PrintMsg ?
>
> Ultimately, they should be merged, but I am afraid this is not possible
> until
> we have one time initialization in place.
>
> >                            - Can I call vlc_Subscribe twice in
> > logger.c:Open ?
>
> You could but I suspect it will make things more complicated rather than
> simpler.
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> http://fi.linkedin.com/in/remidenis
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110910/d39f5da4/attachment.html>


More information about the vlc-devel mailing list