-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add input_uvc_patch file for mjpg-streamer
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */ |