From owner-freebsd-multimedia Sun Apr 20 19:44:50 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id TAA08534 for multimedia-outgoing; Sun, 20 Apr 1997 19:44:50 -0700 (PDT) Received: from rah.star-gate.com (rah.star-gate.com [204.188.121.18]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA08526 for ; Sun, 20 Apr 1997 19:44:46 -0700 (PDT) Received: from rah.star-gate.com (localhost.star-gate.com [127.0.0.1]) by rah.star-gate.com (8.8.5/8.7.3) with ESMTP id TAA01761 for ; Sun, 20 Apr 1997 19:44:47 -0700 (PDT) Message-Id: <199704210244.TAA01761@rah.star-gate.com> X-Mailer: exmh version 1.6.9 8/22/96 To: multimedia@freebsd.org Subject: The clip code should be ready tonite 8) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 20 Apr 1997 19:44:47 -0700 From: Amancio Hasty Sender: owner-multimedia@freebsd.org X-Loop: FreeBSD.org Precedence: bulk So far testing is favorable over here so after code clean up and further testing I will release the code tonite. The clip algorithm is only for rectangles. If there is interest I may look into implement polygons which is not necessarily easy to do at the driver because I want to avoid as much as possible recursion. Here is a sample of the code to use hardware clipping: This code alternates between not clipping, by setting clip_region[0].y_min and clip_region[0].y_max to 0, and specifying two clipping rectangles. The maximum number of rectangles that we can specify is 100 which I think is plenty. Setting clip_region[0].y_min and clip_region[1].y_max sets the number of clip rectangles to 0 in the driver . The rectangles should be sorted by the application . "x" first then "y". I will do error checking to ensure that the policy is enforced. while (got_signal) { ++j; if ( (j - ( j / 60 ) * 60) == 0 ) { i = METEOR_CAP_STOP_CONT; ioctl(video, METEORCAPTUR, &i); if (clip_region[0].y_min == 0 ) { clip_region[0].x_min = 10; clip_region[0].x_max = 20; clip_region[0].y_min = 20; clip_region[0].y_max = 40; clip_region[1].x_min = 10; clip_region[1].x_max = 20; clip_region[1].y_min = 80; clip_region[1].y_max = 100; printf("clip \n"); } else { printf("don't clip \n"); clip_region[0].y_min = 0; clip_region[0].y_max = 0; } ioctl( video, BT848SCLIP, &clip_region ); } i = METEOR_CAP_SINGLE ; /* buffer up 1 frame */ ioctl(video, METEORCAPTUR, &i); . . . I will probably change Bt848SCLIP to METEORSCLIP ... Last but not least we clip much faster than the latest Win95 WinCast client. Every time clipping gets activated in win95 in order for the clip to take effect the whole screen gets refresh at least with the latest Wincast client and my lastest S3 driver. Enjoy, Amancio