]> Pileus Git - ~andy/linux/blobdiff - include/media/videobuf2-core.h
resizable namespace.c hashes
[~andy/linux] / include / media / videobuf2-core.h
index 941055e9d125af3bfe5a6915ff551e0bb1532445..bef53ce555d2641d9538dad2982856e9677c8dd4 100644 (file)
@@ -142,6 +142,7 @@ enum vb2_fileio_flags {
 /**
  * enum vb2_buffer_state - current video buffer state
  * @VB2_BUF_STATE_DEQUEUED:    buffer under userspace control
+ * @VB2_BUF_STATE_PREPARING:   buffer is being prepared in videobuf
  * @VB2_BUF_STATE_PREPARED:    buffer prepared in videobuf and by the driver
  * @VB2_BUF_STATE_QUEUED:      buffer queued in videobuf, but not in driver
  * @VB2_BUF_STATE_ACTIVE:      buffer queued in driver and possibly used
@@ -154,6 +155,7 @@ enum vb2_fileio_flags {
  */
 enum vb2_buffer_state {
        VB2_BUF_STATE_DEQUEUED,
+       VB2_BUF_STATE_PREPARING,
        VB2_BUF_STATE_PREPARED,
        VB2_BUF_STATE_QUEUED,
        VB2_BUF_STATE_ACTIVE,
@@ -250,10 +252,13 @@ struct vb2_buffer {
  *                     receive buffers with @buf_queue callback before
  *                     @start_streaming is called; the driver gets the number
  *                     of already queued buffers in count parameter; driver
- *                     can return an error if hardware fails or not enough
- *                     buffers has been queued, in such case all buffers that
- *                     have been already given by the @buf_queue callback are
- *                     invalidated.
+ *                     can return an error if hardware fails, in that case all
+ *                     buffers that have been already given by the @buf_queue
+ *                     callback are invalidated.
+ *                     If there were not enough queued buffers to start
+ *                     streaming, then this callback returns -ENOBUFS, and the
+ *                     vb2 core will retry calling @start_streaming when a new
+ *                     buffer is queued.
  * @stop_streaming:    called when 'streaming' state must be disabled; driver
  *                     should stop any DMA transactions or wait until they
  *                     finish and give back all buffers it got from buf_queue()
@@ -321,6 +326,9 @@ struct v4l2_fh;
  * @done_wq:   waitqueue for processes waiting for buffers ready to be dequeued
  * @alloc_ctx: memory type/allocator-specific contexts for each plane
  * @streaming: current streaming state
+ * @retry_start_streaming: start_streaming() was called, but there were not enough
+ *             buffers queued. If set, then retry calling start_streaming when
+ *             queuing a new buffer.
  * @fileio:    file io emulator internal data, used only if emulator is active
  */
 struct vb2_queue {
@@ -353,6 +361,7 @@ struct vb2_queue {
        unsigned int                    plane_sizes[VIDEO_MAX_PLANES];
 
        unsigned int                    streaming:1;
+       unsigned int                    retry_start_streaming:1;
 
        struct vb2_fileio_data          *fileio;
 };
@@ -491,6 +500,7 @@ int vb2_ioctl_expbuf(struct file *file, void *priv,
 
 int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma);
 int vb2_fop_release(struct file *file);
+int _vb2_fop_release(struct file *file, struct mutex *lock);
 ssize_t vb2_fop_write(struct file *file, const char __user *buf,
                size_t count, loff_t *ppos);
 ssize_t vb2_fop_read(struct file *file, char __user *buf,