From 5bf048c1b9a39eec21be8ab3f0ef27bda8f9b8d6 Mon Sep 17 00:00:00 2001 From: Vitaly Mayatskikh Date: Mon, 3 Aug 2009 21:43:16 +0200 Subject: [PATCH] Return v4l2-format from v4l2-set-image-format VIDIOC_S_FORMAT adjusts v4l2_format structure to actual parameters. It is often useful for application to know these parameters, so just return them back to caller. --- v4l2.lisp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/v4l2.lisp b/v4l2.lisp index 2ade71d..c5d54ef 100644 --- a/v4l2.lisp +++ b/v4l2.lisp @@ -150,15 +150,16 @@ (defun v4l2-set-image-format (fd w h pixfmt) "Set dimenstions and pixel format." - (with-foreign-object (format 'v4l2-format) - (with-foreign-slots ((type pix) format v4l2-format) + (with-ref (format 'v4l2-format) + (with-ref-slots ((type pix) format v4l2-format) (with-foreign-slots ((width height pixelformat field) pix v4l2-pix-format) (setf type :buf-type-video-capture width w height h pixelformat pixfmt field :field-any))) - (ioctl fd vidioc-set-fmt format))) + (ioctl fd vidioc-set-fmt (ref format)) + format)) (defun v4l2-get-image-format (fd) "Get current format." -- 2.11.4.GIT