About vlc_module_begin

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
typeb
New Cone
New Cone
Posts: 5
Joined: 15 Apr 2008 10:35

About vlc_module_begin

Postby typeb » 23 Apr 2008 08:03

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!

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: About vlc_module_begin

Postby dionoea » 23 Apr 2008 11:05

Could you be a bit more specific? Are you trying to add a new module to VLC?
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

typeb
New Cone
New Cone
Posts: 5
Joined: 15 Apr 2008 10:35

Re: About vlc_module_begin

Postby typeb » 23 Apr 2008 11:27

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 :)

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: About vlc_module_begin

Postby dionoea » 23 Apr 2008 11:46

What VLC version are you using? (That code changed quite a bit in the dev version)
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

typeb
New Cone
New Cone
Posts: 5
Joined: 15 Apr 2008 10:35

Re: About vlc_module_begin

Postby typeb » 23 Apr 2008 11:54

I use vlc-0.8.6e

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: About vlc_module_begin

Postby dionoea » 23 Apr 2008 12:07

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,

typeb
New Cone
New Cone
Posts: 5
Joined: 15 Apr 2008 10:35

Re: About vlc_module_begin

Postby typeb » 23 Apr 2008 16:28

Thank you so much!

I got it! :)

wssoh85
Blank Cone
Blank Cone
Posts: 20
Joined: 20 Dec 2008 10:52

Question about _VLC_SYMBOL error

Postby wssoh85 » 23 Dec 2008 16:27

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 :?:


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 10 guests