NUERNBERGER CHRISTOPHER PETER wrote: > > * If the driver has to touch the video data (which is true for many usb > > cams because they have to uncompress the data) it doesn't work nicely. > > Basically the driver will have to do a extra memcpy then: > > copy_to_user(v4l2_buffer->ptr,kernelbuf,size). > > The driver cannot touch the video data if it is in a userspace buffer? Not that easily because you have to catch page faults in case of a bogous pointer and such. At least you can't simply derefernce the userspace pointer. > > For these reasons it simply is no option to drop the mmap() buffers > > altogether. And I don't like the idea to support both mmaped and > > application-allocated buffers that much because it makes drivers and > > applications more complex. > > In my application's case, using my own memory instead of the mmaped memory > would simplify things a bit. No, it wouldn't. Your application must be prepared that it doesn't work with the application-provided memory for one of the reasons mentioned and fallback to the mmap() case then. And exactly this attitude (write incomplete software which simply fails in some cases) is one of the reasons why I don't want to do make the v4l2 API more complex. Gerd -- #include </dev/tty>