diff options
author | Luca Ceresoli <luca@lucaceresoli.net> | 2018-05-14 13:27:25 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-05-25 21:24:06 +0200 |
commit | ff9273f5b87f1a5662a978c73ef684fec7b166fc (patch) | |
tree | 9a566313205f5af098b039d94a1afc472e039b7b /Documentation/media/uapi/v4l/selection-api-006.rst | |
parent | media: docs: clarify relationship between crop and selection APIs (diff) | |
download | linux-ff9273f5b87f1a5662a978c73ef684fec7b166fc.tar.xz linux-ff9273f5b87f1a5662a978c73ef684fec7b166fc.zip |
media: docs: selection: rename files to something meaningful
These files have an automatically-generated numbering. Rename them
with a name that suggests their meaning.
Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'Documentation/media/uapi/v4l/selection-api-006.rst')
-rw-r--r-- | Documentation/media/uapi/v4l/selection-api-006.rst | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/Documentation/media/uapi/v4l/selection-api-006.rst b/Documentation/media/uapi/v4l/selection-api-006.rst deleted file mode 100644 index 67e0e9aed9e8..000000000000 --- a/Documentation/media/uapi/v4l/selection-api-006.rst +++ /dev/null @@ -1,84 +0,0 @@ -.. -*- coding: utf-8; mode: rst -*- - -******** -Examples -******** - -(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) - -Example: Resetting the cropping parameters -========================================== - -.. code-block:: c - - struct v4l2_selection sel = { - .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, - .target = V4L2_SEL_TGT_CROP_DEFAULT, - }; - ret = ioctl(fd, VIDIOC_G_SELECTION, &sel); - if (ret) - exit(-1); - sel.target = V4L2_SEL_TGT_CROP; - ret = ioctl(fd, VIDIOC_S_SELECTION, &sel); - if (ret) - exit(-1); - -Setting a composing area on output of size of *at most* half of limit -placed at a center of a display. - -Example: Simple downscaling -=========================== - -.. code-block:: c - - struct v4l2_selection sel = { - .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, - .target = V4L2_SEL_TGT_COMPOSE_BOUNDS, - }; - struct v4l2_rect r; - - ret = ioctl(fd, VIDIOC_G_SELECTION, &sel); - if (ret) - exit(-1); - /* setting smaller compose rectangle */ - r.width = sel.r.width / 2; - r.height = sel.r.height / 2; - r.left = sel.r.width / 4; - r.top = sel.r.height / 4; - sel.r = r; - sel.target = V4L2_SEL_TGT_COMPOSE; - sel.flags = V4L2_SEL_FLAG_LE; - ret = ioctl(fd, VIDIOC_S_SELECTION, &sel); - if (ret) - exit(-1); - -A video output device is assumed; change ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` -for other devices - -Example: Querying for scaling factors -===================================== - -.. code-block:: c - - struct v4l2_selection compose = { - .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, - .target = V4L2_SEL_TGT_COMPOSE, - }; - struct v4l2_selection crop = { - .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, - .target = V4L2_SEL_TGT_CROP, - }; - double hscale, vscale; - - ret = ioctl(fd, VIDIOC_G_SELECTION, &compose); - if (ret) - exit(-1); - ret = ioctl(fd, VIDIOC_G_SELECTION, &crop); - if (ret) - exit(-1); - - /* computing scaling factors */ - hscale = (double)compose.r.width / crop.r.width; - vscale = (double)compose.r.height / crop.r.height; |