aboutsummaryrefslogtreecommitdiffstats
path: root/utils/common
diff options
context:
space:
mode:
Diffstat (limited to 'utils/common')
-rw-r--r--utils/common/v4l2-info.cpp28
-rw-r--r--utils/common/v4l2-info.h2
2 files changed, 20 insertions, 10 deletions
diff --git a/utils/common/v4l2-info.cpp b/utils/common/v4l2-info.cpp
index 2903a125..af8151a2 100644
--- a/utils/common/v4l2-info.cpp
+++ b/utils/common/v4l2-info.cpp
@@ -349,18 +349,28 @@ std::string service2s(unsigned service)
return flags2s(service, service_def);
}
-static const flag_def fmtdesc_def[] = {
- { V4L2_FMT_FLAG_COMPRESSED, "compressed" },
- { V4L2_FMT_FLAG_EMULATED, "emulated" },
- { V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM, "continuous-bytestream" },
- { V4L2_FMT_FLAG_DYN_RESOLUTION, "dyn-resolution" },
- { V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL, "enc-cap-frame-interval" },
- { 0, NULL }
+#define FMTDESC_DEF(enc_type) \
+static const flag_def fmtdesc_ ## enc_type ## _def[] = { \
+ { V4L2_FMT_FLAG_COMPRESSED, "compressed" }, \
+ { V4L2_FMT_FLAG_EMULATED, "emulated" }, \
+ { V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM, "continuous-bytestream" }, \
+ { V4L2_FMT_FLAG_DYN_RESOLUTION, "dyn-resolution" }, \
+ { V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL, "enc-cap-frame-interval" }, \
+ { V4L2_FMT_FLAG_CSC_COLORSPACE, "csc-colorspace" }, \
+ { V4L2_FMT_FLAG_CSC_YCBCR_ENC, "csc-"#enc_type }, \
+ { V4L2_FMT_FLAG_CSC_QUANTIZATION, "csc-quantization" }, \
+ { V4L2_FMT_FLAG_CSC_XFER_FUNC, "csc-xfer-func" }, \
+ { 0, NULL } \
};
-std::string fmtdesc2s(unsigned flags)
+FMTDESC_DEF(ycbcr)
+FMTDESC_DEF(hsv)
+
+std::string fmtdesc2s(unsigned flags, bool is_hsv)
{
- return flags2s(flags, fmtdesc_def);
+ if (is_hsv)
+ return flags2s(flags, fmtdesc_hsv_def);
+ return flags2s(flags, fmtdesc_ycbcr_def);
}
static const flag_def selection_targets_def[] = {
diff --git a/utils/common/v4l2-info.h b/utils/common/v4l2-info.h
index f7e945a4..f2f41f51 100644
--- a/utils/common/v4l2-info.h
+++ b/utils/common/v4l2-info.h
@@ -52,7 +52,7 @@ std::string pixflags2s(unsigned flags);
std::string service2s(unsigned service);
/* Return v4l2_fmtdesc flags description */
-std::string fmtdesc2s(unsigned flags);
+std::string fmtdesc2s(unsigned flags, bool is_hsv);
/* Return selection flags description */
std::string selflags2s(__u32 flags);

Privacy Policy