[MPlayer-G2-dev] Re: core API - was G2 CLI/GUI

Andriy N. Gritsenko andrej at lucky.net
Tue May 13 13:34:04 CEST 2003


    Hi, Balatoni Denes!

Sometime (on Monday, May 12 at 23:18) I've received something...
>> you have to define the options in the filters, ao/vo plugins, demuxers,
>> so the external (G)UI will know what kind of parameters and how it can pass
>> to the layers.

>> in g2 core it only means a struct definition and such struct filled with
>> data inside the modules/plugins.

>That sounds good indeed.

>To summarize (for myself at least) all plugins should have functions like this 
>(perhaps trough control() fn or just function pointers or whatever you are 
>thinking):

>parameters * get_available_parameters_and_their_defaults()

it's the structure plugin->opts, no need for extra API.

>instance* new_plugin_instance(parameters*)

I've called it pl_get_plugin() but parameters will be set later by
calling some cfg_parse_params() - see Arpi's letter.

>int put_parameters_and_reinit_(instance*, parameters*)

Something alike vf->control(vf,VFCTRL_SET_PARAMS). If we will unify all
common modules fields then it may be plugin->control().

>int message_to_plugin(instance*, int message id, void * parameters)

It already exists - it's control() for af and vf.

>int do_stuff_the_plugin_is_for(instance*  )
>+functions specific to plugin type

It's very specific - see video/vf.h and audio/libaf/af.h for example.

>----------------------------------
>And g2 core would have functions roughly like this:

>mplayer_init()

No. Init will do main() function - it's too application specific.

>plugin** get_available_plugins_and_parameters()

All modules list must be in UI-independent config tree to be available
for UI so we don't need that API.

>/*** stuff for playback ***/

>/* returns title, author, length, suggested demuxer,  audio/video codec + 
>parameters, suggested vo ao, filterchains */
>info* mplayer_get_info_about_medium(URL)

>/* URL, demuxer wanted , different filterchainf + filter's parameters, vo ao
> */
>medium* mplayer_open_medium(info * )

>/* decode to selected ao+vo with the options set*/
>int mplayer_decode_n_frames(medium* , frame number)

>/* some usefull functions needed during playback by an ui */
>int mplayer_seek(medium*)
>int mplayer_get_playback_status(medium*) /* time,pos etc */
>int mplayer_send_message(plugin*, messageid, msg_parameter*) /* if ui eg. 
>wants to put something on the OSD, or move the subtitle down */

Bad - it seems to be very mplayer specific.


>/*** stuff for customizing info structure ***/

>/* manipulate (append, insert, remove, check, set filter/options) 
>audio/video/osd/whatever filterchain or separate plugin(if not in any chain) 
>for an opened medium */

>mplayer_fuck_with_filterchain(info * , chain_id )   
>mplayer_fuck_with_plugin(info *, A_PLUGIN_THAT_IS_NOT_IN_ANY_CHAIN)

  It's the subject of argues now, I don't know that yet. It seems you
don't have any solution so just wait until we get agreement with that
API, please.

    Andriy.



More information about the MPlayer-G2-dev mailing list