[MPlayer-G2-dev] new release: pre38

Arpi arpi at thot.banki.hu
Sat Aug 2 23:18:52 CEST 2003


Hi,

> On Sat, Aug 02, 2003 at 01:31:58AM +0200, Arpi wrote:
> > - new global codec flag: 'demux' (you should add it to mpeg12 in codecs.conf!!)
> >   it means that demuxer will be called by the codec, instead of vf_vd.c
> >   it also solved the ds_get_pack() FIXME things in vd_*.c files
> > 
> > Note the last point, unless you add 'flags demux' to mpeg12 codecs.conf
> > entry it won't work!
> 
> Can you explain in a little bit more detail how this works vs. how the
> last release worked?  What is the difference between the sequence of
> calls with and without 'flags demux'?  (I'm trying to finish my gif
> ports to pre37, so I want to know how I have to change my code.)
> 
> --Joey

In previous versions, every video codec's (vd_*.c) decode() function began
with such line:

    len=ds_get_packet(sh->ds,&data); // FIXME

In g1, the codec's decode() was called with the compressed data packet
(pointer & len) of a single frame. It limited codecs to 1:1 mapping between
demuxed packets and output frames. And it worked well for almost all codecs.

Only a few codec support 'truncated data', ie you can pass a fragment of a
compressed frame packet to the codec, and it will report 'i want more data'
until it gets enough. libmpeg2 0.3.x is such thing, and libavcodec also
supports this mode. It's interesting for raw formats, where the demuxer
cannot determine the frame boundaries, just can pass fragments to codec, and
let teh codec decide where a compressed frame ends.

So, i've added support for this in g2 at first day, by allowing the video
codec call the demuxer when they want, just like the audio codecs do since
the first day of g1. So, in g2 (up to prev. release) every video codec had
its own call to demuxer to get a cmpressed frame.

But I found it difficult to handle PTS calculations (transform timestamp
data from demuxer to vf_vd.c) if the codec calls teh demuxer, so i've moved
it back to core (actually vf_vd.c) and only the selected (flags demux) codecs
are allowed to mess with demuxer themself. It also helped compatibility with
g1 codec api. And since libmpeg2 of g2 is such thing, it needs 'flags demux'


A'rpi / Astral & ESP-team

--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu



More information about the MPlayer-G2-dev mailing list