int flag=0;
int fd=-1;
fd=open("/dev/video0",O_RDWR|O_NONBLOCK,0);
struct v4l2_fmtdesc fmt;
fmt.index=0;
fmt.type=V4L2_BUF_TYPE_VIDEO_CAPTURE;
while((flag=ioctl(fd,VIDIOC_ENUM_FMT,&fmt))!=-1)
{
printf("%d.%s\npixelformat=%c%c%c%c\n",fmt.index+1,fmt.description,fmt.pixelformat&0xFF,(fmt.pixelformat>>8)&0xFF,(fmt.pixelformat>>16)&0xFF,(fmt.pixelformat>>24)&0xFF);
fmt.index++;
}
pixelformat格式为__u32 是32位的 unsigned int