Re: [libdc] Is there any available xcode source on libdc1394?
Capture and control API for IIDC compliant cameras
Brought to you by:
ddouxchamps,
gordp
From: Rodolphe P. <pi...@rt...> - 2013-11-06 15:36:07
|
On Tue 11/5/13, at 8:53, June Kang <ang...@gm...> wrote: > Dear all, > I’m trying to build ‘simple’ c-based movie clip recording tool for OS X with libdc in xcode. > However I can’t find any examples or source codes independant from 3rd part wrappers like openFrameworks. > Is it possible to record movie with simple xcode-based approach (like using qtkit or something.) > > I have to connect the PtGrey camera’s GPIO trigger with other machine, and the movie clip should be taken during trigger on (mode3, maybe), > and save it as separate small clip. > > Please, If anybody know good starting place or examples, help me. > > Thanks : ) > > and bless your day. > > I use libdc1394 in Xcode. I took one of the examples and added the function call to my code (I used grab_color_image2.c to start with which compile directly on OS X). Use the init from grab_color_image2.c to init the camera (with needed tweak to match your camera) You’ll have to add the libdc1394 as a linked library (or as a static lib as I do in my Xcode project). For OS X you’ll have to implement a callback that receive the frames : // set camera callback ... dc1394_capture_set_callback (camera, FrameCallback, (__bridge void *)(self)); Then you need the define the callback like this : static void FrameCallback (dc1394camera_t *camera, void * data) { dc1394video_frame_t *frame; dc1394_capture_dequeue (camera, DC1394_CAPTURE_POLICY_POLL, &frame); if (frame) { /* do something with the data here */ CamDrawerController *parentObject = (__bridge CamDrawerController *)data; [parentObject updateFrame: frame]; dc1394_capture_enqueue (camera, frame); } } So in the function above I call my own function to do something with the Frame (display it, save it as a QT movie, ….). I hope this help Regards, Rodolphe -- | Rodolphe Pineau RTI-Zone | | http://www.rti-zone.org/ | | Robotics / Unix / Mac OS X / Astronomy | |