Hi Igor,
thank you for the answer. i don't know what is specific in my question. I want only get the captured image from v4l device make some operations with the image and send it over USB to PC. Send to PC works es expected. Image capturing too, but only the copy the captured v4l frame to the user memory runs 10 times slower as user memory to user memory.
I try to explain on the othe way:
void *buf1,*buf2; // i have two buffers
const size_t size = 10*1024*1024; // both buffers are 10 Mb
case1:
buf1 = malloc(size);
buf2 = malloc(size);
memcpy(buf1, buf2, size); // this operation is approx 20 ms
case2:
buf1 = malloc(size);
xioctl(fd, VIDIOC_QUERYBUF, &v4l_buf_struct); // this step is necessary for v4l2 to allocate buffer
buf2 = mmap(NULL,size,PROT_READ | PROT_WRITE,MAP_SHARED,fd,v4l_buf_struct.m.offset); // get memory allocated in v4l2
memcpy(buf1,buf2,size); // this operation needs 250 ms!!!
Best regards
Andrej