oN wED, 6 sEp 2000, Peter A Kaczowka wrote: > Video4Linux (or at least the bttv/Bt848 driver) supports setting a clipping > bitmap, where a 1 in the bitmap means omit the video, a 0 means show the video. > This is apparently an undocumented feature; I found it by reading the source. > What is documented is that you can set a list of clipping rectangles, but the > driver always turns those into a clipping bitmap anyway. Really? That's unfortunate, as a clipping bitmap is much less efficient than a list of rectangles for almost all of the cases where clipping is used. Still, V4L is so full of design flaws that I wouldn't be too surprised if this is the case. > Neat feature, but it does have limitations and bug(s). There seems to be a > limit on how "narrow" the clipping can be. If you have a scanline in the > bitmap with every-other bit on, it will generally not accurately clip to it. For the bt848, clipping is done by changing the sequencer program used by the DMA engine. I am not sure, but I think that the DMA engine can only write data in dword (4 byte) units. Depending on the bytes per pixel of the format you are using, this would limit the horizontal resolution of your capture. It should be possible to get around this limit by using the byte enables in the DMA program, but the bttv driver doesn't do this. > There is also a nasty limit on how complex the total clipping shape can be. > For example, if you use a half-tone stipple pattern (every-other bit on, > staggered lines) for the whole screen Video4Linux will lock up the machine, > requiring a reboot. The "RISC program" the DMA engine uses is effectively a run-length encoded version of the clipping bitmap. If you know what run-length encoding is, you would know that your every other pixel pattern is the worst possible pattern to encode! The program is so huge (about 8 bytes per pixel!) that it overflows the buffers in the bttv driver, and your computer crashes. The way the bttv driver manages the program buffers is very primitive, but most people don't demand very much from the driver, so it works ok. The bt848 needs to DMA this program from system memory as it does the capture, so there is going to be limit on just how many bytes of program it can transfer over the PCI bus. Trying to overlay some kind of stippling pattern will mostly likely exceed these limits. If you really need this kind of overlay, you might try a DC10+ board. The Zoran PCI controller used on these boards does overlay with a clipping bitmap, so a complex stipple pattern shouldn't give it any programs. I have, however, found the zoran DMA performance to be much poorer than the bt848 performance.