[MPlayer-dev-eng] demuxer documentation

Alban Bedel albeu at free.fr
Mon Feb 18 08:26:23 CET 2002


Hi Charles Henrich,

on Sun, 17 Feb 2002 20:40:14 -0800 you wrote:

> So is there any text anywhere out there to help out with writing a demuxer?
> Anyone?  Bueller?  Bueller?
> 

Sadly there is no document about that, but it's not very hard. A demuxer is mainly
3 functions. An open function that create an sh_video or sh_audio for each stream
found. A fill_buffer function, this one read a packet of data (demux_packet_t) and
put it the corresponding demuxer_stream (with ds_add_packet) or throw it.
And finnally a seek function, wich take for argument the demuxer, a float and an integer.
The float is usually a time in seconds, the integer is some flags. bit 1 indicate that the 
given time is absolute (relative to the begining), the bit 2 indicate that the float is not a 
time but percentage (ie 0 is the begining and 1 is the end). Don't forget to call 
resync_audio_stream once you seeked if you have an audio stream. And think
that you get your data from a stream wich is no always seekable, so your demuxer
shouldn't seek the stream.

Ok I hope it's enougth to get you started, also look the alredy existing demuxer. The
demux_audio is the simpler. By curiosity, wich format are you interested in ?
	Albeu



More information about the MPlayer-dev-eng mailing list