aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/media/uapi/v4l/selection-api-vs-crop-api.rst
diff options
context:
space:
mode:
authorLuca Ceresoli <luca@lucaceresoli.net>2018-05-14 07:27:25 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-05-25 15:24:06 -0400
commitff9273f5b87f1a5662a978c73ef684fec7b166fc (patch)
tree9a566313205f5af098b039d94a1afc472e039b7b /Documentation/media/uapi/v4l/selection-api-vs-crop-api.rst
parentmedia: docs: clarify relationship between crop and selection APIs (diff)
downloadlinux-dev-ff9273f5b87f1a5662a978c73ef684fec7b166fc.tar.xz
linux-dev-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-vs-crop-api.rst')
-rw-r--r--Documentation/media/uapi/v4l/selection-api-vs-crop-api.rst36
1 files changed, 36 insertions, 0 deletions
diff --git a/Documentation/media/uapi/v4l/selection-api-vs-crop-api.rst b/Documentation/media/uapi/v4l/selection-api-vs-crop-api.rst
new file mode 100644
index 000000000000..2ad30a49184f
--- /dev/null
+++ b/Documentation/media/uapi/v4l/selection-api-vs-crop-api.rst
@@ -0,0 +1,36 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _selection-vs-crop:
+
+********************************
+Comparison with old cropping API
+********************************
+
+The selection API was introduced to cope with deficiencies of previous
+:ref:`API <crop>`, 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 actually the composing. The selection API makes a clear
+distinction between composing and cropping operations by setting the
+appropriate targets. The V4L2 API lacks any support for composing to and
+cropping from an image inside a memory buffer. The application could
+configure a capture device to fill only a part of an image by abusing
+V4L2 API. Cropping a smaller image from a larger one is achieved by
+setting the field ``bytesperline`` at struct
+:c:type:`v4l2_pix_format`.
+Introducing an image offsets could be done by modifying field ``m_userptr``
+at struct
+:c:type:`v4l2_buffer` before calling
+:ref:`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 portable way. Next, with
+the selection API the concepts of the padded target and constraints
+flags are introduced. Finally, struct :c:type:`v4l2_crop`
+and struct :c:type:`v4l2_cropcap` have no reserved
+fields. Therefore there is no way to extend their functionality. The new
+struct :c:type:`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.