bttv-driver.c (0e8025b9f6011a6bd69d01080d584bc95a89d02e) bttv-driver.c (4f996594ceaf6c3f9bc42b40c40b0f7f87b79c86)
1/*
2
3 bttv - Bt848 frame grabber driver
4
5 Copyright (C) 1996,97,98 Ralph Metzler <rjkm@thp.uni-koeln.de>
6 & Marcus Metzler <mocm@thp.uni-koeln.de>
7 (c) 1999-2002 Gerd Knorr <kraxel@bytesex.org>
8

--- 2972 unchanged lines hidden (view full) ---

2981 inconsistent with fh->width or fh->height and apps
2982 do not expect a change here. */
2983
2984 crop->c = btv->crop[!!fh->do_crop].rect;
2985
2986 return 0;
2987}
2988
1/*
2
3 bttv - Bt848 frame grabber driver
4
5 Copyright (C) 1996,97,98 Ralph Metzler <rjkm@thp.uni-koeln.de>
6 & Marcus Metzler <mocm@thp.uni-koeln.de>
7 (c) 1999-2002 Gerd Knorr <kraxel@bytesex.org>
8

--- 2972 unchanged lines hidden (view full) ---

2981 inconsistent with fh->width or fh->height and apps
2982 do not expect a change here. */
2983
2984 crop->c = btv->crop[!!fh->do_crop].rect;
2985
2986 return 0;
2987}
2988
2989static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
2989static int bttv_s_crop(struct file *file, void *f, const struct v4l2_crop *crop)
2990{
2991 struct bttv_fh *fh = f;
2992 struct bttv *btv = fh->btv;
2993 const struct v4l2_rect *b;
2994 int retval;
2995 struct bttv_crop c;
2996 __s32 b_left;
2997 __s32 b_top;

--- 25 unchanged lines hidden (view full) ---

3023 b_bottom = b->top + b->height;
3024
3025 b_top = max(b->top, btv->vbi_end);
3026 if (b_top + 32 >= b_bottom) {
3027 return retval;
3028 }
3029
3030 /* Min. scaled size 48 x 32. */
2990{
2991 struct bttv_fh *fh = f;
2992 struct bttv *btv = fh->btv;
2993 const struct v4l2_rect *b;
2994 int retval;
2995 struct bttv_crop c;
2996 __s32 b_left;
2997 __s32 b_top;

--- 25 unchanged lines hidden (view full) ---

3023 b_bottom = b->top + b->height;
3024
3025 b_top = max(b->top, btv->vbi_end);
3026 if (b_top + 32 >= b_bottom) {
3027 return retval;
3028 }
3029
3030 /* Min. scaled size 48 x 32. */
3031 c.rect.left = clamp(crop->c.left, b_left, b_right - 48);
3031 c.rect.left = clamp_t(s32, crop->c.left, b_left, b_right - 48);
3032 c.rect.left = min(c.rect.left, (__s32) MAX_HDELAY);
3033
3032 c.rect.left = min(c.rect.left, (__s32) MAX_HDELAY);
3033
3034 c.rect.width = clamp(crop->c.width,
3034 c.rect.width = clamp_t(s32, crop->c.width,
3035 48, b_right - c.rect.left);
3036
3035 48, b_right - c.rect.left);
3036
3037 c.rect.top = clamp(crop->c.top, b_top, b_bottom - 32);
3037 c.rect.top = clamp_t(s32, crop->c.top, b_top, b_bottom - 32);
3038 /* Top and height must be a multiple of two. */
3039 c.rect.top = (c.rect.top + 1) & ~1;
3040
3038 /* Top and height must be a multiple of two. */
3039 c.rect.top = (c.rect.top + 1) & ~1;
3040
3041 c.rect.height = clamp(crop->c.height,
3041 c.rect.height = clamp_t(s32, crop->c.height,
3042 32, b_bottom - c.rect.top);
3043 c.rect.height = (c.rect.height + 1) & ~1;
3044
3045 bttv_crop_calc_limits(&c);
3046
3047 btv->crop[1] = c;
3048
3049 fh->do_crop = 1;

--- 1581 unchanged lines hidden ---
3042 32, b_bottom - c.rect.top);
3043 c.rect.height = (c.rect.height + 1) & ~1;
3044
3045 bttv_crop_calc_limits(&c);
3046
3047 btv->crop[1] = c;
3048
3049 fh->do_crop = 1;

--- 1581 unchanged lines hidden ---