1 Binary files a/ipkg-ar71xx/mjpg-streamer/usr/lib/input_uvc.so and b/ipkg-ar71xx/mjpg-streamer/usr/lib/input_uvc.so differ
2 diff -ur a/plugins/input_uvc/input_uvc.c b/plugins/input_uvc/input_uvc.c
3 --- a/plugins/input_uvc/input_uvc.c 2015-03-02 09:14:05.000000000 +0200
4 +++ b/plugins/input_uvc/input_uvc.c 2015-03-02 09:18:22.000000000 +0200
7 memset(cams[id].videoIn, 0, sizeof(struct vdIn));
9 + /* Non-MJPEG formats seem to fail with unlimited FPS */
10 + if (format != V4L2_PIX_FMT_MJPEG && fps == -1)
13 /* display the parsed values */
14 IPRINT("Using V4L2 device.: %s\n", dev);
15 IPRINT("Desired Resolution: %i x %i\n", width, height);
16 diff -ur a/plugins/input_uvc/jpeg_utils.c b/plugins/input_uvc/jpeg_utils.c
17 --- a/plugins/input_uvc/jpeg_utils.c 2015-03-02 09:17:02.000000000 +0300
18 +++ b/plugins/input_uvc/jpeg_utils.c 2015-03-02 09:25:18.000000000 +0200
22 row_pointer = (JSAMPROW*)line_buffer;
23 - jpeg_write_scanlines(&cinfo, row_pointer, 1);
24 + jpeg_write_scanlines(&cinfo, &row_pointer, 1);
26 } else if (vd->formatIn == V4L2_PIX_FMT_RGB565) {
27 while(cinfo.next_scanline < vd->height) {
31 row_pointer = (JSAMPROW*)line_buffer;
32 - jpeg_write_scanlines(&cinfo, row_pointer, 1);
33 + jpeg_write_scanlines(&cinfo, &row_pointer, 1);
35 } else if (vd->formatIn == V4L2_PIX_FMT_RGB24) {
36 jpeg_write_scanlines(&cinfo, (JSAMPROW*)vd->framebuffer, vd->height);
37 diff -ur a/plugins/input_uvc/v4l2uvc.c b/plugins/input_uvc/v4l2uvc.c
38 --- a/plugins/input_uvc/v4l2uvc.c 2015-03-02 09:14:05.000000000 +0200
39 +++ b/plugins/input_uvc/v4l2uvc.c 2015-03-02 09:22:09.000000000 +0200
41 vd->frame_period_time = 1000/vd->fps; // calcualate frame period time in ms
42 IPRINT("Frame period time ......: %ld ms\n", vd->frame_period_time);
44 - // set FPS to maximum in order to minimize the lagging
45 memset(setfps, 0, sizeof(struct v4l2_streamparm));
46 setfps->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
47 setfps->parm.capture.timeperframe.numerator = 1;
48 - setfps->parm.capture.timeperframe.denominator = 255;
49 + if (vd->formatIn == V4L2_PIX_FMT_MJPEG)
50 + // set FPS to maximum in order to minimize the lagging
51 + setfps->parm.capture.timeperframe.denominator = 255;
53 + setfps->parm.capture.timeperframe.denominator = vd->fps;
55 ret = xioctl(vd->fd, VIDIOC_S_PARM, setfps);
57 perror("Unable to set the FPS\n");