|
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; |
|
Lines 466-472
Link Here
|
| 466 |
initLut(); |
471 |
initLut(); |
| 467 |
SDL_WM_SetCaption(title_act[A_VIDEO].title, NULL); |
472 |
SDL_WM_SetCaption(title_act[A_VIDEO].title, NULL); |
| 468 |
lasttime = SDL_GetTicks(); |
473 |
lasttime = SDL_GetTicks(); |
| 469 |
creatButt(videoIn->width, 32); |
474 |
creatButt(videoIn->width, 32, sdl_format); |
| 470 |
SDL_LockYUVOverlay(overlay); |
475 |
SDL_LockYUVOverlay(overlay); |
| 471 |
memcpy(p + (videoIn->width * (videoIn->height) * 2), YUYVbutt, |
476 |
memcpy(p + (videoIn->width * (videoIn->height) * 2), YUYVbutt, |
| 472 |
videoIn->width * 64); |
477 |
videoIn->width * 64); |