v4l: v4l2_subdev userspace format API
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 15 Mar 2010 23:26:04 +0000 (00:26 +0100)
committerJason Kridner <jkridner@beagleboard.org>
Thu, 10 Mar 2011 23:38:27 +0000 (17:38 -0600)
commit1740ff60900f92d3ac10700d5c782876dd0d95eb
tree472204c87e9e0d2147c1ebe2cc6e4971f1ea357e
parent5f9f6e69aca1572a298117affb81699ce1e8ae8f
v4l: v4l2_subdev userspace format API

Add a userspace API to get, set and enumerate the media format on a
subdev pad.

The format at the output of a subdev usually depends on the format at
its input(s). The try format operation is thus not suitable for probing
format at individual pads, as it can't modify the device state and thus
can't remember the format tried at the input to compute the output
format.

To fix the problem, pass an extra argument to the get/set format
operations to select the 'try' or 'active' format.

The try format is used when probing the subdev. Setting the try format
must not change the device configuration but can store data for later
reuse. Data storage is provided at the file-handle level so applications
probing the subdev concurently won't interfere with each other.

The active format is used when configuring the subdev. It's identical to
the format handled by the usual get/set operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
13 files changed:
Documentation/DocBook/Makefile
Documentation/DocBook/media-entities.tmpl
Documentation/DocBook/v4l/dev-subdev.xml [new file with mode: 0644]
Documentation/DocBook/v4l/subdev-formats.xml [new file with mode: 0644]
Documentation/DocBook/v4l/v4l2.xml
Documentation/DocBook/v4l/vidioc-streamon.xml
Documentation/DocBook/v4l/vidioc-subdev-enum-frame-size.xml [new file with mode: 0644]
Documentation/DocBook/v4l/vidioc-subdev-enum-mbus-code.xml [new file with mode: 0644]
Documentation/DocBook/v4l/vidioc-subdev-g-fmt.xml [new file with mode: 0644]
drivers/media/video/v4l2-subdev.c
include/linux/Kbuild
include/linux/v4l2-subdev.h [new file with mode: 0644]
include/media/v4l2-subdev.h