Commit d9d88e1d authored by André Almeida's avatar André Almeida

Fix identantion

parent 43dbd3f6
......@@ -108,27 +108,27 @@ int main(int argc, char **argv)
ctx.img_width = 640;
ctx.size_image = ctx.img_height * ctx.img_width;
struct v4l2_format fmt;
struct v4l2_buffer buf;
struct v4l2_requestbuffers req;
struct v4l2_format fmt;
struct v4l2_buffer buf;
struct v4l2_requestbuffers req;
struct v4l2_plane planes[ctx.num_planes];
struct v4l2_capability caps;
enum v4l2_buf_type type;
fd_set fds;
struct timeval tv;
int r, fd = -1;
unsigned int i, j;
char *dev_name = "/dev/video0";
char out_name[256];
FILE *fout;
struct buffer *buffers;
enum v4l2_buf_type type;
fd_set fds;
struct timeval tv;
int r, fd = -1;
unsigned int i, j;
char *dev_name = "/dev/video0";
char out_name[256];
FILE *fout;
struct buffer *buffers;
/* Opening the device */
fd = open(dev_name, O_RDWR | O_NONBLOCK, 0);
if (fd < 0) {
perror("Cannot open device");
exit(EXIT_FAILURE);
}
fd = open(dev_name, O_RDWR | O_NONBLOCK, 0);
if (fd < 0) {
perror("Cannot open device");
exit(EXIT_FAILURE);
}
/* Querying device capabilities */
xioctl(fd, VIDIOC_QUERYCAP, &caps);
......@@ -137,9 +137,9 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
/* Setting image format */
CLEAR(fmt);
fmt.type = ctx.buf_type;
/* Setting image format */
CLEAR(fmt);
fmt.type = ctx.buf_type;
fmt.fmt.pix_mp.width = ctx.img_width;
fmt.fmt.pix_mp.height = ctx.img_height;
fmt.fmt.pix_mp.pixelformat = ctx.pix_format;
......@@ -194,8 +194,8 @@ int main(int argc, char **argv)
buf.memory = ctx.mem_type;
buf.index = i;
buf.m.planes = planes;
buf.length = ctx.num_planes;
buf.length = ctx.num_planes;
xioctl(fd, VIDIOC_QUERYBUF, &buf);
/* map planes offsets to buffers pointers */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment