From 3e0a2eb9d9d83a8ee872dd55dd2587626f29970a Mon Sep 17 00:00:00 2001 From: tth Date: Fri, 2 Aug 2019 02:12:54 +0200 Subject: [PATCH] more confusion in display --- v4l2/v4l2_pr_structs.c | 27 ++++++++++++++++++++++++++- v4l2/video-infos.c | 2 ++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/v4l2/v4l2_pr_structs.c b/v4l2/v4l2_pr_structs.c index ce6071e..3b6fe41 100644 --- a/v4l2/v4l2_pr_structs.c +++ b/v4l2/v4l2_pr_structs.c @@ -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) { 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); diff --git a/v4l2/video-infos.c b/v4l2/video-infos.c index 9f43b55..c017596 100644 --- a/v4l2/video-infos.c +++ b/v4l2/video-infos.c @@ -123,7 +123,9 @@ for (idx=V4L2_CID_BASE; idx