Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Mar 1998 12:32:27 -0600 (CST)
From:      Jim Lowe <james@miller.cs.uwm.edu>
To:        hasty@rah.star-gate.com, luigi@labinfo.iet.unipi.it
Cc:        multimedia@FreeBSD.ORG
Subject:   Re: Video ioctl interface
Message-ID:  <199803041832.MAA09831@miller.cs.uwm.edu>

next in thread | raw e-mail | index | archive | help
Here are some diffs for the meteor driver to make things like ``hue''
controls work.  I diff'ed this stuff against what is in the -current
ports tree; but it should be applicable to other ports as well.  I
wasn't able to test the brooktree code because I don't have one of
those cards, but I included it anyway.

	-Jim
---
*** grabber-meteor.cc.ports	Wed Mar  4 11:27:46 1998
--- grabber-meteor.cc	Wed Mar  4 12:18:12 1998
***************
*** 43,48 ****
--- 43,49 ----
   *	
   */
  
+ #define FRAME_CNTS /* print frame counts and ftps when device stops */
  #include <stdio.h>
  #include <stdlib.h>
  #include <unistd.h>
***************
*** 50,55 ****
--- 51,59 ----
  #include <sys/types.h>
  #include <sys/ioctl.h>
  #include <sys/mman.h>
+ #ifdef FRAME_CNTS
+ #include <sys/time.h>
+ #endif
  
  #include "grabber.h"
  #include "crdef.h"
***************
*** 92,97 ****
--- 96,105 ----
  	u_int baseheight_;	/* Width of frame to be captured */
  	u_int decimate_;	/* division of base sizes */
  	volatile u_int* pyuv_;	/* pointer to yuv data */
+ #ifdef	FRAME_CNTS
+ 	struct meteor_counts cnts_;
+ 	double	start_time_;
+ #endif
  };
  
  class Meteor422Grabber : public MeteorGrabber {
***************
*** 132,140 ****
  MeteorScanner::MeteorScanner(const int n)
  {
  	char*	devname_template  = "/dev/meteor%d";
! 	char*	nickname_template = "Matrox Meteor %d";
  	char*	devname_template1  = "/dev/bktr%d";
! 	char*	nickname_template1 = "BrookTree848 %d";
  
  
  
--- 140,148 ----
  MeteorScanner::MeteorScanner(const int n)
  {
  	char*	devname_template  = "/dev/meteor%d";
! 	char*	nickname_template = "meteor-%d";
  	char*	devname_template1  = "/dev/bktr%d";
! 	char*	nickname_template1 = "brooktree848-%d";
  
  
  
***************
*** 309,314 ****
--- 317,331 ----
  	format();
  	int cmd = METEOR_CAP_SINGLE;
  	ioctl(dev_, METEORCAPTUR, (char*)&cmd);
+ #ifdef FRAME_CNTS
+         cnts_.fifo_errors = 0;
+         cnts_.dma_errors = 0;   
+         cnts_.frames_captured = 0; 
+         cnts_.even_fields_captured = 0;
+         cnts_.odd_fields_captured = 0;
+         ioctl(dev_, METEORSCOUNT, &cnts_);
+         start_time_ = gettimeofday();
+ #endif
  
  	cmd = METEOR_CAP_CONTINOUS;
  	ioctl(dev_, METEORCAPTUR, (char*)&cmd);
***************
*** 320,325 ****
--- 337,355 ----
  
  	int cmd = METEOR_CAP_STOP_CONT;
  	ioctl(dev_, METEORCAPTUR, (char*)&cmd);
+ #ifdef FRAME_CNTS
+         double endtime = gettimeofday() ;  
+         ioctl(dev_, METEORGCOUNT, &cnts_);
+         int diff = (int)((endtime-start_time_) * 1e-6 + 0.5);
+         printf("frames = %d, even fields = %d, odd fields = %d,\n\
+ fifo errors = %d, dma errors = %d, seconds = %d",
+                 cnts_.frames_captured, cnts_.even_fields_captured,
+                 cnts_.odd_fields_captured, cnts_.fifo_errors, cnts_.dma_errors,
+                 diff);
+         if(diff)
+                 printf(",fps = %d", cnts_.frames_captured/diff);
+         printf("\n");
+ #endif
  	Grabber::stop();
  }
  
*** ui-grabber.tcl.ports	Wed Mar  4 11:24:42 1998
--- ui-grabber.tcl	Wed Mar  4 12:13:14 1998
***************
*** 39,44 ****
--- 39,68 ----
  # called foo-1, foo-2, etc. and you'll only need build.foo
  #
  
+ proc build.meteor w {
+ # 
+ # The meteor has the same controls as the slicvideo, so just call that
+ # routine to build the controls.
+ 	build.slicvideo $w
+ 	$w.f.h.scale configure -command "grabber hue"
+ 	$w.f.l.cscale configure -command "grabber contrast"
+ 	$w.f.l.bscale configure -command "grabber brightness"
+ 	$w.f.c.gscale configure -command "grabber uvgain"
+ 	$w.f.c.sscale configure -command "grabber saturation"
+ }
+ 
+ proc build.brooktree848 w {
+ # 
+ # The brooktree848 has the same controls as the slicvideo, so just call that
+ # routine to build the controls.
+ 	build.slicvideo $w
+ 	$w.f.h.scale configure -command "grabber hue"
+ 	$w.f.l.cscale configure -command "grabber contrast"
+ 	$w.f.l.bscale configure -command "grabber brightness"
+ 	$w.f.c.gscale configure -command "grabber uvgain"
+ 	$w.f.c.sscale configure -command "grabber saturation"
+ }
+ 
  proc build.slicvideo w {
  	set f [smallfont]
  	label $w.title -text "Grabber"

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803041832.MAA09831>