Page 1 of 1

About vlc_module_begin

Posted: 23 Apr 2008 08:03
by typeb
Hi,

Could anyone explain "vlc_module_begin" for me?
I can't understand how it works.

And I don't know how these functions work:
/* We also consider the main program as a module (useful for config stuff) */
int vlc_entry__main( module_t* );

/* Add stuff here */
int vlc_entry__memcpymmx( module_t* );
int vlc_entry__i420_rgb_mmx( module_t* );
int vlc_entry__i422_yuy2_mmx( module_t* );
int vlc_entry__i420_ymga_mmx( module_t* );
int vlc_entry__i420_yuy2_mmx( module_t* );
int vlc_entry__memcpymmxext( module_t* );
int vlc_entry__memcpy3dn( module_t* );
int vlc_entry__live555( module_t* );
int vlc_entry__mux_ts( module_t* );

Any answer would be appreciated!

Re: About vlc_module_begin

Posted: 23 Apr 2008 11:05
by dionoea
Could you be a bit more specific? Are you trying to add a new module to VLC?

Re: About vlc_module_begin

Posted: 23 Apr 2008 11:27
by typeb
No, I'm not going to add a module.

I just read the code.

I can't understand the way it works.

I debug the program, when it goes to "__module_LoadMain" function

after the last line --"AllocateBuiltinModule( p_this, vlc_entry__main )"

I don't know why it goes to file "libvlc.h" line 1177, where "vlc_module_begin" exists.

I just want someone can help me to understand that.

Thanks :)

Re: About vlc_module_begin

Posted: 23 Apr 2008 11:46
by dionoea
What VLC version are you using? (That code changed quite a bit in the dev version)

Re: About vlc_module_begin

Posted: 23 Apr 2008 11:54
by typeb
I use vlc-0.8.6e

Re: About vlc_module_begin

Posted: 23 Apr 2008 12:07
by dionoea
If you have a look at include/modules_inner.h, you can see on line 97 that it declares a new function. This function's name is defined by __VLC_SYMBOL(vlc_entry). __VLC_SYMBOL is defined a few lines above as the concatenation of "vlc_entry" with MODULE_NAME (the CONCATENATE macro inserts the double underscore). MODULE_NAME is defined by the compiler at compile time using a -D command line flag except in the case of the main libvlc module (which is the one you're looking at) where it defines the name at line 31 of src/libvlc.c. This file then includes src/libvlc.h which calls the vlc_module_begin() macro on line 1177. So we now have a valid function called vlc_entry__main. When the main plugin is initialized in the __module_LoadMain() in src/misc/modules.c, it gives that function as the second argument to the AllocateBuiltinModule() on line 327 which will then call the function on line 1212.

Feel free to ask any other questions you might have,

Re: About vlc_module_begin

Posted: 23 Apr 2008 16:28
by typeb
Thank you so much!

I got it! :)

Question about _VLC_SYMBOL error

Posted: 23 Dec 2008 16:27
by wssoh85
Hi, everyone. I have a question about the _VLC__SYMBOL. I try do so some function for modified to the vlc.c file of vlc-0.6.8f, and when libvlc.h is included inside the file and make, those error come out. The error message is as below.

Code: Select all

src/libvlc.h:1177: warning: data definition has no type or storage class src/libvlc.h:1177: warning: type defaults to ‘int’ in declaration of ‘DECLARE_SYMBOLS’ src/libvlc.h:1177: error: ‘__VLC_SYMBOL’ declared as function returning a function src/libvlc.h: In function ‘__VLC_SYMBOL’: src/libvlc.h:1177: error: ‘STORE_SYMBOLS’ undeclared (first use in this function) src/libvlc.h:1177: error: (Each undeclared identifier is reported only once src/libvlc.h:1177: error: for each function it appears in.) src/libvlc.h:1177: error: ‘p_module’ undeclared (first use in this function)
Can anyone tell me that what happen here? how to solve this error?
in the libvlc.h:1177, the header is call a function call 'vlc_module_begin'
please help me...

regards,
wssoh :?: