]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/media/video/uvc/uvc_queue.c
V4L/DVB (11945): uvcvideo: Don't accept to change the format when buffers are allocated.
[net-next-2.6.git] / drivers / media / video / uvc / uvc_queue.c
index 0155752e4a5aea54140c55044a266df1099b8575..f854698c40618a4a5225209f1060933f1aafb430 100644 (file)
@@ -172,6 +172,20 @@ int uvc_free_buffers(struct uvc_video_queue *queue)
        return 0;
 }
 
+/*
+ * Check if buffers have been allocated.
+ */
+int uvc_queue_allocated(struct uvc_video_queue *queue)
+{
+       int allocated;
+
+       mutex_lock(&queue->mutex);
+       allocated = queue->count != 0;
+       mutex_unlock(&queue->mutex);
+
+       return allocated;
+}
+
 static void __uvc_query_buffer(struct uvc_buffer *buf,
                struct v4l2_buffer *v4l2_buf)
 {