Skip to content

Commit

Permalink
Add input_uvc_patch file for mjpg-streamer
Browse files Browse the repository at this point in the history
  • Loading branch information
swkim01 committed Mar 5, 2016
1 parent 5593d27 commit a81a904
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions ch7/input_uvc_patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
--- plugins/input_uvc/input_uvc.c (revision 182)
+++ plugins/input_uvc/input_uvc.c (working copy)
@@ -407,7 +407,7 @@
pglobal->in[pcontext->id].size = compress_yuyv_to_jpeg(pcontext->videoIn, pglobal->in[pcontext->id].buf, pcontext->videoIn->framesizeIn, gquality);
} 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);
}

#if 0
@@ -419,7 +419,7 @@
#endif

/* copy this frame's timestamp to user space */
- pglobal->in[pcontext->id].timestamp = pcontext->videoIn->buf.timestamp;
+ pglobal->in[pcontext->id].timestamp = pcontext->videoIn->tmptimestamp;

/* signal fresh_frame */
pthread_cond_broadcast(&pglobal->in[pcontext->id].db_update);
===================================================================
--- plugins/input_uvc/v4l2uvc.c (revision 182)
+++ plugins/input_uvc/v4l2uvc.c (working copy)
@@ -450,6 +450,8 @@
*/

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);
===================================================================
--- plugins/input_uvc/v4l2uvc.h (revision 182)
+++ plugins/input_uvc/v4l2uvc.h (working copy)
@@ -28,6 +28,7 @@


#include <stdio.h>
+#include <stdint.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
@@ -105,6 +106,8 @@
int framecount;
int recordstart;
int recordtime;
+ uint32_t tmpbytesused;
+ struct timeval tmptimestamp;
};

/* context of each camera thread */

0 comments on commit a81a904

Please # to comment.