diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-03-04 05:34:49 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-03-11 05:56:39 -0400 |
commit | 9c0863b1cc485f2bacac0675c68b73e5341cfd26 (patch) | |
tree | add2ca56deca15ea064d34966edfa21dcef40fe3 /include | |
parent | 1a17948184a3320e0bb0aab561112211d2e9b7a8 (diff) |
[media] vb2: call buf_finish from __queue_cancel
If a queue was canceled, then the buf_finish op was never called for the
pending buffers. So add this call to queue_cancel. Before calling buf_finish
set the buffer state to PREPARED, which is the correct state. That way the
states DONE and ERROR will only be seen in buf_finish if streaming is in
progress.
Since buf_finish can now be called from non-streaming state we need to
adapt the handful of drivers that actually need to know this.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/media/videobuf2-core.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 8d62a51cb7a0..2ffcb81aee9c 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
@@ -276,7 +276,15 @@ struct vb2_buffer { | |||
276 | * in driver; optional | 276 | * in driver; optional |
277 | * @buf_finish: called before every dequeue of the buffer back to | 277 | * @buf_finish: called before every dequeue of the buffer back to |
278 | * userspace; drivers may perform any operations required | 278 | * userspace; drivers may perform any operations required |
279 | * before userspace accesses the buffer; optional | 279 | * before userspace accesses the buffer; optional. The |
280 | * buffer state can be one of the following: DONE and | ||
281 | * ERROR occur while streaming is in progress, and the | ||
282 | * PREPARED state occurs when the queue has been canceled | ||
283 | * and all pending buffers are being returned to their | ||
284 | * default DEQUEUED state. Typically you only have to do | ||
285 | * something if the state is VB2_BUF_STATE_DONE, since in | ||
286 | * all other cases the buffer contents will be ignored | ||
287 | * anyway. | ||
280 | * @buf_cleanup: called once before the buffer is freed; drivers may | 288 | * @buf_cleanup: called once before the buffer is freed; drivers may |
281 | * perform any additional cleanup; optional | 289 | * perform any additional cleanup; optional |
282 | * @start_streaming: called once to enter 'streaming' state; the driver may | 290 | * @start_streaming: called once to enter 'streaming' state; the driver may |