This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:
Subject: v4l-utils: update to new colorspace defines Author: Hans Verkuil <[email protected]> Date: Mon Jun 1 08:54:47 2015 +0200 Add support for the new colorspace defines. In particular, replace colorspace value '0' with V4L2_COLORSPACE_DEFAULT. Signed-off-by: Hans Verkuil <[email protected]> lib/libv4lconvert/libv4lconvert.c | 2 +- utils/qv4l2/capture-win-gl.cpp | 27 --------------------------- utils/qv4l2/general-tab.cpp | 4 ++-- utils/qv4l2/tpg-tab.cpp | 4 ++-- utils/v4l2-ctl/v4l2-ctl.cpp | 4 ++++ 5 files changed, 9 insertions(+), 32 deletions(-) --- http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=7df65975109ded8a69629a8e11aa548265c70e53 diff --git a/lib/libv4lconvert/libv4lconvert.c b/lib/libv4lconvert/libv4lconvert.c index 004dc72..57d0176 100644 --- a/lib/libv4lconvert/libv4lconvert.c +++ b/lib/libv4lconvert/libv4lconvert.c @@ -434,7 +434,7 @@ static int v4lconvert_do_try_format_uvc(struct v4lconvert_data *data, so we should be able to get away with this. */ dest_fmt->fmt.pix.bytesperline = 0; dest_fmt->fmt.pix.sizeimage = 0; - dest_fmt->fmt.pix.colorspace = 0; + dest_fmt->fmt.pix.colorspace = V4L2_COLORSPACE_DEFAULT; dest_fmt->fmt.pix.priv = 0; *src_fmt = *dest_fmt; diff --git a/utils/qv4l2/capture-win-gl.cpp b/utils/qv4l2/capture-win-gl.cpp index c33be9d..2783c63 100644 --- a/utils/qv4l2/capture-win-gl.cpp +++ b/utils/qv4l2/capture-win-gl.cpp @@ -24,33 +24,6 @@ #include <stdio.h> -/* - * These two helper defines are taken from code that is not yet merged - * in the kernel, but since they are very useful I've copied them here - * for the time being. - */ - -/* - * Determine how YCBCR_ENC_DEFAULT should map to a proper Y'CbCr encoding. - * This depends on the colorspace. - */ -#define V4L2_MAP_YCBCR_ENC_DEFAULT(colsp) \ - ((colsp) == V4L2_COLORSPACE_REC709 ? V4L2_YCBCR_ENC_709 : \ - ((colsp) == V4L2_COLORSPACE_BT2020 ? V4L2_YCBCR_ENC_BT2020 : \ - ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_YCBCR_ENC_SMPTE240M : \ - V4L2_YCBCR_ENC_601))) - -/* - * Determine how QUANTIZATION_DEFAULT should map to a proper quantization. - * This depends on whether the image is RGB or not, the colorspace and the - * Y'CbCr encoding. - */ -#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \ - (((is_rgb) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : \ - (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \ - (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) ? \ - V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)) - CaptureWinGL::CaptureWinGL(ApplicationWindow *aw) : CaptureWin(aw) { diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp index d180117..13facc5 100644 --- a/utils/qv4l2/general-tab.cpp +++ b/utils/qv4l2/general-tab.cpp @@ -741,7 +741,7 @@ void GeneralTab::formatSection(v4l2_fmtdesc fmt) if (!isRadio() && !isVbi()) { m_colorspace = new QComboBox(parentWidget()); - m_colorspace->addItem(m_isOutput ? "Default" : "Autodetect", QVariant(0)); + m_colorspace->addItem(m_isOutput ? "Default" : "Autodetect", QVariant(V4L2_COLORSPACE_DEFAULT)); m_colorspace->addItem("SMPTE 170M", QVariant(V4L2_COLORSPACE_SMPTE170M)); m_colorspace->addItem("Rec. 709", QVariant(V4L2_COLORSPACE_REC709)); m_colorspace->addItem("sRGB", QVariant(V4L2_COLORSPACE_SRGB)); @@ -1405,7 +1405,7 @@ void GeneralTab::quantRangeChanged(int idx) void GeneralTab::clearColorspace(cv4l_fmt &fmt) { if (m_colorspace->currentIndex() == 0) - fmt.s_colorspace(0); + fmt.s_colorspace(V4L2_COLORSPACE_DEFAULT); if (m_ycbcrEnc->currentIndex() == 0) fmt.s_ycbcr_enc(V4L2_YCBCR_ENC_DEFAULT); if (m_quantRange->currentIndex() == 0) diff --git a/utils/qv4l2/tpg-tab.cpp b/utils/qv4l2/tpg-tab.cpp index b253075..1bc07a9 100644 --- a/utils/qv4l2/tpg-tab.cpp +++ b/utils/qv4l2/tpg-tab.cpp @@ -330,9 +330,9 @@ void ApplicationWindow::tpgColorspaceChanged() int quantization = combo2int(m_tpgQuantRange); g_fmt(fmt); - if (colorspace == 0) + if (colorspace == V4L2_COLORSPACE_DEFAULT) colorspace = fmt.g_colorspace(); - if (colorspace == 0) + if (colorspace == V4L2_COLORSPACE_DEFAULT) colorspace = tpgDefaultColorspace(); if (ycbcrEnc == V4L2_YCBCR_ENC_DEFAULT) ycbcrEnc = fmt.g_ycbcr_enc(); diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp index 33710a8..5124540 100644 --- a/utils/v4l2-ctl/v4l2-ctl.cpp +++ b/utils/v4l2-ctl/v4l2-ctl.cpp @@ -367,6 +367,8 @@ std::string field2s(int val) std::string colorspace2s(int val) { switch (val) { + case V4L2_COLORSPACE_DEFAULT: + return "Default"; case V4L2_COLORSPACE_SMPTE170M: return "SMPTE 170M"; case V4L2_COLORSPACE_SMPTE240M: @@ -387,6 +389,8 @@ std::string colorspace2s(int val) return "AdobeRGB"; case V4L2_COLORSPACE_BT2020: return "BT.2020"; + case V4L2_COLORSPACE_RAW: + return "Raw"; default: return "Unknown (" + num2s(val) + ")"; } _______________________________________________ linuxtv-commits mailing list [email protected] http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
