Trent Piepho wrote: > > On Mon, 27 Nov 2000, Justin Schoeman wrote: > > > I need to clip images with a bttv chipset framegrabber card. Since the > > > only way i can read images is with mmap'ing the buffer, i need to set > > > clipping parameters with this method. However using the VIDIOCSWIN ioctl > > > doesnt work in this case, and im thus unable to set the clipping > > > rectangles. > > > Is there any way to do this with mmap io, and is it possible for me to > > > simply read images with bt848 cards without going through the mmap > > > interface? > > > > > > Thanks > > > Abheek > > > > There is no way to do this with the v4l or v4l2 API. The question from > > my side is: Why? You have to copy the image out of the mmap()ed region > > anyway so any clips would be lost. If you could explain what you want > > to do, perhaps we could be of more help. > > Save PCI bandwidth? If you only want a fraction of the image, it doesn't make > sense to DMA the whole thing into memory. OK - That makes sense. > You could also do memory overlay. Place a background image into memory, then > overlay the video on top of it. Without clipping, a second copy is required to > put the background into memory. For example, on-screen captions usually stay > on screen for many frames, so they can be read. If memory overlay can't clip, > you would have to redraw captions every single video frame, which is a lot of > extra work. Of course, everyone but me has a 1 GHz or faster processor and > doesn't care about a few lost frames, so efficiency issues don't seem to > matter. The mmap()ed memory area is definitely NOT guaranteed to be user writable, so this would not be a good idea. > Also V4L and V4L2 have no concept of adjusting the analog TV timing > parameters. A crude workaround is to scale and crop the image to trick the > driver into giving the desired timing. This won't work for non-overlay > capture. OK v4l2 does have "digital zoom" capabilities that can let you select a rectangular subpicture. I have not implemented it for bttv2, but if anybody wants to, they are welcome! -justin