[MPlayer-dev-eng] [RFC][PATCH] audio and video framers
Nico Sabbi
nicola_sabbi at fastwebnet.it
Sat Feb 24 23:32:52 CET 2007
This patch adds to mplayer a framer layer and 4 implementations (as
usual for mpeg* formats):
- one for mpeg1/2 video
- one for each of mpeg audio, aac, ac3 (for dts it's equally trivial but
I didn't have time).
- in theory there's support for codecs that use extradata (e.g. vorbis
would be parsable)
Demuxers need only set ds->needs_parsing=1; if possible demux_open()
will initialize the
appropriate framers/parsers and from that point onward:
- ds_add_packet() will do something like
if(ds->parser) {
demux_packet_t *dp2;
mp_parser_fill_buffer(ds->parser, dp);
while(dp2 = mp_parser_fetch_packet(ds->parser))
real_ds_add_packet(ds, dp2);
} else real_ds_add_packet(ds, dp);
- ds_free_packs() will reset the parser's buffers, so seeking will be safe.
The job of the framer is to output demux_packets containing exactly 1
frame with the correct pts;
the pts will be either:
- the one provided by the mux when available
- an interpolated value based on the properties read from the elementary
stream.
Framers can be used both in the path between demuxers and decoders and
in the path
between [m]encoder and muxers (mpeg or lavf, that need correct pts for
every frame,
not yet implemented).
In order to activate the framer you have to add -framer to your command
line, possibly with -correct-pts
(now fully supported).
Audio and video switching are not yet supported.
I'm not completely sure there aren't bugs.
I'd like to hear opinions and test reports.
Nico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: framers.diff
Type: text/x-patch
Size: 18935 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070224/d8ad548f/attachment.bin>
More information about the MPlayer-dev-eng
mailing list