Browse Source

more harmony in display

master
tth 3 years ago
parent
commit
706a4ed0c2
  1. 2
      v4l2/t.c
  2. 16
      v4l2/v4l2_pr_structs.c
  3. 12
      v4l2/video-infos.c

2
v4l2/t.c

@ -38,7 +38,7 @@ fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; @@ -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);
}

16
v4l2/v4l2_pr_structs.c

@ -219,24 +219,24 @@ return "???"; @@ -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) { @@ -245,8 +245,6 @@ switch(ptr->type) {
break;
}
fputs(".\n", FP);
return 0;
}
/* --------------------------------------------------------------------- */

12
v4l2/video-infos.c

@ -174,7 +174,7 @@ int vfd, foo; @@ -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); @@ -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);

Loading…
Cancel
Save