AnsweredAssumed Answered

VIDIOC_CROPCAP structure member information

Question asked by Rashmi Ghoael Muruganandam on Apr 5, 2018
Latest reply on Apr 9, 2018 by Rashmi Ghoael Muruganandam

HI,

We are using i.MX6Qplus processor nitrogen board, with linux kernel version 4.1.15.

We need some information regarding, MXC V4L2 driver - VIDIOC_CROPCAP ioctl. We are trying to crop the captured image with the resolution of 640x480 from 2592x1944 (maximum resolution our camera supports) using vlc command line application,

   cvlc v4l2:///dev/videox:width=640:height=480:chroma=uyvy -V x11

VLC application uses VIDIOC_S_FMT ioctl to crop the image, then it will call the VIDIOC_CROPCAP to query the capabilities. The driver needs to fill the respective structure v4l2_cropcap,

struct v4l2_cropcap {
        enum v4l2_buf_type      type;   
        struct v4l2_rect        bounds;
        struct v4l2_rect        defrect;
        struct v4l2_fract       pixelaspect;
};

 

We want to know the difference between the structure member variables (bounds and defrect) in the above structure. We are filling the structure like below in the mxc v4l2 driver, 

bounds.width = 2592; (Max. width)

bounds.height = 1944; (Max. height)

defrect.width = 640; (requested crop width)

defrect.height= 480; (requested crop height)

 

Kindly clarify whether the above data fill in the driver is correct?. Or the defrect parameters supposed to be same as bounds always even the application requested to change the resolution for cropping.

Thanks in advance.

 

Regards,
Rashmi Muruganandam

Outcomes