path: root/src/v4l.h
diff options
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-24 09:49:09 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-24 11:19:19 -0300
commitcbc8d0905488d9efe5c9ecb2e97076e27049c6b3 (patch)
tree51580318fbcd908b972f1fb74f90655afad41e81 /src/v4l.h
parent343b5eb4ae59dbf5583de087326fa3423c923595 (diff)
Allow selecting the image resolution instead of "small/midium/large"resolution_improvement
The concept of small, midium, large is relative, as it depends on whatever the camera supports. Instead of using it, it is a way better to show a list of the supported resolutions. That works fine for most cameras, with uses a fixed set. On cameras with a scale, the Kernel actually exports the resolution range. On this case, let's present 4 resolutions between the minimum and maximum one. That should be reasonable for most usecases. Nowadays, all drivers should be reporting resolutions via VIDIOC_ENUM_FRAMESIZES. Yet, as one might run camorama with very legacy kernels, provide backward support, using small/midium/large resolutions just like before. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'src/v4l.h')
1 files changed, 8 insertions, 0 deletions
diff --git a/src/v4l.h b/src/v4l.h
index b29bb42..1469b5d 100644
--- a/src/v4l.h
+++ b/src/v4l.h
@@ -39,6 +39,10 @@ struct buffer_start_len {
size_t length;
+struct resolutions {
+ int x, y;
typedef struct camera {
int dev;
int width;
@@ -53,6 +57,9 @@ typedef struct camera {
int min_width, min_height, max_width, max_height;
+ int n_res;
+ struct resolutions *res;
char *video_dev;
unsigned char *image;
gchar *capturefile, *rcapturefile;
@@ -90,6 +97,7 @@ void try_set_win_info(cam * cam, int *x, int *y);
void set_win_info (cam * cam);
void get_pic_info (cam *);
void get_win_info (cam *);
+void get_supported_resolutions(cam * cam);
void start_streaming(cam * cam);
void capture_buffers(cam * cam, unsigned char *outbuf, int len);
void stop_streaming(cam * cam);

Privacy Policy