From owner-freebsd-multimedia Wed Mar 4 10:32:54 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA19382 for freebsd-multimedia-outgoing; Wed, 4 Mar 1998 10:32:54 -0800 (PST) (envelope-from owner-freebsd-multimedia@FreeBSD.ORG) Received: from miller.cs.uwm.edu (miller.cs.uwm.edu [129.89.139.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA19374 for ; Wed, 4 Mar 1998 10:32:47 -0800 (PST) (envelope-from james@miller.cs.uwm.edu) Received: (from james@localhost) by miller.cs.uwm.edu (8.8.5/8.8.5) id MAA09831; Wed, 4 Mar 1998 12:32:27 -0600 (CST) Date: Wed, 4 Mar 1998 12:32:27 -0600 (CST) From: Jim Lowe Message-Id: <199803041832.MAA09831@miller.cs.uwm.edu> To: hasty@rah.star-gate.com, luigi@labinfo.iet.unipi.it Subject: Re: Video ioctl interface Cc: multimedia@FreeBSD.ORG Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 #include #include *************** *** 50,55 **** --- 51,59 ---- #include #include #include + #ifdef FRAME_CNTS + #include + #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