more harmony in display

This commit is contained in:
Tonton Th 2019-08-02 03:33:59 +02:00
parent 3e0a2eb9d9
commit 706a4ed0c2
3 changed files with 19 additions and 11 deletions

View File

@ -38,7 +38,7 @@ fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
foo = ioctl(vfd, VIDIOC_G_FMT, &fmt);
fprintf(stderr, "ioctl -> %d\n", foo);
if (0 != foo) {
perror("ioctl S_FMT");
perror("ioctl G_FMT");
exit(1);
}

View File

@ -219,24 +219,24 @@ return "???";
int pr_v4l2_format(char *txt, struct v4l2_format *ptr)
{
fprintf(FP, "-- v4l2_format, %-15s %p\n", txt, ptr);
fprintf(FP, " type %d %s\n", ptr->type,/* enum v4l2_buf_type */
fprintf(FP, " type %d %s\n", ptr->type,/* enum v4l2_buf_type */
fmttype2str(ptr->type));
switch(ptr->type) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
fprintf(FP, " dims %dx%d\n",
fprintf(FP, " dims %dx%d\n",
ptr->fmt.pix.width,
ptr->fmt.pix.height);
fprintf(FP, " pixformat %s\n",
fprintf(FP, " pixformat %s\n",
str_fourcc(ptr->fmt.pix.pixelformat));
fprintf(FP, " field %d\n",
fprintf(FP, " field %d\n",
ptr->fmt.pix.field); /* enum v4l2_field */
fprintf(FP, " padding %d\n",
fprintf(FP, " padding %d\n",
ptr->fmt.pix.bytesperline);
fprintf(FP, " sizeimage %d\n",
fprintf(FP, " sizeimage %d\n",
ptr->fmt.pix.sizeimage);
fprintf(FP, " colorspace %d %s\n",
fprintf(FP, " colorspace %d %s\n",
ptr->fmt.pix.colorspace,
str_colorspace(ptr->fmt.pix.colorspace));
break;
@ -245,8 +245,6 @@ switch(ptr->type) {
break;
}
fputs(".\n", FP);
return 0;
}
/* --------------------------------------------------------------------- */

View File

@ -174,7 +174,7 @@ int vfd, foo;
char ligne[100];
struct v4l2_capability cap;
// struct v4l2_format fmt;
struct v4l2_format fmt;
struct v4l2_input input;
// int index;
@ -213,6 +213,16 @@ sprintf(ligne, "input %d", input.index);
pr_v4l2_input(ligne, &input);
***/
memset(&fmt, 0, sizeof(fmt));
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
foo = ioctl(vfd, VIDIOC_G_FMT, &fmt);
fprintf(stderr, "ioctl -> %d\n", foo);
if (0 != foo) {
perror("ioctl G_FMT");
exit(1);
}
pr_v4l2_format("Experimental", &fmt);
foo = enum_image_formats(vfd, "Experimental", 0);
foo = enum_controls(vfd, "is that working ?", 0);