video: gc2145: support for CROP
Implements the set_selection and get_selection APIs,
if forwarded to it by a camera controller.
It uses the new messages
to allow you to set a crop window on top of the
current format window. It also then allows you
to move this crop window around in the frame
window.
With this driver I also updated it to allow any resolution
from the displays min to max limits.
static const struct video_format_cap fmts[] = {
GC2145_VIDEO_FORMAT_CAP_HL(128, 1600, 128, 1200,
VIDEO_PIX_FMT_RGB565),
GC2145_VIDEO_FORMAT_CAP_HL(128, 1600, 128, 1200,
VIDEO_PIX_FMT_YUYV),
When the resolution is set, it computes the scale factor.
Using the set_selection(VIDEO_SEL_TGT_CROP) allows you
define a crop window within the format window.
It clamps the ratio to a max of 3 as some other
drivers limit it saying it helps with frame rates.
Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
1 file changed