[PD-cvs] externals/pidip/modules pdp_yqt.c,1.3,1.4

sevyves at users.sourceforge.net sevyves at users.sourceforge.net
Fri Oct 24 04:40:20 CEST 2003


Update of /cvsroot/pure-data/externals/pidip/modules
In directory sc8-pr-cvs1:/tmp/cvs-serv5522

Modified Files:
	pdp_yqt.c 
Log Message:
Added frame rate

Index: pdp_yqt.c
===================================================================
RCS file: /cvsroot/pure-data/externals/pidip/modules/pdp_yqt.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pdp_yqt.c	24 Oct 2003 01:42:33 -0000	1.3
--- pdp_yqt.c	24 Oct 2003 02:40:18 -0000	1.4
***************
*** 23,26 ****
--- 23,28 ----
  #include "pdp.h"
  #include "pdp_llconv.h"
+ #include "time.h"
+ #include "sys/time.h"
  #include <quicktime/lqt.h>
  #include <quicktime/colormodels.h>
***************
*** 36,43 ****
  
      t_outlet *x_outlet0;
!     t_outlet *x_outlet1;
!     t_outlet *x_outlet2;
!     t_outlet *x_outlet3;   /* audio left channel  */
!     t_outlet *x_outlet4;   /* audio right channel */
  
      int packet0;
--- 38,46 ----
  
      t_outlet *x_outlet0;
!     t_outlet *x_curframe;
!     t_outlet *x_nbframes;
!     t_outlet *x_framerate;
!     t_outlet *x_ol;   /* audio left channel  */
!     t_outlet *x_or;   /* audio right channel */
  
      int packet0;
***************
*** 46,49 ****
--- 49,54 ----
      unsigned int x_vwidth;
      unsigned int x_vheight;
+     t_int x_cursec;
+     t_int x_framescount;
  
      bool loop;
***************
*** 51,55 ****
      unsigned char * qt_rows[3];
  
!     unsigned char * qt_frame;
      quicktime_t *qt;
      int qt_cmodel;
--- 56,60 ----
      unsigned char * qt_rows[3];
  
!     unsigned char *qt_frame;
      quicktime_t *qt;
      int qt_cmodel;
***************
*** 125,129 ****
  	quicktime_set_cmodel(x->qt, x->qt_cmodel);
  	x->initialized = true;
! 	outlet_float(x->x_outlet2, (float)quicktime_video_length(x->qt,0));
  
      }
--- 130,134 ----
  	quicktime_set_cmodel(x->qt, x->qt_cmodel);
  	x->initialized = true;
! 	outlet_float(x->x_nbframes, (float)quicktime_video_length(x->qt,0));
  
      }
***************
*** 176,179 ****
--- 181,185 ----
    short int* data;
    t_pdp* header;
+   struct timeval etime;
  
      if (!(x->initialized)){
***************
*** 229,234 ****
          break;
      }
      
!     outlet_float(x->x_outlet1, (float)pos);
      pdp_packet_pass_if_valid(x->x_outlet0, &object);
  
--- 235,252 ----
          break;
      }
+ 
+     if ( gettimeofday(&etime, NULL) == -1)
+     {
+         post("pdp_fcqt : could not get time" );
+     }
+     if ( etime.tv_sec != x->x_cursec )
+     {
+        x->x_cursec = etime.tv_sec;
+        outlet_float(x->x_framerate, (float)x->x_framescount);
+        x->x_framescount = 0;
+     }
+     x->x_framescount++;
      
!     outlet_float(x->x_curframe, (float)pos);
      pdp_packet_pass_if_valid(x->x_outlet0, &object);
  
***************
*** 318,326 ****
  
      x->x_outlet0 = outlet_new(&x->x_obj, &s_anything);
!     x->x_outlet1 = outlet_new(&x->x_obj, &s_float);
!     x->x_outlet2 = outlet_new(&x->x_obj, &s_float);
  
!     x->x_outlet3 = outlet_new(&x->x_obj, &s_signal);   /* audio left channel  */
!     x->x_outlet4 = outlet_new(&x->x_obj, &s_signal);   /* audio right channel */
  
      x->packet0 = -1;
--- 336,345 ----
  
      x->x_outlet0 = outlet_new(&x->x_obj, &s_anything);
!     x->x_curframe = outlet_new(&x->x_obj, &s_float);
!     x->x_nbframes = outlet_new(&x->x_obj, &s_float);
!     x->x_framerate = outlet_new(&x->x_obj, &s_float);
  
!     x->x_ol = outlet_new(&x->x_obj, &s_signal);   /* audio left channel  */
!     x->x_or = outlet_new(&x->x_obj, &s_signal);   /* audio right channel */
  
      x->packet0 = -1;






More information about the Pd-cvs mailing list