+ //*pixelformatdescription = strdup((char*)fmt.description);
+ snprintf( value, sizeof(value), "%c%c%c%c:", fmt.pixelformat >> 0, fmt.pixelformat >> 8, fmt.pixelformat >> 16, fmt.pixelformat >> 24 );
+ strcat(*pixelformatdescription, strdup((char *) value));
+ fprintf(stderr, "detected format: %s: %c%c%c%c\n", fmt.description, fmt.pixelformat >> 0, fmt.pixelformat >> 8,
+ fmt.pixelformat >> 16, fmt.pixelformat >> 24);
+
+ sizes.pixel_format = fmt.pixelformat;
+ sizes.index = 0;
+ // Query supported frame size
+ while (ioctl(s->fd, VIDIOC_ENUM_FRAMESIZES, &sizes) != -1) {
+ struct v4l2_frmsize_discrete image_size = sizes.un.discrete;
+ // Query supported frame rates
+ rates.index = 0;
+ rates.pixel_format = fmt.pixelformat;
+ rates.width = image_size.width;
+ rates.height = image_size.height;
+ snprintf( value, sizeof(value), "%dx%d,", image_size.width, image_size.height );
+ strcat(*pixelformatdescription, strdup((char *) value));
+ fprintf(stderr, "Size: %dx%d: ", image_size.width, image_size.height);
+ while (ioctl(s->fd, VIDIOC_ENUM_FRAMEINTERVALS, &rates) != -1) {
+ snprintf( value, sizeof(value), "%d/%d,", rates.un.discrete.numerator, rates.un.discrete.denominator );
+ strcat(*pixelformatdescription, strdup((char *) value));
+ fprintf(stderr, "%d/%d, ", rates.un.discrete.numerator, rates.un.discrete.denominator);
+ rates.index ++;
+ }
+ fprintf(stderr, "\n");
+ sizes.index++;
+ }
+
+
+ /*[0x%08X] '%c%c%c%c' (%s)", v4l2_pal,
+ fmt.pixelformat,
+ fmt.pixelformat >> 0, fmt.pixelformat >> 8,
+ fmt.pixelformat >> 16, fmt.pixelformat >> 24*/
+ fmt.index++;