more confusion in display

This commit is contained in:
tth 2019-08-02 02:12:54 +02:00
parent d571d05431
commit 3e0a2eb9d9
2 changed files with 28 additions and 1 deletions

View File

@ -195,6 +195,27 @@ if (ptr->capabilities) {
return -1; return -1;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
char * str_colorspace(int colspace)
{
switch(colspace) {
case V4L2_COLORSPACE_DEFAULT: return "default";
case V4L2_COLORSPACE_SMPTE170M: return "smpte170m";
case V4L2_COLORSPACE_SMPTE240M: return "smpte240m";
case V4L2_COLORSPACE_REC709: return "rec709";
case V4L2_COLORSPACE_BT878: return "bt878";
case V4L2_COLORSPACE_470_SYSTEM_M: return "470-sys-M";
case V4L2_COLORSPACE_470_SYSTEM_BG: return "470-sys-BG";
case V4L2_COLORSPACE_JPEG: return "jpeg";
case V4L2_COLORSPACE_SRGB: return "srgb";
case V4L2_COLORSPACE_ADOBERGB: return "adobergb";
case V4L2_COLORSPACE_BT2020: return "bt2020";
case V4L2_COLORSPACE_RAW: return "raw";
case V4L2_COLORSPACE_DCI_P3: return "dci-p3";
}
return "???";
}
/* --------------------------------------------------------------------- */
int pr_v4l2_format(char *txt, struct v4l2_format *ptr) int pr_v4l2_format(char *txt, struct v4l2_format *ptr)
{ {
fprintf(FP, "-- v4l2_format, %-15s %p\n", txt, ptr); fprintf(FP, "-- v4l2_format, %-15s %p\n", txt, ptr);
@ -213,7 +234,11 @@ switch(ptr->type) {
ptr->fmt.pix.field); /* enum v4l2_field */ ptr->fmt.pix.field); /* enum v4l2_field */
fprintf(FP, " padding %d\n", fprintf(FP, " padding %d\n",
ptr->fmt.pix.bytesperline); ptr->fmt.pix.bytesperline);
fprintf(FP, " sizeimage %d\n",
ptr->fmt.pix.sizeimage);
fprintf(FP, " colorspace %d %s\n",
ptr->fmt.pix.colorspace,
str_colorspace(ptr->fmt.pix.colorspace));
break; break;
default: fprintf(FP, "XXX type %d unknow\n", ptr->type); default: fprintf(FP, "XXX type %d unknow\n", ptr->type);

View File

@ -123,7 +123,9 @@ for (idx=V4L2_CID_BASE; idx<V4L2_CID_LASTP1; idx++) {
} }
else if (EINVAL==errno) { else if (EINVAL==errno) {
#if DEBUG_LEVEL
if (verbosity) fprintf(stderr, "id %d einval\n", idx); if (verbosity) fprintf(stderr, "id %d einval\n", idx);
#endif
continue; continue;
} }
else { else {