diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/v4l.cc | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -523,11 +523,15 @@ static void init_device(void) printf("w: %d\n", fmt.fmt.pix.width); printf("h: %d\n", fmt.fmt.pix.height); - char *p = (char*)&fmt.fmt.pix.pixelformat; - printf("f: %c\n", p[0]); - printf("f: %c\n", p[1]); - printf("f: %c\n", p[2]); - printf("f: %c\n", p[3]); + + char format[5]; + memcpy(format, &fmt.fmt.pix.pixelformat, 4); + format[4] = '\0'; + printf("format: %s\n", format); + if(strcmp(format, "JPEG")) { + printf("Webcam does not support JPEG...!\n"); + exit(1); + } /* Note VIDIOC_S_FMT may change width and height. */ } else { |