I've recently digged a little bit deeper into the OSX capturing functions and noted the following:
libdc is always scheduling a socket runloop source. Unless a specific runloop is set by the user (using dc1394_capture_schedule_with_runloop), it defaults to the main thread runloop.
But, unless the user has also setup a custom callbac function (using dc1394_capture_set_callback), this socket runloop source does nothing.
I did a modification to macosx/capture.c:
CFRunLoopAddSource (capture->run_loop, capture->socket_source, capture->run_loop_mode);
if (capture->callback) CFRunLoopAddSource (capture->run_loop, capture->socket_source, capture->run_loop_mode);
This prevents scheduling the socket unless the user has supplied a callback.
On my macs this cuts CPU usage down to half (granted... CPU usage is not high in any case).
Get latest updates about Open Source Projects, Conferences and News.