[MPlayer-dev-eng] Re: MPlayer G2

Andriy N. Gritsenko andrej at lucky.net
Tue Apr 1 14:22:42 CEST 2003


    Hi, Anders Johansson!

Sometime (on Tuesday, April  1 at 14:52) I've received something...
[.......]
>>     I thought about the same too when I did my last patch. I think it's
>> possible with that config scheme for current MPlayer/Mencoder. It is that
>> I called flexible way of config. ;)  About how identify substances - I
>> have some solution too, at least I designed loadable modules scheme for
>> my own project before. :)

>How did you solve it? Which project? do you have a link?

It's my own project, I wanted to make modular universal network client
(chat, ICQ, ftp, etc.). Unfortunately, I do it too slowly so it doesn't
finished yet. It's not present on network, sorry.

How I did solve it? :)  By very simple means. Each module has standard
init function. That function has single parameter (for queries pointer
with simple interface), and it returns pointer to own interface function.
That own interface function designed to get some "signals" (close, stop,
reinit, etc.) from core or other module. So each module may send or get
signals/messages. When module gets signal to close it have to uninit all
that was inited on start. Module has access to standard core API (one of
functions may be version/compatibility check) to perform a registration
any specific objects.

>I have been thinking of this for a while but I am not sure how far one
>should go in terms of making the interface abstract. The problem gets
>tricky one there are more than one process that needs to access the
>loaded modules. If one process unloads a module how to solve the
>problem of invalid module references (pointers)? 

Each module has only references to core API. To get a backward calls it
have to register these functions (with unified API, of course) and when
it unloaded, functions will be unregistered. So you will have no invalid
references. :)

    With best wishes.
    Andriy.



More information about the MPlayer-dev-eng mailing list