Browse Source

more harmony in display

tth 1 year ago
parent
commit
706a4ed0c2
3 changed files with 19 additions and 11 deletions
  1. 1
    1
      v4l2/t.c
  2. 7
    9
      v4l2/v4l2_pr_structs.c
  3. 11
    1
      v4l2/video-infos.c

+ 1
- 1
v4l2/t.c View File

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

+ 7
- 9
v4l2/v4l2_pr_structs.c View File

@@ -219,24 +219,24 @@ return "???";
219 219
 int pr_v4l2_format(char *txt, struct v4l2_format *ptr)
220 220
 {
221 221
 fprintf(FP, "-- v4l2_format, %-15s  %p\n", txt, ptr);
222
-fprintf(FP, "   type %d     %s\n", ptr->type,/* enum v4l2_buf_type */
222
+fprintf(FP, "   type %d          %s\n", ptr->type,/* enum v4l2_buf_type */
223 223
 			fmttype2str(ptr->type));
224 224
 
225 225
 switch(ptr->type) {
226 226
 
227 227
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
228
-		fprintf(FP, "   dims       %dx%d\n",
228
+		fprintf(FP, "   dims            %dx%d\n",
229 229
 				ptr->fmt.pix.width,
230 230
 				ptr->fmt.pix.height);
231
-		fprintf(FP, "   pixformat  %s\n",
231
+		fprintf(FP, "   pixformat       %s\n",
232 232
 				str_fourcc(ptr->fmt.pix.pixelformat));
233
-		fprintf(FP, "   field      %d\n", 
233
+		fprintf(FP, "   field           %d\n", 
234 234
 				ptr->fmt.pix.field); /* enum v4l2_field */
235
-		fprintf(FP, "   padding    %d\n",
235
+		fprintf(FP, "   padding         %d\n",
236 236
 				ptr->fmt.pix.bytesperline);
237
-		fprintf(FP, "   sizeimage  %d\n",
237
+		fprintf(FP, "   sizeimage       %d\n",
238 238
 				ptr->fmt.pix.sizeimage);
239
-		fprintf(FP, "   colorspace %d  %s\n",
239
+		fprintf(FP, "   colorspace      %d  %s\n",
240 240
 				ptr->fmt.pix.colorspace,
241 241
 				str_colorspace(ptr->fmt.pix.colorspace));
242 242
 		break;
@@ -245,8 +245,6 @@ switch(ptr->type) {
245 245
 			break;
246 246
 	
247 247
 	}
248
-
249
-fputs(".\n", FP);
250 248
 return 0;
251 249
 }
252 250
 /* --------------------------------------------------------------------- */

+ 11
- 1
v4l2/video-infos.c View File

@@ -174,7 +174,7 @@ int			vfd, foo;
174 174
 char			ligne[100];
175 175
 
176 176
 struct v4l2_capability		cap;
177
-// struct v4l2_format		fmt;
177
+struct v4l2_format		fmt;
178 178
 struct v4l2_input		input;
179 179
 // int 				index;
180 180
 
@@ -213,6 +213,16 @@ sprintf(ligne, "input %d", input.index);
213 213
 pr_v4l2_input(ligne, &input);
214 214
 ***/
215 215
 
216
+memset(&fmt, 0, sizeof(fmt));
217
+fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
218
+foo = ioctl(vfd, VIDIOC_G_FMT, &fmt);
219
+fprintf(stderr, "ioctl -> %d\n", foo);
220
+if (0 != foo)	{
221
+	perror("ioctl G_FMT");
222
+	exit(1);
223
+	}
224
+pr_v4l2_format("Experimental", &fmt);
225
+
216 226
 foo = enum_image_formats(vfd, "Experimental", 0);
217 227
 
218 228
 foo = enum_controls(vfd, "is that working ?", 0);

Loading…
Cancel
Save