Capture the picture with V4L2 when the capabilities is muti-PLANE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Capture the picture with V4L2 when the capabilities is muti-PLANE

1,946 Views
quaijing
Contributor I

the type of the camera  is type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE

when i capture the picture with the  userptr,(buf.memory = V4L2_MEMORY_USERPTR)
,Qbuf was failed.

the process is as follows:

at first i have request the buffer:

buffers=calloc(4,sizeof(*buffers));
for(n_buffers=0;n_buffers<4;++n_buffers){
  buffers[n_buffers].length=buffer_size;
  buffers[n_buffers].start=malloc(buffer_size);

}

for(i=0;i<n_buffers;++i){
CLEAR(buf);
memset(&planes, 0, sizeof(planes));

buf.m.planes = &planes;
buf.m.planes->length = buffers[i].length;
buf.m.planes->m.userptr = (unsigned long) buffers[i].start;
buf.type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
buf.memory=V4L2_MEMORY_USERPTR;
buf.index=i;
buf.length=1;
printf("buf.index is %d",buf.index);
int ret=ioctl(fd,VIDIOC_QBUF,&buf);
if(ret<0)
printf("QBUF failed\n");
}

but when I used QBUF to get the frame,the fault was as follows:

VIDIOC_QBUF error 22,Invalid argument.

Please help me !Thanks for your help!

 

0 Kudos
Reply
2 Replies

1,931 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Quajing,

Do you have a few more information?

Are you running the code as in the example or did you make any changes?
Does that error always occur?
Does dmesg print anything useful?

I am having trouble reproducing this error, so any info is welcome.
Do you maybe have the possibility to test this with a more recent kernel (say >= 4.9)?
I doubt that would change anything but you never know. BTW the Multiplane is not supported

Regards

 

 

0 Kudos
Reply

1,917 Views
quaijing
Contributor I

Can you send me the example about that.

If I used the G2D to request the buffer for QBUF ,the process is ok.But when i used the malloc to request buffer for QBUF,the error happens.Can you tell me why?

0 Kudos
Reply