diff options
author | Mikle Kolyada <zlogene@gentoo.org> | 2015-08-10 13:19:27 +0300 |
---|---|---|
committer | Mikle Kolyada <zlogene@gentoo.org> | 2015-08-10 13:20:42 +0300 |
commit | 5356a342d4ad09098a73f130105ff049c56318ce (patch) | |
tree | 3208c2bff25c4e3ed7a77dd0d2f77f5313a2aa9c /media-video/mjpg-streamer/files | |
parent | 36a13defe3ee8b47b7dc6019641eb0b9485b5252 (diff) | |
download | gentoo-5356a342d4ad09098a73f130105ff049c56318ce.tar.gz gentoo-5356a342d4ad09098a73f130105ff049c56318ce.tar.xz |
media-video/mjpg-streamer: Fix compatibility with kernels newer than 3.18 (bug 556402)
Package-Manager: portage-2.2.20
Diffstat (limited to 'media-video/mjpg-streamer/files')
-rw-r--r-- | media-video/mjpg-streamer/files/0_pre20120621-to-work-with-kernel-3.18.patch | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/media-video/mjpg-streamer/files/0_pre20120621-to-work-with-kernel-3.18.patch b/media-video/mjpg-streamer/files/0_pre20120621-to-work-with-kernel-3.18.patch new file mode 100644 index 00000000000..5f16f4ab3f4 --- /dev/null +++ b/media-video/mjpg-streamer/files/0_pre20120621-to-work-with-kernel-3.18.patch @@ -0,0 +1,74 @@ +From 03796a1d930212aea460405b86cd41bea8fa5150 Mon Sep 17 00:00:00 2001 +From: Eric Lee <saintgimp@hotmail.com> +Date: Thu, 26 Feb 2015 19:31:41 -0800 +Subject: [PATCH] Fix mjpg-streamer to work with kernel 3.18 + +I didn't create this fix, it was originally posted to http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97983&p=681259. @koosvriezen tried to create a pull request #3 but made kind of a hash of it, so this is the same fix only a proper pull request. +--- + mjpg-streamer/plugins/input_uvc/input_uvc.c | 8 +++++--- + mjpg-streamer/plugins/input_uvc/v4l2uvc.c | 2 ++ + mjpg-streamer/plugins/input_uvc/v4l2uvc.h | 3 +++ + 3 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/mjpg-streamer/plugins/input_uvc/input_uvc.c b/mjpg-streamer/plugins/input_uvc/input_uvc.c +index c0b2d10..ef264e9 100644 +--- a/mjpg-streamer/plugins/input_uvc/input_uvc.c ++++ b/mjpg-streamer/plugins/input_uvc/input_uvc.c +@@ -405,9 +405,13 @@ void *cam_thread(void *arg) + if(pcontext->videoIn->formatIn == V4L2_PIX_FMT_YUYV) { + DBG("compressing frame from input: %d\n", (int)pcontext->id); + pglobal->in[pcontext->id].size = compress_yuyv_to_jpeg(pcontext->videoIn, pglobal->in[pcontext->id].buf, pcontext->videoIn->framesizeIn, gquality); ++ /* copy this frame's timestamp to user space */ ++ pglobal->in[pcontext->id].timestamp = pcontext->videoIn->buf.timestamp; + } else { + DBG("copying frame from input: %d\n", (int)pcontext->id); +- pglobal->in[pcontext->id].size = memcpy_picture(pglobal->in[pcontext->id].buf, pcontext->videoIn->tmpbuffer, pcontext->videoIn->buf.bytesused); ++ pglobal->in[pcontext->id].size = memcpy_picture(pglobal->in[pcontext->id].buf, pcontext->videoIn->tmpbuffer, pcontext->videoIn->tmpbytesused); ++ /* copy this frame's timestamp to user space */ ++ pglobal->in[pcontext->id].timestamp = pcontext->videoIn->tmptimestamp; + } + + #if 0 +@@ -418,8 +422,6 @@ void *cam_thread(void *arg) + prev_size = global->size; + #endif + +- /* copy this frame's timestamp to user space */ +- pglobal->in[pcontext->id].timestamp = pcontext->videoIn->buf.timestamp; + + /* signal fresh_frame */ + pthread_cond_broadcast(&pglobal->in[pcontext->id].db_update); +diff --git a/mjpg-streamer/plugins/input_uvc/v4l2uvc.c b/mjpg-streamer/plugins/input_uvc/v4l2uvc.c +index 48fd189..329233b 100644 +--- a/mjpg-streamer/plugins/input_uvc/v4l2uvc.c ++++ b/mjpg-streamer/plugins/input_uvc/v4l2uvc.c +@@ -450,6 +450,8 @@ int uvcGrab(struct vdIn *vd) + */ + + memcpy(vd->tmpbuffer, vd->mem[vd->buf.index], vd->buf.bytesused); ++ vd->tmpbytesused = vd->buf.bytesused; ++ vd->tmptimestamp = vd->buf.timestamp; + + if(debug) + fprintf(stderr, "bytes in used %d \n", vd->buf.bytesused); +diff --git a/mjpg-streamer/plugins/input_uvc/v4l2uvc.h b/mjpg-streamer/plugins/input_uvc/v4l2uvc.h +index d5296fc..0e3f99f 100644 +--- a/mjpg-streamer/plugins/input_uvc/v4l2uvc.h ++++ b/mjpg-streamer/plugins/input_uvc/v4l2uvc.h +@@ -28,6 +28,7 @@ + + + #include <stdio.h> ++#include <stdint.h> + #include <string.h> + #include <fcntl.h> + #include <unistd.h> +@@ -105,6 +106,8 @@ struct vdIn { + int framecount; + int recordstart; + int recordtime; ++ uint32_t tmpbytesused; ++ struct timeval tmptimestamp; + }; + + /* context of each camera thread */ |