[MPlayer-G2-dev] mp-G2: play_frame()
Andriy N. Gritsenko
andrej at lucky.net
Thu May 8 14:49:59 CEST 2003
Hi!
It's only concept, not really workink subroutine. Sorry, I don't have
enough time now to do all researches on G2 streaming but someone here are
working on that problem too so I think it will be very useful to join our
thoughts. :)
Yesterday's evening I've spent some time to write play_frame() a bit.
See it in attachment. It allows multiple play contexts and multiple audio
or video streams, has no static vars, and is independent of other parts
of G2 as much as possible. Some comments:
1) I didn't do some audio/video specific parts since I didn't get yet how
to pull audio and video frames from chain, sorry.
2) I've changed skiplimit variable to float. Some time ago I wanted to
run mplayer with -skiplimit 0.2 since it may allow me significally
decrease number of dropped valuable frames despite of little A-V
desync.
3) Many applications may have more than one play context (for example,
player with multiscreen ability, video editor, streaming server, etc.)
so have static variables (such as sh_audio or video_out) isn't good
solution. So I've implemented struct play_context. :)
4) Since it's allowed to have more than one video or audio stream, each
stream has to have his own sync mechanism, it dissalows to have static
vars so I've moved statics for that into sh_audio and sh_video (may be,
we will implement some struct chain_t instead of sh_audio_t/sh_video_t
for unification later?). These variables are:
double skipcnt; // counter how many skips are possible now
double pts; // presentation timestamp of last gotten frame
double corr; // correction time for this stream chain
int skipped; // number of skipped (dropped) non-duplicate frames
int dupped; // number of inserted duplicate frames
5) play_frame() will work in any application (player, encoder, etc.) with
no changes and hacks. :)
6) Input chain (from source stream to play_frame subroutine) have not
push frame to output chain (audio/video out or muxer) directly but
play_frame() will do that instead. It's because only play_frame() may
decide if frame has to be dropped or duplicated. Anyway each input
chain must have appropriate output chain. :)
Any questions/comments are welcomed but don't ask me wrote all missed
stuff - I have no enough time for researches on G2 streams now and they
are too complex to solve it without knowing the details. Sorry for that.
With best wishes.
Andriy.
More information about the MPlayer-G2-dev
mailing list