Hi Laurent:
This OS is quite simple and made by my colleague, it is running on
ARM926ejs, I adopted the driver from our USB IP vendor, and developing USB
layer from USBD, roothub to UVC driver. And I did not using the same user
space app on my FPGA platform. On PC, I am using windows application, on
FPGA, I am using my own simulated test thread to do streaming.( Because I
don't have V4L2 and I dont have app to test UVC device yet)
Here is the simulation thread:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_MJPEG;
 fmt.fmt.pix.width = 160;
 fmt.fmt.pix.height = 120;
 ret = uvc_v4l2_set_format(&dev->video, &fmt);
 if(ret){
  dev_err("uvc set format failed %d\n",ret);
 }
 bufsize = dev->video.streaming->ctrl.dwMaxVideoFrameSize;
 n = uvc_alloc_buffers(&dev->video.queue, V4L2_BUFFERS/*5*/, bufsize);
 for ( i = 0 ; i < n ; ++i ) {
  v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
  v4l2_buf.memory = V4L2_MEMORY_MMAP;
  v4l2_buf.index = i;
  uvc_queue_buffer(&dev->video.queue, &v4l2_buf);
 }
 ret = uvc_video_enable(&dev->video,1);
 if(ret) {
  dev_err("video stream enable failed %d\n", ret);
  goto done;
 }
 i = 0;
 while(1) {
  v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
  v4l2_buf.memory = V4L2_MEMORY_MMAP;
  v4l2_buf.index = i % n;
  uvc_dequeue_buffer(&dev->video.queue, &v4l2_buf, 0);
  uvc_queue_buffer(&dev->video.queue, &v4l2_buf);
  i++;
  if( i > 60 ) {
   uvc_video_enable(&dev->video,0);
   break;
  }
 }
done:
 uvc_free_buffers(&dev->video.queue);
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Our USB is 2.0 version and my cam compression format is MJPEG..
Thank you for your suggestion Laurent
Brian


-- 
Best Regards
Brian
_______________________________________________
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to