From owner-freebsd-multimedia Mon Apr 21 18:02:22 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id SAA02620 for multimedia-outgoing; Mon, 21 Apr 1997 18:02:22 -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 SAA02615 for ; Mon, 21 Apr 1997 18:02:19 -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 SAA08153 for ; Mon, 21 Apr 1997 18:02:20 -0700 (PDT) Message-Id: <199704220102.SAA08153@rah.star-gate.com> X-Mailer: exmh version 1.6.9 8/22/96 To: multimedia@freebsd.org Subject: Feed back on latest driver? Date: Mon, 21 Apr 1997 18:02:20 -0700 From: Amancio Hasty Sender: owner-multimedia@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Also, here is sample code to build a sorted clip list: struct bktr_clip { int x_min; int x_max; int y_min; int y_max; }; #define BT848_MAX_CLIP_NODE 100 struct _bktr_clip { struct bktr_clip x[BT848_MAX_CLIP_NODE]; }; clip_cmp(u1, u2) struct bktr_clip *u1, *u2; { if (u1->x_min < u2->x_min) return -1; if (u1->x_min == u2->x_min) return 1; if (u1->x_min == u2->x_min) { if (u1->y_min < u2->y_min) return -1; if (u1->y_min > u2->y_min) return 1; if (u1->y_min > u2->y_min) return 0; if (u1->y_max < u2->y_max) return -1; if (u1->y_max > u2->y_max) return 1; return 0; } } delete_clip(struct bktr_clip *list, int x1, int x2, int y1,int y2) { int i, j; for (i = 0 ; i < 100; i++ ) { if (list->x_min == x1 && list->x_max == x2 && list->y_min == y1 && list->y_max == y2) { for (j = i; j < 99; j++ ) { list[j].x_min = list[j+1].x_min; list[j].x_max = list[j+1].x_max; list[j].y_min = list[j+1].y_min; list[j].y_max = list[j+1].y_max; } break; } } } add_clip(struct bktr_clip *list, int x1, int x2, int y1,int y2) { for (i = 0 ; i < 99; i++ ) { if (list->x_min == 0 && list->x_max == 0 && list->y_min == 0 && list->y_max == 0) { list[i].x_min = x1; list[i].x_max = x2; list[i].y_min = y1; list[i].y_max = y2; list[i+1].x_min = 0; list[i+1].x_max = 0; list[i+1].y_min = 0; list[i+1].y_max = 0; } break; } } } } main() { struct bktr_clip list[100]; list[0].x_min = 100; list[0].x_max = 120; list[0].y_min = 11; list[0].y_max = 120; list[1].x_min = 90; list[1].x_max = 100; list[1].y_min = 10; list[1].y_max = 20; list[2].x_min = 100; list[2].x_max = 120; list[2].y_min = 11; list[2].y_max = 130; list[3].x_min = 1; list[3].x_max = 20; list[3].y_min = 30; list[3].y_max = 40; qsort((char *)&list, 4, sizeof (struct bktr_clip ), clip_cmp); delete_clip(&list, 100,120, 11, 120); } --- The sample is close enough that using the hardware clip ioctl for apps such as fxtv should be trivial provided that the application handles properly expose events. Cheers, Amancio