summaryrefslogtreecommitdiff
path: root/Documentation/linux_tv/media/v4l/selection-api-005.rst
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2016-06-30 15:18:56 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-06-30 16:14:52 -0300
commit5377d91f3e88d5c8da46b1feba78b00d379fb7b6 (patch)
treee1b42603f4ccab1e027454cf04ebe7ea11bea30f /Documentation/linux_tv/media/v4l/selection-api-005.rst
parent6ab99fa6a04b60ff14368af98e2763e707ffc691 (diff)
downloadlwn-5377d91f3e88d5c8da46b1feba78b00d379fb7b6.tar.gz
lwn-5377d91f3e88d5c8da46b1feba78b00d379fb7b6.zip
doc-rst: linux_tv DocBook to reST migration (docs-next)
This is the restructuredText (reST) migration of the ``media`` DocBook-XML set from the linux_tv project. Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'Documentation/linux_tv/media/v4l/selection-api-005.rst')
-rw-r--r--Documentation/linux_tv/media/v4l/selection-api-005.rst42
1 files changed, 42 insertions, 0 deletions
diff --git a/Documentation/linux_tv/media/v4l/selection-api-005.rst b/Documentation/linux_tv/media/v4l/selection-api-005.rst
new file mode 100644
index 000000000000..aefab87788db
--- /dev/null
+++ b/Documentation/linux_tv/media/v4l/selection-api-005.rst
@@ -0,0 +1,42 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+********************************
+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 struct
+:ref:`v4l2_pix_format <v4l2-pix-format>```::bytesperline``.
+Introducing an image offsets could be done by modifying field struct
+:ref:`v4l2_buffer <v4l2-buffer>```::m_userptr`` 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 portable way. Next, with
+the selection API the concepts of the padded target and constraints
+flags are introduced. Finally, struct :ref:`v4l2_crop <v4l2-crop>`
+and struct :ref:`v4l2_cropcap <v4l2-cropcap>` have no reserved
+fields. Therefore there is no way to extend their functionality. The new
+struct :ref:`v4l2_selection <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.
+
+
+.. ------------------------------------------------------------------------------
+.. This file was automatically converted from DocBook-XML with the dbxml
+.. library (https://github.com/return42/sphkerneldoc). The origin XML comes
+.. from the linux kernel, refer to:
+..
+.. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
+.. ------------------------------------------------------------------------------