Re: video(1): Don't limit maximum frame size to display size

2016-09-19 Thread Gregor Best
Hi,

> [...]
> This seems to work fine with inteldrm, a 1280x800 display and
> [...]

Good to hear I didn't break anything :)

> [...]
> No idea either... if you wanted to reduce the risk of breakage, I
> guess you could limit the resolution only if -O is not passed.
> [...]

I've read up on Xv a bit and I think it's okay to just give it larger
images, so this kind of precaution doesn't seem necessary.

-- 
Gregor



Re: video(1): Don't limit maximum frame size to display size

2016-09-18 Thread Jeremie Courreges-Anglas
Gregor Best  writes:

> Hi,
>
> this is another patch to video(1). It removes the logic that forces the
> video grab frame size to be <= the size of the Xv adaptor. This allows
> me to grab and view frames that are 1280x1024 on my 1440x900 screen. Xv
> properly scales and stretches the window content, so there's nothing
> that gets cut off from the video feed.
>
> The camera I have here has the following resolutions:
>
> 160x120: 30
> 176x144: 30
> 320x240: 30
> 352x288: 30
> 640x480: 30
> 1280x1024: 9
>
> Without this patch, the maximum resolution I can grab and view at the
> same time is 640x480, which is a bit too tiny.

This seems to work fine with inteldrm, a 1280x800 display and

video device /dev/video:
  encodings: yuy2
  frame sizes (width x height, in pixels) and rates (in frames per second):
320x240: 30
352x288: 30
640x480: 30
800x600: 15
1024x768: 12
1280x720: 7
1280x800: 7
1600x1200: 5
  controls: brightness, contrast, saturation, hue, gamma, sharpness

> I haven't noticed any
> downsides of the patch, but I've only tested it with my laptop and not
> other graphics cards, so I'm not sure how Xv handles frames larger than
> the display size there.

No idea either... if you wanted to reduce the risk of breakage, I guess
you could limit the resolution only if -O is not passed.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



video(1): Don't limit maximum frame size to display size

2016-09-18 Thread Gregor Best
Hi,

this is another patch to video(1). It removes the logic that forces the
video grab frame size to be <= the size of the Xv adaptor. This allows
me to grab and view frames that are 1280x1024 on my 1440x900 screen. Xv
properly scales and stretches the window content, so there's nothing
that gets cut off from the video feed.

The camera I have here has the following resolutions:

160x120: 30
176x144: 30
320x240: 30
352x288: 30
640x480: 30
1280x1024: 9

Without this patch, the maximum resolution I can grab and view at the
same time is 640x480, which is a bit too tiny. I haven't noticed any
downsides of the patch, but I've only tested it with my laptop and not
other graphics cards, so I'm not sure how Xv handles frames larger than
the display size there.

-- 
Gregor

Index: video.c
===
RCS file: /mnt/media/cvs/xenocara/app/video/video.c,v
retrieving revision 1.19
diff -u -p -r1.19 video.c
--- video.c 6 Jun 2016 19:31:22 -   1.19
+++ video.c 18 Sep 2016 14:00:06 -
@@ -1162,13 +1162,6 @@ choose_size(struct video *vid)
else if (vid->width && !vid->height)
vid->height = vid->width * 3 / 4;
 
-   if (vid->mode & M_OUT_XV) {
-   if (vid->width > x->max_width)
-   vid->width = x->max_width;
-   if (vid->height > x->max_height)
-   vid->height = x->max_height;
-   }
-
if (vid->mode & M_IN_DEV) {
i = 0;
while (i < d->nsizes &&