[MPlayer-dev-eng] [PATCH] Clean up demuxers
Alban Bedel
albeu at free.fr
Thu Feb 21 12:49:44 CET 2002
Hi Daniel Egger,
on 21 Feb 2002 12:07:38 +0100 you wrote:
> Hija,
>
> in the sincere hope to get the demuxer system off the radar
> in profiles I rewrote the code in demuxer.c to not use
> a dispatching system based on select but to create a table
> which is used as jumping carpet.
>
> Two things I had to do though: Convert all *_fill_* routines
> to take exactly the same two parameters [demuxer_t *demux] and
> [demux_stream_t* ds]. Since some of the demuxers derive ds from
> demux and the other way round I wondered if this couldn't generally
> be made as it saves a lot of overhead.
> I also had to fix the return type to unsigned int and the declarations
> to be extern because it annoyed me to death.
>
> I'm still thinking about what to do with the tv demux special case which
> takes an if clause because the parameters are by no means equalized.
>
> Now to the good parts: By applying this simple and straight-forward
> patch I was already able to get a small improvement in both
> final code size and execution speed on Linux PPC with gcc-3.0.4 and
> think that this patch is a good base for a lot bigger improvement
> as soon as I understand that freshly added demux_demuxers and the
> rest of the system.
> On the other hand by using a table one can simply have several different
> hooks doing the same job in different ways and drive comparisons between
> them; heck if someone wants a mmx based demuxer it'd be really simple
> to activate it at runtime.
>
> Please consider this patch and give me some hints about the parameter
> situation so I can optimize the shit out of mplayer.
>
By principe I find this good but in practice you have missed some points.
First DEMUXER_TYPE_MAX. I added an option to allow forcing demuxer selection,
in case it's needed. So DEMUXER_TYPE_MAX must match the highest ,user
selectable, demuxer number. Not +1, the user will be able to end up in a stupid
situation (ie no demuxer have this number).
Then if DEMUXER_TYPE_DEMUXERS isn't numbered 18, it's because I don't want
the user to be able to force this demuxer. It's only for internal use. So I decided, that
normal demuxer will use only the first 16 bit. And special demuxers will use,
the last 16 bit. For exemple am adding support in network code to retrive pls, and m3u
playlist. For this I also need a demuxer number and I used (2<<16), for you this case
is even worse because I need a number wich will never match an existing demuxer and
the number will never be linked to any demuxer.
So now I can't see how your stuff can be used, with what I'm doing now.
Does somebody have any suggestion, because I find the idea good. But I can't see
how use it really with the last changes. Or must I find some other way for my stuff ?
Albeu
More information about the MPlayer-dev-eng
mailing list