From patchwork Wed Feb 4 05:35:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hardik Shah X-Patchwork-Id: 5349 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n145YcOV001933 for ; Wed, 4 Feb 2009 05:36:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751160AbZBDFgJ (ORCPT ); Wed, 4 Feb 2009 00:36:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751166AbZBDFgJ (ORCPT ); Wed, 4 Feb 2009 00:36:09 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:39759 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160AbZBDFgH (ORCPT ); Wed, 4 Feb 2009 00:36:07 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n145a0ae008991 for ; Tue, 3 Feb 2009 23:36:06 -0600 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n145ZuKq017690; Wed, 4 Feb 2009 11:05:56 +0530 (IST) From: Hardik Shah To: linux-media@vger.kernel.org Cc: Hardik Shah , Brijesh Jadav , Hari Nagalla , Vaibhav Hiremath Subject: [PATCH 2/2v2] Documentation update for New V4L2 ioctls for OMAP Date: Wed, 4 Feb 2009 11:05:56 +0530 Message-Id: <1233725756-619-1-git-send-email-hardik.shah@ti.com> X-Mailer: git-send-email 1.5.6 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 1. Added documentation for VIDIOC_COLOR_S_SPACE_CONV and VIDIOC_G_COLOR_SPACE_CONV 2. Added documentation for new CID V4L2_CID_ROTATION and V4L2_CID_BG_COLOR 3. Edited the doucmentation according the Hans Verikul and others comments. Signed-off-by: Brijesh Jadav Signed-off-by: Hari Nagalla Signed-off-by: Hardik Shah Signed-off-by: Vaibhav Hiremath --- Makefile | 4 + controls.sgml | 19 +++- v4l2.sgml | 1 + vidioc-g-color-space-conv.sgml | 225 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 248 insertions(+), 1 deletions(-) create mode 100644 vidioc-g-color-space-conv.sgml -- 1.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Makefile b/Makefile index 9a13c91..b76b4a7 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ SGMLS = \ vidioc-g-audio.sgml \ vidioc-g-audioout.sgml \ vidioc-dbg-g-chip-ident.sgml \ + vidioc-g-color-space-conv.sgml \ vidioc-g-crop.sgml \ vidioc-g-ctrl.sgml \ vidioc-g-enc-index.sgml \ @@ -156,6 +157,7 @@ IOCTLS = \ VIDIOC_ENUM_FRAMESIZES \ VIDIOC_G_AUDIO \ VIDIOC_G_AUDOUT \ + VIDIOC_G_COLOR_SPACE_CONV \ VIDIOC_G_CROP \ VIDIOC_G_CTRL \ VIDIOC_G_ENC_INDEX \ @@ -186,6 +188,7 @@ IOCTLS = \ VIDIOC_STREAMON \ VIDIOC_S_AUDIO \ VIDIOC_S_AUDOUT \ + VIDIOC_S_COLOR_SPACE_CONV \ VIDIOC_S_CROP \ VIDIOC_S_CTRL \ VIDIOC_S_EXT_CTRLS \ @@ -249,6 +252,7 @@ STRUCTS = \ v4l2_capability \ v4l2_captureparm \ v4l2_clip \ + v4l2_color_space_conv \ v4l2_control \ v4l2_crop \ v4l2_cropcap \ diff --git a/controls.sgml b/controls.sgml index 0df57dc..c622bf4 100644 --- a/controls.sgml +++ b/controls.sgml @@ -272,10 +272,27 @@ minimum value disables backlight compensation. Enable the color killer (&ie; force a black & white image in case of a weak video signal). + V4L2_CID_ROTATION + integer + Rotates the image by specified angle. Common angles are 90, 270, +and 180. Rotating the image to 90 and 270 will reverse the height and width of +the display window. Its is necessary to set the new height and width of the picture +using S_FMT ioctl see according to the rotation angle selected + + + V4L2_CID_BG_COLOR + integer + Sets the background color on the current output device. +Background color needs to be specified in the RGB24 format. The supplied 32 +bit value is intepreted as Bits 0-7 Red color information, Bits 8-15 Green color +information, Bits 16-23 Blue color information and Bits 24-31 must be +zero. + + V4L2_CID_LASTP1 End of the predefined control IDs (currently -V4L2_CID_COLOR_KILLER + 1). +V4L2_CID_BG_COLOR + 1). V4L2_CID_PRIVATE_BASE diff --git a/v4l2.sgml b/v4l2.sgml index 9f43b6d..f9f0986 100644 --- a/v4l2.sgml +++ b/v4l2.sgml @@ -435,6 +435,7 @@ available here: + + ioctl VIDIOC_S_COLOR_SPACE_CONV, VIDIOC_G_COLOR_SPACE_CONV + &manvol; + + + + VIDIOC_S_COLOR_SPACE_CONV + VIDIOC_G_COLOR_SPACE_CONV + Get or Set the color space conversion matrix + + + + + + int ioctl + int fd + int request + struct v4l2_color_space_conv +*argp + + + + + + Arguments + + + + fd + + &fd; + + + + request + + VIDIOC_G_COLOR_SPACE_CONV, VIDIOC_S_COLOR_SPACE_CONV + + + + argp + + + + + + + + + Description + + This ioctl is used to set the color space conversion matrix. +Few Video hardware has a programmable color space conversion matrix which +converts the data from one color space to other color space +typically from SMPTE170M to RGB and vice versa. Normally hardware has +default value for the conversion matrix but application may need to tune that. + + Typical color conversion matrix looks like + + + Typical color space conversion matrix equation. + + + + + + + | + O0 + | + + + + | + C0,0 + C0,1 + C0,2 + | + + | + Of0 + | + + + | + O1 + | + + = + K + | + C1,0 + C1,1 + C1,2 + | + * + | + Of1 + | + + + | + O2 + | + + + + | + C2,0 + C2,1 + C2,2 + | + + | + Of2 + | + + + + + + + + Where Ci,j are the coefficients, K is the constant factor and +Ofi is the offsets. All the hardware may not allow modifying +all of these parameters. + + To set values for the color conversion matrix, applications should +first call VIDIOC_G_COLOR_SPACE_CONV with the pointer to a +v4l2_color_space_conv structure. +Driver will return the capabilities of the hardware in terms of color space +conversion and the precision of the coefficients supported along with the +current coefficients and offsets set. +After that application calls VIDIOC_S_COLOR_SPACE_CONV +with the pointer to a v4l2_color_space_conv structure. +Driver checks and updates the parameters in the hardware. + + + struct <structname>v4l2_color_space_conv</structname> + + &cs-str; + + + __s32 + coefficients[3][3] + Conversion Matrix coefficeints. + + + __s32 + const_factor + Constant to be multiplied with the conversion matrix. + + + __s32 + offsets[3] + Offset for the each entry in color conversion matrix. + + + __u32 + capability + Color space conversion capability see see .. + + + __u32 + precision + Precision of the coefficients supported 10 bits, 11 bits etc. + Getting the precision 11 through VIDIOC_G_COLOR_SPACE_CONV ioctl + specifies that the value for the coefficient lies between + -1024 to 1023. + + + + __u32 + reserved[4] + Reserved for future extensions. Drivers and +applications must set the array to zero. + + + +
+ + + Color Space conversion capability flags + + &cs-def; + + + V4L2_COLOR_SPACE_CAP_COEFF + 0x00001 + Setting this flag indicates that hardware is capable of + programming the coefficients in color space conversion matrix + + + V4L2_COLOR_SPACE_CAP_OFFS + 0x00002 + Setting this flag indicates that hardware is capable + of programming the offsets in color space conversion matrix + + + +
+
+ + + &return-value; + + + + EINVAL + + The hardware doesn't supports color space conversion. + + + + + + +