aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-11-18 07:50:57 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-25 05:47:24 -0500
commitcf227429c74778cc9f8caf734d1f161f8f021915 (patch)
tree625f0b129309a39763d23e555f8d96bf306f7f57 /include
parentef33d901db3026643f1c415562d633dfc6c5e9bb (diff)
[media] videobuf2-core.h: improve documentation
Document that drivers can access/modify the buffer contents in buf_prepare and buf_finish. That was not clearly stated before. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/videobuf2-core.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 6ef2d01197da..70ace7cc6087 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -270,22 +270,24 @@ struct vb2_buffer {
270 * queue setup from completing successfully; optional. 270 * queue setup from completing successfully; optional.
271 * @buf_prepare: called every time the buffer is queued from userspace 271 * @buf_prepare: called every time the buffer is queued from userspace
272 * and from the VIDIOC_PREPARE_BUF ioctl; drivers may 272 * and from the VIDIOC_PREPARE_BUF ioctl; drivers may
273 * perform any initialization required before each hardware 273 * perform any initialization required before each
274 * operation in this callback; drivers that support 274 * hardware operation in this callback; drivers can
275 * VIDIOC_CREATE_BUFS must also validate the buffer size; 275 * access/modify the buffer here as it is still synced for
276 * if an error is returned, the buffer will not be queued 276 * the CPU; drivers that support VIDIOC_CREATE_BUFS must
277 * in driver; optional. 277 * also validate the buffer size; if an error is returned,
278 * the buffer will not be queued in driver; optional.
278 * @buf_finish: called before every dequeue of the buffer back to 279 * @buf_finish: called before every dequeue of the buffer back to
279 * userspace; drivers may perform any operations required 280 * userspace; the buffer is synced for the CPU, so drivers
280 * before userspace accesses the buffer; optional. The 281 * can access/modify the buffer contents; drivers may
281 * buffer state can be one of the following: DONE and 282 * perform any operations required before userspace
282 * ERROR occur while streaming is in progress, and the 283 * accesses the buffer; optional. The buffer state can be
283 * PREPARED state occurs when the queue has been canceled 284 * one of the following: DONE and ERROR occur while
284 * and all pending buffers are being returned to their 285 * streaming is in progress, and the PREPARED state occurs
285 * default DEQUEUED state. Typically you only have to do 286 * when the queue has been canceled and all pending
286 * something if the state is VB2_BUF_STATE_DONE, since in 287 * buffers are being returned to their default DEQUEUED
287 * all other cases the buffer contents will be ignored 288 * state. Typically you only have to do something if the
288 * anyway. 289 * state is VB2_BUF_STATE_DONE, since in all other cases
290 * the buffer contents will be ignored anyway.
289 * @buf_cleanup: called once before the buffer is freed; drivers may 291 * @buf_cleanup: called once before the buffer is freed; drivers may
290 * perform any additional cleanup; optional. 292 * perform any additional cleanup; optional.
291 * @start_streaming: called once to enter 'streaming' state; the driver may 293 * @start_streaming: called once to enter 'streaming' state; the driver may