Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 156103 Details for
Bug 225367
media-video/luvcview UYVY support
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
files/uyvy-support.patch
uyvy-support.patch (text/plain), 3.66 KB, created by
Ortwin Glueck
on 2008-06-09 18:05:58 UTC
(
hide
)
Description:
files/uyvy-support.patch
Filename:
MIME Type:
Creator:
Ortwin Glueck
Created:
2008-06-09 18:05:58 UTC
Size:
3.66 KB
patch
obsolete
>diff -ru a/gui.c b/gui.c >--- a/gui.c 2006-02-07 19:16:39.000000000 +0100 >+++ b/gui.c 2008-06-09 20:01:29.000000000 +0200 >@@ -28,6 +28,7 @@ > #include <sys/stat.h> > #include <sys/file.h> > #include <string.h> >+#include <SDL/SDL.h> > > #include "gui.h" > #include "utils.h" >@@ -80,7 +81,7 @@ > return 0; > } > >-int creatButt(int width, int height) >+int creatButt(int width, int height, int sdl_format) > { > int wOrg = 0; > int hOrg = 0; >@@ -89,7 +90,8 @@ > printf(" alloc jpeg Button fail !!\n"); > goto err; > } >- YUYVbutt = (unsigned char *) calloc(1, width * height << 1); >+ size_t size = width * height << 1; >+ YUYVbutt = (unsigned char *) calloc(1, size); > if (!YUYVbutt) { > printf(" alloc Button fail !!\n"); > goto err; >@@ -99,6 +101,16 @@ > printf(" resize Button fail !!\n"); > goto err; > } >+ if (sdl_format == SDL_UYVY_OVERLAY) { >+ // byte swap >+ int i; >+ char tmp; >+ for (i=0; i<size; i++) { >+ tmp = YUYVbutt[i]; >+ YUYVbutt[i++] = YUYVbutt[i]; >+ YUYVbutt[i] = tmp; >+ } >+ } > return 0; > err: > exit(0); >diff -ru a/gui.h b/gui.h >--- a/gui.h 2006-07-06 15:16:49.000000000 +0200 >+++ b/gui.h 2008-06-09 20:00:53.000000000 +0200 >@@ -23,5 +23,5 @@ > > extern unsigned char *YUYVbutt; > >-int creatButt(int width, int height); >+int creatButt(int width, int height, int sdl_format); > int destroyButt(void); >diff -ru a/luvcview.c b/luvcview.c >--- a/luvcview.c 2007-05-12 12:03:14.000000000 +0200 >+++ b/luvcview.c 2008-06-09 19:39:14.000000000 +0200 >@@ -220,6 +220,7 @@ > const char *videodevice = NULL; > const char *mode = NULL; > int format = V4L2_PIX_FMT_MJPEG; >+ int sdl_format = SDL_YUY2_OVERLAY; > int i; > int grabmethod = 1; > int width = 320; >@@ -269,6 +270,10 @@ > if (strncmp(mode, "yuv", 3) == 0) { > format = V4L2_PIX_FMT_YUYV; > >+ } else if (strncmp(mode, "uyvy", 4) == 0) { >+ format = V4L2_PIX_FMT_UYVY; >+ sdl_format = SDL_UYVY_OVERLAY; >+ > } else if (strncmp(mode, "jpg", 3) == 0) { > format = V4L2_PIX_FMT_MJPEG; > >@@ -345,7 +350,7 @@ > printf("-d /dev/videoX use videoX device\n"); > printf("-g use read method for grab instead mmap \n"); > printf("-w disable SDL hardware accel. \n"); >- printf("-f video format default jpg others options are yuv jpg \n"); >+ printf("-f video format default jpg others options are yuv uyvy jpg \n"); > printf("-i fps use specified frame interval \n"); > printf("-s widthxheight use specified input size \n"); > printf("-c enable raw frame capturing for the first frame\n"); >@@ -447,7 +452,7 @@ > > overlay = > SDL_CreateYUVOverlay(videoIn->width, videoIn->height + 32, >- SDL_YUY2_OVERLAY, pscreen); >+ sdl_format, pscreen); > p = (unsigned char *) overlay->pixels[0]; > drect.x = 0; > drect.y = 0; >@@ -466,7 +471,7 @@ > initLut(); > SDL_WM_SetCaption(title_act[A_VIDEO].title, NULL); > lasttime = SDL_GetTicks(); >- creatButt(videoIn->width, 32); >+ creatButt(videoIn->width, 32, sdl_format); > SDL_LockYUVOverlay(overlay); > memcpy(p + (videoIn->width * (videoIn->height) * 2), YUYVbutt, > videoIn->width * 64); >diff -ru a/v4l2uvc.c b/v4l2uvc.c >--- a/v4l2uvc.c 2007-05-08 17:39:40.000000000 +0200 >+++ b/v4l2uvc.c 2008-06-09 19:20:47.000000000 +0200 >@@ -125,6 +125,7 @@ > 8) * 2); > break; > case V4L2_PIX_FMT_YUYV: >+ case V4L2_PIX_FMT_UYVY: > vd->framebuffer = > (unsigned char *) calloc(1, (size_t) vd->framesizeIn); > break; >@@ -572,6 +573,7 @@ > printf("bytes in used %d \n", vd->buf.bytesused); > break; > case V4L2_PIX_FMT_YUYV: >+ case V4L2_PIX_FMT_UYVY: > if (vd->buf.bytesused > vd->framesizeIn) > memcpy(vd->framebuffer, vd->mem[vd->buf.index], > (size_t) vd->framesizeIn);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 225367
:
155957
|
155959
| 156103