diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/v4l2_test/v4l2_common.c b/meta-digi-dey/recipes-digi/dey-examples/files/v4l2_test/v4l2_common.c index 937409102..52f8941ce 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/v4l2_test/v4l2_common.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/v4l2_test/v4l2_common.c @@ -601,9 +601,9 @@ int v4l2_crop_input(int fd, struct v4l2_rect *crop_rectangle) if (retval < 0) return retval; - if (crop_rectangle->left + crop_rectangle->width > crop_bounds.left + - crop_bounds.width || crop_rectangle->top + - crop_rectangle->height > crop_bounds.top + crop_bounds.height) { + if (crop_rectangle->left + crop_rectangle->width > crop_bounds.left + crop_bounds.width || + crop_rectangle->top + crop_rectangle->height > crop_bounds.top + crop_bounds.height || + crop_rectangle->width < 8 || crop_rectangle->height < 8) { log("Invalid input\n"); return -EINVAL; } @@ -643,10 +643,13 @@ int v4l2_area_zoom(int fd, struct v4l2_rect *crop_rectangle) crop_rectangle->top, crop_rectangle->left, crop_rectangle->width, crop_rectangle->height); printf("\nValid rectangles are those which:\n" - "Top + Height < Bound_Top + Bound_Height\n" - "and\n" "Left + Width < Bound_Left + Bound_Width\n\n"); + " Height >= 8\n" + " Width >= 8\n" + " Top + Height < Bound_Top + Bound_Height\n" + " Left + Width < Bound_Left + Bound_Width\n\n"); + } else { + return retval; } - return retval; } retval = v4l2_overlay_control(fd, 1); diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/v4l2_test/v4l2_preview_test.c b/meta-digi-dey/recipes-digi/dey-examples/files/v4l2_test/v4l2_preview_test.c index 92d52f730..905e81c2c 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/v4l2_test/v4l2_preview_test.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/v4l2_test/v4l2_preview_test.c @@ -230,7 +230,7 @@ static int cmd_area_zoom(int fd) struct v4l2_rect zoom_rectangle; int ret = -1; - printf("Enter rectangle's values (top, left, width, height): "); + printf("Enter rectangle's values (top, left, width [>=8], height [>=8]): "); if ((scanf("%d,%d,%d,%d", &zoom_rectangle.top, &zoom_rectangle.left, &zoom_rectangle.width, &zoom_rectangle.height)) != 4 || should_stop) { printf("Enter four parameters\n");