From patchwork Sat Jul 5 08:31:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 4486561 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64FE4BEEAA for ; Sat, 5 Jul 2014 08:31:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3A3520411 for ; Sat, 5 Jul 2014 08:31:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C85D12024C for ; Sat, 5 Jul 2014 08:31:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754552AbaGEIbT (ORCPT ); Sat, 5 Jul 2014 04:31:19 -0400 Received: from lb1-smtp-cloud6.xs4all.net ([194.109.24.24]:49631 "EHLO lb1-smtp-cloud6.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754352AbaGEIbP (ORCPT ); Sat, 5 Jul 2014 04:31:15 -0400 Received: from tschai.lan ([80.203.20.209]) by smtp-cloud6.xs4all.net with ESMTP id NYXA1o0074Wfp8Y01YXDWg; Sat, 05 Jul 2014 10:31:13 +0200 Received: from test-media.192.168.1.1 (test [192.168.1.27]) by tschai.lan (Postfix) with ESMTPSA id 34E7F2A1FCF; Sat, 5 Jul 2014 10:31:06 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil Subject: [PATCH 1/3] DocBook media: fix wrong spacing Date: Sat, 5 Jul 2014 10:31:03 +0200 Message-Id: <1404549065-25042-1-git-send-email-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.0.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil There shouldn't be any spaces after or before . This leads to ugly results like: 'image size set by VIDIOC_S_FMT .' Signed-off-by: Hans Verkuil --- Documentation/DocBook/media/v4l/selection-api.xml | 95 +++++++++++----------- .../DocBook/media/v4l/vidioc-g-selection.xml | 40 +++++---- 2 files changed, 66 insertions(+), 69 deletions(-) diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml index 4c238ce..28cbded 100644 --- a/Documentation/DocBook/media/v4l/selection-api.xml +++ b/Documentation/DocBook/media/v4l/selection-api.xml @@ -86,47 +86,47 @@ selection targets available for a video capture device. It is recommended to configure the cropping targets before to the composing targets. The range of coordinates of the top left corner, width and height of -areas that can be sampled is given by the V4L2_SEL_TGT_CROP_BOUNDS - target. It is recommended for the driver developers to put the -top/left corner at position (0,0) . The rectangle's +areas that can be sampled is given by the V4L2_SEL_TGT_CROP_BOUNDS +target. It is recommended for the driver developers to put the +top/left corner at position (0,0). The rectangle's coordinates are expressed in pixels. The top left corner, width and height of the source rectangle, that is -the area actually sampled, is given by the V4L2_SEL_TGT_CROP - target. It uses the same coordinate system as -V4L2_SEL_TGT_CROP_BOUNDS . The active cropping area must lie -completely inside the capture boundaries. The driver may further adjust the -requested size and/or position according to hardware limitations. +the area actually sampled, is given by the V4L2_SEL_TGT_CROP +target. It uses the same coordinate system as V4L2_SEL_TGT_CROP_BOUNDS. +The active cropping area must lie completely inside the capture boundaries. The +driver may further adjust the requested size and/or position according to hardware +limitations. Each capture device has a default source rectangle, given by the - V4L2_SEL_TGT_CROP_DEFAULT target. This rectangle shall +V4L2_SEL_TGT_CROP_DEFAULT target. This rectangle shall over what the driver writer considers the complete picture. Drivers shall set the active crop rectangle to the default when the driver is first loaded, but not later. The composing targets refer to a memory buffer. The limits of composing -coordinates are obtained using V4L2_SEL_TGT_COMPOSE_BOUNDS -. All coordinates are expressed in pixels. The rectangle's top/left -corner must be located at position (0,0) . The width and -height are equal to the image size set by VIDIOC_S_FMT . +coordinates are obtained using V4L2_SEL_TGT_COMPOSE_BOUNDS. +All coordinates are expressed in pixels. The rectangle's top/left +corner must be located at position (0,0). The width and +height are equal to the image size set by VIDIOC_S_FMT. The part of a buffer into which the image is inserted by the hardware is -controlled by the V4L2_SEL_TGT_COMPOSE target. +controlled by the V4L2_SEL_TGT_COMPOSE target. The rectangle's coordinates are also expressed in the same coordinate system as the bounds rectangle. The composing rectangle must lie completely inside bounds rectangle. The driver must adjust the composing rectangle to fit to the bounding limits. Moreover, the driver can perform other adjustments according to hardware limitations. The application can control rounding behaviour using - constraint flags . + constraint flags. For capture devices the default composing rectangle is queried using - V4L2_SEL_TGT_COMPOSE_DEFAULT . It is usually equal to the +V4L2_SEL_TGT_COMPOSE_DEFAULT. It is usually equal to the bounding rectangle. The part of a buffer that is modified by the hardware is given by - V4L2_SEL_TGT_COMPOSE_PADDED . It contains all pixels -defined using V4L2_SEL_TGT_COMPOSE plus all +V4L2_SEL_TGT_COMPOSE_PADDED. It contains all pixels +defined using V4L2_SEL_TGT_COMPOSE plus all padding data modified by hardware during insertion process. All pixels outside this rectangle must not be changed by the hardware. The content of pixels that lie inside the padded area but outside active area is @@ -140,52 +140,51 @@ where the rubbish pixels are located and remove them if needed. Configuration of video output For output devices targets and ioctls are used similarly to the video -capture case. The composing rectangle refers to the +capture case. The composing rectangle refers to the insertion of an image into a video signal. The cropping rectangles refer to a memory buffer. It is recommended to configure the composing targets before to the cropping targets. The cropping targets refer to the memory buffer that contains an image to be inserted into a video signal or graphical screen. The limits of cropping -coordinates are obtained using V4L2_SEL_TGT_CROP_BOUNDS . +coordinates are obtained using V4L2_SEL_TGT_CROP_BOUNDS. All coordinates are expressed in pixels. The top/left corner is always point - (0,0) . The width and height is equal to the image size -specified using VIDIOC_S_FMT ioctl. +(0,0). The width and height is equal to the image size +specified using VIDIOC_S_FMT ioctl. The top left corner, width and height of the source rectangle, that is the area from which image date are processed by the hardware, is given by the - V4L2_SEL_TGT_CROP . Its coordinates are expressed +V4L2_SEL_TGT_CROP. Its coordinates are expressed in in the same coordinate system as the bounds rectangle. The active cropping area must lie completely inside the crop boundaries and the driver may further adjust the requested size and/or position according to hardware limitations. For output devices the default cropping rectangle is queried using - V4L2_SEL_TGT_CROP_DEFAULT . It is usually equal to the +V4L2_SEL_TGT_CROP_DEFAULT. It is usually equal to the bounding rectangle. The part of a video signal or graphics display where the image is -inserted by the hardware is controlled by -V4L2_SEL_TGT_COMPOSE target. The rectangle's coordinates -are expressed in pixels. The composing rectangle must lie completely inside the -bounds rectangle. The driver must adjust the area to fit to the bounding -limits. Moreover, the driver can perform other adjustments according to -hardware limitations. - -The device has a default composing rectangle, given by the -V4L2_SEL_TGT_COMPOSE_DEFAULT target. This rectangle shall cover what +inserted by the hardware is controlled by V4L2_SEL_TGT_COMPOSE +target. The rectangle's coordinates are expressed in pixels. The composing +rectangle must lie completely inside the bounds rectangle. The driver must +adjust the area to fit to the bounding limits. Moreover, the driver can +perform other adjustments according to hardware limitations. + +The device has a default composing rectangle, given by the +V4L2_SEL_TGT_COMPOSE_DEFAULT target. This rectangle shall cover what the driver writer considers the complete picture. It is recommended for the -driver developers to put the top/left corner at position (0,0) -. Drivers shall set the active composing rectangle to the default +driver developers to put the top/left corner at position (0,0). +Drivers shall set the active composing rectangle to the default one when the driver is first loaded. The devices may introduce additional content to video signal other than an image from memory buffers. It includes borders around an image. However, such a padded area is driver-dependent feature not covered by this document. Driver developers are encouraged to keep padded rectangle equal to active one. -The padded target is accessed by the V4L2_SEL_TGT_COMPOSE_PADDED - identifier. It must contain all pixels from the -V4L2_SEL_TGT_COMPOSE target. +The padded target is accessed by the V4L2_SEL_TGT_COMPOSE_PADDED +identifier. It must contain all pixels from the V4L2_SEL_TGT_COMPOSE +target. @@ -194,8 +193,8 @@ V4L2_SEL_TGT_COMPOSE target. Scaling control An application can detect if scaling is performed by comparing the width -and the height of rectangles obtained using V4L2_SEL_TGT_CROP - and V4L2_SEL_TGT_COMPOSE targets. If +and the height of rectangles obtained using V4L2_SEL_TGT_CROP +and V4L2_SEL_TGT_COMPOSE targets. If these are not equal then the scaling is applied. The application can compute the scaling ratios using these values. @@ -208,7 +207,7 @@ the scaling ratios using these values. Comparison with old cropping API The selection API was introduced to cope with deficiencies of previous - API , that was designed to control simple capture + API, that was designed to control simple capture devices. Later the cropping API was adopted by video output drivers. The ioctls are used to select a part of the display were the video signal is inserted. It should be considered as an API abuse because the described operation is @@ -220,7 +219,7 @@ part of an image by abusing V4L2 API. Cropping a smaller image from a larger one is achieved by setting the field &v4l2-pix-format;::bytesperline. Introducing an image offsets could be done by modifying field &v4l2-buffer;::m_userptr -before calling VIDIOC_QBUF . Those +before calling VIDIOC_QBUF. Those operations should be avoided because they are not portable (endianness), and do not work for macroblock and Bayer formats and mmap buffers. The selection API deals with configuration of buffer cropping/composing in a clear, intuitive and @@ -229,7 +228,7 @@ and constraints flags are introduced. Finally, &v4l2-crop; and &v4l2-cropcap; have no reserved fields. Therefore there is no way to extend their functionality. The new &v4l2-selection; provides a lot of place for future extensions. Driver developers are encouraged to implement only selection API. -The former cropping API would be simulated using the new one. +The former cropping API would be simulated using the new one. @@ -238,9 +237,9 @@ The former cropping API would be simulated using the new one. Resetting the cropping parameters - (A video capture device is assumed; change -V4L2_BUF_TYPE_VIDEO_CAPTURE for other devices; change target to - V4L2_SEL_TGT_COMPOSE_* family to configure composing + (A video capture device is assumed; change +V4L2_BUF_TYPE_VIDEO_CAPTURE for other devices; change target to +V4L2_SEL_TGT_COMPOSE_* family to configure composing area) @@ -292,8 +291,8 @@ area) Querying for scaling factors - A video output device is assumed; change -V4L2_BUF_TYPE_VIDEO_OUTPUT for other devices + A video output device is assumed; change +V4L2_BUF_TYPE_VIDEO_OUTPUT for other devices &v4l2-selection; compose = { diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml index b11ec75..9c04ac8 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml @@ -58,17 +58,16 @@ The ioctls are used to query and configure selection rectangles. - To query the cropping (composing) rectangle set &v4l2-selection; +To query the cropping (composing) rectangle set &v4l2-selection; type field to the respective buffer type. -Do not use multiplanar buffers. Use V4L2_BUF_TYPE_VIDEO_CAPTURE - instead of V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE -. Use V4L2_BUF_TYPE_VIDEO_OUTPUT instead of - V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE . The next step is +Do not use multiplanar buffers. Use V4L2_BUF_TYPE_VIDEO_CAPTURE +instead of V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE. Use +V4L2_BUF_TYPE_VIDEO_OUTPUT instead of +V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE. The next step is setting the value of &v4l2-selection; target field -to V4L2_SEL_TGT_CROP ( -V4L2_SEL_TGT_COMPOSE ). Please refer to table or for additional -targets. The flags and reserved +to V4L2_SEL_TGT_CROP (V4L2_SEL_TGT_COMPOSE). +Please refer to table or +for additional targets. The flags and reserved fields of &v4l2-selection; are ignored and they must be filled with zeros. The driver fills the rest of the structure or returns &EINVAL; if incorrect buffer type or target was used. If cropping @@ -77,19 +76,18 @@ always equal to the bounds rectangle. Finally, the &v4l2-rect; r rectangle is filled with the current cropping (composing) coordinates. The coordinates are expressed in driver-dependent units. The only exception are rectangles for images in raw formats, whose -coordinates are always expressed in pixels. +coordinates are always expressed in pixels. - To change the cropping (composing) rectangle set the &v4l2-selection; +To change the cropping (composing) rectangle set the &v4l2-selection; type field to the respective buffer type. Do not -use multiplanar buffers. Use V4L2_BUF_TYPE_VIDEO_CAPTURE - instead of V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE -. Use V4L2_BUF_TYPE_VIDEO_OUTPUT instead of - V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE . The next step is +use multiplanar buffers. Use V4L2_BUF_TYPE_VIDEO_CAPTURE +instead of V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE. Use +V4L2_BUF_TYPE_VIDEO_OUTPUT instead of +V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE. The next step is setting the value of &v4l2-selection; target to -V4L2_SEL_TGT_CROP ( -V4L2_SEL_TGT_COMPOSE ). Please refer to table or for additional -targets. The &v4l2-rect; r rectangle need to be +V4L2_SEL_TGT_CROP (V4L2_SEL_TGT_COMPOSE). +Please refer to table or +for additional targets. The &v4l2-rect; r rectangle need to be set to the desired active area. Field &v4l2-selection; reserved is ignored and must be filled with zeros. The driver may adjust coordinates of the requested rectangle. An application may @@ -149,8 +147,8 @@ On success the &v4l2-rect; r field contains the adjusted rectangle. When the parameters are unsuitable the application may modify the cropping (composing) or image parameters and repeat the cycle until satisfactory parameters have been negotiated. If constraints flags have to be -violated at then ERANGE is returned. The error indicates that there -exist no rectangle that satisfies the constraints. +violated at then ERANGE is returned. The error indicates that there +exist no rectangle that satisfies the constraints. Selection targets and flags are documented in .