Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Apr 1997 01:25:19 -0700
From:      Amancio Hasty <hasty@rah.star-gate.com>
To:        multimedia@freebsd.org
Subject:   Bt848 generalized rgb support plus hardware clipping available 
Message-ID:  <199704210825.BAA00932@rah.star-gate.com>

next in thread | raw e-mail | index | archive | help

The B848 driver which implements the above functionality is available from:
ftp://rah.star-gate.com/pub/bt848-clip.tar.gz




John-Mark Gurney <gurney_j@resnet.uoregon.edu> donated the generalized
rgb support. This is useful to support PCI to PCI transfer for 
cards such as the Matrox Millenium which have a different pixel order.


The driver has a table of what formats it supports.  E.g.:
 
                DEPTH     R_MASK     G_MASK        B_MASK
                  2       0x7c00     0x03e0        0x001f
                  4     0xff0000   0x00ff00      0x0000ff
ioctl code
METEORSRGBMASK
	ioctl(fd, METEORSRGBMASK, (struct rgb_mask *)&foo);
	Will attempt to set the appropiate rgb order in the 
        driver for a given color depth which was previously
        specified by setgeo ioctl .

METEORRRGBMASK

	ioctl(fd, METEORSRGBMASK, (struct rgb_mask *) &foo);	
	retrieves the current active rgb mask for a the currently
	active color depth.

If the ioctl call METEORSRGBMASK is not issued the driver defaults to
the pixel order RGB.


-----


The Amancio-Hasty 2D clip algorithm!
(
Thats just my weird sense of humor since in one of graphics book
just about all the clip algorithms was  invented by a pair of 
scientists or a scientist and a company 8) 
)


ioctl code
BT848SCLIP
   struct bktr_clip list[BT848_MAX_CLIP_NODE];
   ioctl(fd, BT848SCLIP, (struct bktr_clip *) &clip_list)


bktr_clip is defined in ioctl_bt848.h as:
struct bktr_clip {
    int          x_min;
    int          x_max;
    int          y_min;
    int          y_max;
};



	The driver always expects  a list of 100 clip elements.
	BT848_MAX_CLIP_NODE is defined to be 100.



	To stop hardware clipping call BT848SCLIP with clip_list[0].y_min
	and clip_list[0].y_max set to 0.

	The list of clip rectangles is terminated by setting the last
	clip rectangle's y_min and y_max fields to 0.

	The driver expects the rectangles to be sorted by x and then y as
        the second order sort key. Overlapping rectangles are valid.
	If the clip list is invalid the ioctl returns EINVAL 
        and further clipping is disabled.

	In order for the clip regions to be activated you must first
	stop the video capture process and then restart it. If video
	capture has not been started then the clip regions will be 
	activated when the video capture process starts.

	Here is an example:

	j = 0;
	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;
		    clip_region[2].y_min = 0;
		    clip_region[2].y_max = 0;

		    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);
		vid_stream.mb_width = geo.columns;
		vid_stream.mb_height = geo.rows;
		ExecuteDisplay(&vid_stream, yuv_data);

	}

----

	If all goes well this week we will commit the code by this
	Friday. If people don't check it out then it will not be 
        committed.		

	Have fun guys!
	Amancio










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