[MPlayer-dev-eng] An attempt at libmplayer

Santanu Sinha santanu.sinha at gmail.com
Thu Sep 11 12:43:12 CEST 2008


Hi,
I am a fan and long time user of mplayer. I think the coolest media
player needs to be able to be linked with other frontends easily. So,
it would be nice to have a library based on mplayer.

I am attempting to write one based on your 1.0-rc2 source release. I
updated from svn today and saw many changes. I will try to merge them
with my code today.

Targets:
1)  A reentrant library called libmplayer.a/so with requisite header
and pkg-config files
2)  top level application completely backwards compatible with current
mplayer (and gmplayer?) but using the above libraries.

The basic idea is to have a proper set of API's to replace hacks like
DISABLE_MAIN.
The steps to do this would be:
1) Break up the main function into small blocks.
2) Factor out application and back end code.
3) Remove globals and replace by local structures.
4) Create data structure and API's for clients to easily set up
different options to mplayer
5) Search, analyze and fix re-entrancy issues for the library.

Please note that i will at first try to only breakup the main into
small functions. Then create library and applications from these
functions. Then add option editing support and so on.

I am attaching a half cooked patch that partially factors out main()
in mplayer.c. Hopefully it will bring home the idea.

Regards,
Santanu

--
Upset the established order, and everything becomes chaos. I'm an
agent of chaos. Oh and you know the thing about chaos, it's fair.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changes.patch
Type: application/octet-stream
Size: 64081 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080911/377b9ec8/attachment.obj>


More information about the MPlayer-dev-eng mailing list