[MPlayer-dev-eng] Writing A New File Demuxer

Mike Melanson melanson at pcisys.net
Thu Jan 31 16:14:17 CET 2002


Hi team,
	I want to implement a new file demuxer (and still have to finish
the FILM one). Both of these have both video and audio, unlike the
video-only FLI files for which I've written a decoder before. I just want
to see if I have some general concepts straight. Correct me if I have
anything wrong.

	First, the demuxer opens the file. In doing so, it creates new
sh_video_t and sh_audio_t structures. It parses information from the file
and loads up a bunch of fields in those structures, e.g., width, height,
framerate, codec for video and samplerate, samplesize, channels, codec for
audio. Question: Is it necessary to load up the bitmapinfo and waveheader
structure fields in these stream headers? I didn't bother in the FLI
decoder and it didn't seem to matter. Was that because I didn't bother to
use it in the FLI video decoder? Then, build a private chunk index for the
sequence of compressed data chunks in the file, marking whether they're
audio or video chunks, and store the index in demuxer->priv.

	Next, when the demuxer's fill_buffer() routine is called, load the
next chunk in the file, as privately tracked by the demuxer, determine
whether it's an audio or video chunk and read it into the appropriate
stream using ds_read_packet(), passing either demuxer->audio or
demuxer->video depending on the chunk type.

	As for seeking, it doesn't look like this new format has any
support for key frames. The FILM format may, but I haven't figure out
exactly which bit in the index may refer to a key frame.

	Do I have that right? Any key points missing? Thanks...
--
	-Mike Melanson




More information about the MPlayer-dev-eng mailing list