[vlc-devel] [PATCH] Add marq filter to libvlc

Cyril MATHE cmathe at actech-innovation.com
Mon Jun 22 16:48:23 CEST 2009


> This structure name does not follow the usual libvlc naming scheme.
> 
maybe something like libvlc_video_marq_t ? 

> Plus, exposing a direct structure is a bit suspicious, especially in
> this case where an option is being used to. And it is highly likely
> that user will forget to free() the psz_text member of this structure.
> 
Libvlc user have to be aware of that, doesn't he ?
> What about something like:
> 
> libvlc_video_set_marq_text(const char * text);
> char * libvlc_video_get_marq_text(const text); // Caller has to free()
> 
> libvlc_video_set_marq_option(libvlc_video_marq_option_t option,
> libvlc_video_marq_value_t value);
> libvlc_video_get_marq_option(libvlc_video_marq_option_t option,
> libvlc_video_marq_value_t value);
> 
> libvlc_video_marq_value_t being a int.
> 
> Pierre.

I had done something like this before but fenrir and j-b prefered a
solution with a unique structure and two functions. It was :
libvlc_video_get_marq() //get marq options
libvlc_video_set_marq(b_enable) //enable or disable marq
libvlc_video_set_marq_option (libvlc_video_marq_option_t option, int
value, char * psz_text) //set a marq option

With your solution there is one function for int options and one for
char * options, but in both we have to deal with marq enabling. I don't
know if it's really a problem but I noticed it.




More information about the vlc-devel mailing list