Browse Source

more confusion in display

master
tth 3 years ago
parent
commit
3e0a2eb9d9
  1. 27
      v4l2/v4l2_pr_structs.c
  2. 2
      v4l2/video-infos.c

27
v4l2/v4l2_pr_structs.c

@ -195,6 +195,27 @@ if (ptr->capabilities) { @@ -195,6 +195,27 @@ if (ptr->capabilities) {
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)
{
fprintf(FP, "-- v4l2_format, %-15s %p\n", txt, ptr);
@ -213,7 +234,11 @@ switch(ptr->type) { @@ -213,7 +234,11 @@ switch(ptr->type) {
ptr->fmt.pix.field); /* enum v4l2_field */
fprintf(FP, " padding %d\n",
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;
default: fprintf(FP, "XXX type %d unknow\n", ptr->type);

2
v4l2/video-infos.c

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

Loading…
Cancel
Save