This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

saUserptrDisplay Crop fails.

Hi,

      I am using dm8168 with EZSDK 5.04 and have modified the saUserptrDisplay example and added the following code to do cropping.

      struct v4l2_crop crop;
      memset(&crop, 0, sizeof(crop));
      crop.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;

      crop.c.left = 0;
      crop.c.top = 0;
      crop.c.width = WIDTH;
      crop.c.height = HEIGHT-100;

       ret = ioctl(display_fd, VIDIOC_S_CROP, &crop);
       if(ret<0) {
              printf("display failed to VIDIOC_S_CROP on /dev/video3\n");
       }

       struct v4l2_format ft;  
       memset(&ft, 0, sizeof(ft));
       ft.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
       ft.fmt.win.w.left = 0;
       ft.fmt.win.w.top = 0;
       ft.fmt.win.w.width = WIDTH;
       ft.fmt.win.w.height = HEIGHT-100;
       ret = ioctl(display_fd, VIDIOC_S_FMT, &ft);
       if (ret < 0)
       {
            printf("Error in VIDIOC_S_FMT\n");
       }

       The cropping happens fine individually for /dev/video1 and /dev/video2.  However if we try to run the sample in both the layers with cropping enabled in at least one layer, it fails with the following error:

       VPSS_FVID2: contrl event 0x5 timeout
       VIDIOC_DQBUF: Invalid argument
       drv display VIDIOC_DQBUF failed: Connection timed out
       VPSS_FVID2: queue timeout

       The problem persists even if I use separate memory from fb1 for the video2 layer.

        Any help is appreciated very much.

Thanks,

Senthil

  • Hi Senthil,

    For cropping, it seems to me that you should refer to the saLoopBackScale.c example, not to the saUserptrDisplay.c example. And crop.type should be V4L2_BUF_TYPE_VIDEO_CAPTURE, not V4L2_BUF_TYPE_VIDEO_OUTPUT. You can check here for more info:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_VIDEO_CAPTURE_Driver_User_Guide#Cropping

    Regards,

    Pavel