Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 225367 | Differences between
and this patch

Collapse All | Expand All

(-)a/luvcview.c (-2 / +7 lines)
Lines 220-225 Link Here
220
    const char *videodevice = NULL;
220
    const char *videodevice = NULL;
221
    const char *mode = NULL;
221
    const char *mode = NULL;
222
    int format = V4L2_PIX_FMT_MJPEG;
222
    int format = V4L2_PIX_FMT_MJPEG;
223
    int sdl_format = SDL_YUY2_OVERLAY;
223
    int i;
224
    int i;
224
    int grabmethod = 1;
225
    int grabmethod = 1;
225
    int width = 320;
226
    int width = 320;
Lines 269-274 Link Here
269
	    if (strncmp(mode, "yuv", 3) == 0) {
270
	    if (strncmp(mode, "yuv", 3) == 0) {
270
		format = V4L2_PIX_FMT_YUYV;
271
		format = V4L2_PIX_FMT_YUYV;
271
272
273
		} else if (strncmp(mode, "uyvy", 4) == 0) {
274
		format = V4L2_PIX_FMT_UYVY;
275
		sdl_format = SDL_UYVY_OVERLAY;
276
272
	    } else if (strncmp(mode, "jpg", 3) == 0) {
277
	    } else if (strncmp(mode, "jpg", 3) == 0) {
273
		format = V4L2_PIX_FMT_MJPEG;
278
		format = V4L2_PIX_FMT_MJPEG;
274
279
Lines 345-351 Link Here
345
	    printf("-d	/dev/videoX       use videoX device\n");
350
	    printf("-d	/dev/videoX       use videoX device\n");
346
	    printf("-g	use read method for grab instead mmap \n");
351
	    printf("-g	use read method for grab instead mmap \n");
347
	    printf("-w	disable SDL hardware accel. \n");
352
	    printf("-w	disable SDL hardware accel. \n");
348
	    printf("-f	video format  default jpg  others options are yuv jpg \n");
353
	    printf("-f	video format  default jpg  others options are yuv uyvy jpg \n");
349
	    printf("-i	fps           use specified frame interval \n");
354
	    printf("-i	fps           use specified frame interval \n");
350
	    printf("-s	widthxheight      use specified input size \n");
355
	    printf("-s	widthxheight      use specified input size \n");
351
	    printf("-c	enable raw frame capturing for the first frame\n");
356
	    printf("-c	enable raw frame capturing for the first frame\n");
Lines 447-453 Link Here
447
452
448
    overlay =
453
    overlay =
449
	SDL_CreateYUVOverlay(videoIn->width, videoIn->height + 32,
454
	SDL_CreateYUVOverlay(videoIn->width, videoIn->height + 32,
450
			     SDL_YUY2_OVERLAY, pscreen);
455
			     sdl_format, pscreen);
451
    p = (unsigned char *) overlay->pixels[0];
456
    p = (unsigned char *) overlay->pixels[0];
452
    drect.x = 0;
457
    drect.x = 0;
453
    drect.y = 0;
458
    drect.y = 0;
(-)a/v4l2uvc.c (+2 lines)
Lines 125-130 Link Here
125
							   8) * 2);
125
							   8) * 2);
126
	break;
126
	break;
127
    case V4L2_PIX_FMT_YUYV:
127
    case V4L2_PIX_FMT_YUYV:
128
    case V4L2_PIX_FMT_UYVY:
128
	vd->framebuffer =
129
	vd->framebuffer =
129
	    (unsigned char *) calloc(1, (size_t) vd->framesizeIn);
130
	    (unsigned char *) calloc(1, (size_t) vd->framesizeIn);
130
	break;
131
	break;
Lines 572-577 Link Here
572
	    printf("bytes in used %d \n", vd->buf.bytesused);
573
	    printf("bytes in used %d \n", vd->buf.bytesused);
573
	break;
574
	break;
574
    case V4L2_PIX_FMT_YUYV:
575
    case V4L2_PIX_FMT_YUYV:
576
    case V4L2_PIX_FMT_UYVY:
575
	if (vd->buf.bytesused > vd->framesizeIn)
577
	if (vd->buf.bytesused > vd->framesizeIn)
576
	    memcpy(vd->framebuffer, vd->mem[vd->buf.index],
578
	    memcpy(vd->framebuffer, vd->mem[vd->buf.index],
577
		   (size_t) vd->framesizeIn);
579
		   (size_t) vd->framesizeIn);

Return to bug 225367