From abdee12bb04ac0767a51bf70f4e71d6671d4bc3b Mon Sep 17 00:00:00 2001 From: Vitaly Mayatskikh Date: Mon, 7 Sep 2009 12:15:20 +0200 Subject: [PATCH] Add documentation strings to all primary functions. --- v4l2.lisp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/v4l2.lisp b/v4l2.lisp index c706b08..6e0fcd1 100644 --- a/v4l2.lisp +++ b/v4l2.lisp @@ -136,7 +136,7 @@ count))) (defun query-buffer (fd n map-type) - "Query buffer number `n' of type `map-type'" + "Query buffer number `n' of type `map-type'." (let ((buf (make-instance 'buffer))) (with-slots (index type memory) buf (setf index n @@ -151,18 +151,19 @@ collect (query-buffer fd buf map-type))) (defun map-buffers (fd n) + "Map `n' buffers into memory." (let* ((count (request-buffers fd n :memory-mmap)) (buffers (query-buffers fd count :memory-mmap))) (loop for buf in buffers collect (with-slots (index length m) buf -; (cl:format t "map buffer ~D of length ~X~%" index length) (list buf (%sys-mmap (make-pointer 0) length prot-read map-shared fd (buffer-union-offset m)) length))))) (defun unmap-buffers (buffers) + "Unmap given buffers from memory." (loop for buf in buffers do (multiple-value-bind (buffer addr length) (values-list buf) @@ -175,14 +176,17 @@ (ioctl fd req type))) (defun stream-on (fd buffers) + "Start video streaming." (loop for buffer in buffers do (ioctl fd vidioc-qbuf (buffer-raw (car buffer)))) (stream-action fd vidioc-streamon)) (defun stream-off (fd) + "Stop video streaming." (stream-action fd vidioc-streamoff)) (defun get-frame (fd) + "Get next frame from device." (with-foreign-object (buf 'buffer) (with-foreign-slots ((index type memory) buf buffer) (setf type :buf-type-video-capture @@ -191,6 +195,7 @@ (convert-from-foreign index :uint32)))) (defun put-frame (fd n) + "Return frame buffer back to driver." (with-foreign-object (buf 'buffer) (with-foreign-slots ((index type memory) buf buffer) (setf index n @@ -200,6 +205,7 @@ n) (defun set-control (fd ctrl-id level) + "Set control to given level. Level should be in range of 0.0-1.0." (with-foreign-object (query 'queryctrl) (with-foreign-slots ((id minimum maximum) query queryctrl) (setf id ctrl-id) -- 2.11.4.GIT