[Openmcl-devel] Why is my pointer not a pointer?

Ron Garret ron at awun.net
Wed Jul 16 19:13:54 UTC 2008


I'm trying to capture still images from an iSight camera (without  
using Quartz).  My current approach is:

1.  Set up a QTCaptureView and connect it to a QTCaptureSession which  
is in turn connected to the camera.

2.  Install a delegate in the QTCaptureView to intercept the images  
and make copies of them when needed.

(Just grabbing the images directly from the QTCaptureView turns out  
not to work.)

The type signature for the relevant delegate method is:

- (CIImage *)view:(QTCaptureView *)view willDisplayImage :(CIImage  
*)image

This method is generally used for applying filters to the image.  I'm  
just passing the image straight through and grabbing a handle to it  
(or trying to):

(defclass qtc-window-delegate (ns:ns-object)
   ((container :initarg :container))
   (:metaclass ns:+ns-object))

(objc:defmethod (#/view:willDisplayImage: (:* (:struct #>CIImage)))
                 ((self qtc-window-delegate)
                  (viewptr (:* (:struct #>QTCaptureView)))
                  (imgptr (:* (:struct #>CIImage))))
   (setf *imgptr-type* (type-of imgptr))  ; For debugging
   imgptr)

This actually works (insofar as the video stream is displayed and Lisp  
doesn't crash) but there is a weird thing going on: I would expect  
*imgptr-type* to be MACPTR given the way the method signature is  
declared, but it's not, it's CIImage:

? *imgptr-type*
NS:C-I-IMAGE

Why?

rg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20080716/9ef37bf9/attachment.html>


More information about the Openmcl-devel mailing list