Page 1 of 1

Passing argument, callback to module...

Posted: 19 Apr 2014 20:00
by wcoder
Hi,

I'm writing a video-out module using libvlc 2.1.2 on debian x86, i'm analysing in-tree module to learn how this kind of module work...

vlc_module_begin ... vlc_module_end seems to be use to pass argument and may be callback

ex : add_string( "fb-chroma", NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true )
Seems to be used to change fourcc of frame buffer on fb.

on vmen in the past vmem-lock seems to be used to pass callback using :
sprintf(clock, "%lld", (long long int)(intptr_t)lock);
I don't found the module part is was replace by this
add_obsolete_string("vmem-lock") /* obsoleted since 1.1.1 */

To i need to convert fonction address to string, pass it to the module, convert it to pointer, and finalty use it ?

It's seems to be dirty\not safe... do i need to use a specific calling convention like __stdcall with COM under windows ?

Thanks for your help,

WCdr