Update of /cvsroot/q-lang/q-xine/examples
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27332
Modified Files:
framegrab2.q
Log Message:
eliminate Q-Midi dependency, use standard system timer instead
Index: framegrab2.q
===================================================================
RCS file: /cvsroot/q-lang/q-xine/examples/framegrab2.q,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** framegrab2.q 5 Oct 2007 09:40:32 -0000 1.2
--- framegrab2.q 23 Feb 2008 11:10:02 -0000 1.3
***************
*** 1,6 ****
! import ggi, xine, midi, system;
!
! def REF = midi_open "Timer";
def MPEGS = glob "*.mpg";
--- 1,4 ----
! import ggi, xine, system;
def MPEGS = glob "*.mpg";
***************
*** 9,16 ****
/* Another demo for the framegrabber interface, which shows how to play a
! video in a GGI window at normal playback speed. IMPORTANT: Uses the Q-Midi
! module for timing purposes, as the standard system timing functions are
! often woefully inadequate for realtime operation. Therefore you must have
! MidiShare installed and running to make this work. :( */
private loop X VIS T0, snapshot X VIS T0;
--- 7,13 ----
/* Another demo for the framegrabber interface, which shows how to play a
! video in a GGI window at normal playback speed. NOTE: You'll need a decent
! timer resolution to make this work (recent systems with gettimeofday/
! nanosleep should usually be ok). */
private loop X VIS T0, snapshot X VIS T0;
***************
*** 33,43 ****
snapshot X:XineHandle VIS:GGIVisual ()
= ggi_put_box VIS (0,0) (W,H) PIXELS || ggi_flush VIS ||
! (VPTS,midi_time)
where (VPTS,W,H,PIXELS) = xine_get_video_frame X;
snapshot X:XineHandle VIS:GGIVisual (VPTS0,T0)
! = ggi_put_box VIS (0,0) (W,H) PIXELS || ggi_flush VIS ||
(VPTS,T)
where (VPTS,W,H,PIXELS) = xine_get_video_frame X,
! DT = (VPTS-VPTS0)/90000*1000,
! T = midi_wait REF (T0+round DT);
--- 30,41 ----
snapshot X:XineHandle VIS:GGIVisual ()
= ggi_put_box VIS (0,0) (W,H) PIXELS || ggi_flush VIS ||
! (VPTS,time)
where (VPTS,W,H,PIXELS) = xine_get_video_frame X;
snapshot X:XineHandle VIS:GGIVisual (VPTS0,T0)
! = sleep (T-time) ||
! ggi_put_box VIS (0,0) (W,H) PIXELS || ggi_flush VIS ||
(VPTS,T)
where (VPTS,W,H,PIXELS) = xine_get_video_frame X,
! DT = (VPTS-VPTS0)/90000,
! T = T0+DT;
|