On Sat, 28 Jul 2001, lmwang wrote:
> Because xine have a very complex metronome control, I have confused
> how to skip video frame and control metronome if I fast forward play
> by 2x,4x,8x rate.
metronom isn't that complex, in fact, the functions you'd have to tweak
are the master clock functions which are very simple (start_clock,
stop_clock, resume_clock, adjust clock and get_current_time).
just make sure you implement a clock there that (optionally) runs 2x, 4x
or 8x faster/slower than normal and video decoder and video output will
figure out themselves which and how many frames to skip. On a really fast
machine perhaps they will not skip any frames but simply display all
frames at a higher frame rate.
> Did we need a global variable such as framerate to implement such
no global variables please, xine-lib should be re-entrant. You can simply
add one or more fields to metronom_t.
> at least I need definite such API: xine_fastforward()
yep, that looks nice already but think about the parameters, you'll need a
this pointer of type xine_t (no global variables) and probably a speed
parameter. Perhaps it'd be a nice idea to add a general function for all
these trick plays
xine_set_playback_speed (xine_t *this, int speed_mode);
#define SPEED_PAUSE 0
#define SPEED_SLOW_4 1
#define SPEED_SLOW_2 2
#define SPEED_SLOW_1 3
#define SPEED_NORMAL 4
#define SPEED_FAST_1 5
> During dvd playback, it must know some flag to know it has been
> implement, at the same time to change the situation on time.
well, basically metronom needs to know about. additionaly audio_out should
be muted for speed != SPEED_NORMAL.
> I need some global definition to implement.
> I need more advice from you or other experimental developer. Where I
> can find the general souce code or technology to get it?
all the sources are delivered with xine in the xine-lib and xine-ui
tarballs. You'll find most api documentation in the header file comments.
time is a funny concept