Saturday, January 9, 2010

VIDEO1394_IOC_LISTEN_CHANNEL ioctl failed!

Recently, I started defining class for grabing images from cameras. At present I am using firewire cameras and I am using OpenCV routines, installed it with firewire support. I have one firewire camera for testing and I tried to create two objects for the single camera. Actually I planned to create a copy constructor and overloaded the operator "=".


I get the following error while calling cvCaptureFromCAM for second in copy constructor.

*******************************
(dc1394_capture.c) VIDEO1394_IOC_LISTEN_CHANNEL ioctl failed!
cvcap_dc1394.cpp:307: Failed to setup DMA capture with VIDEO1394
(dc1394_capture.c) VIDEO1394_IOC_LISTEN_CHANNEL ioctl failed!
cvcap_dc1394.cpp:307: Failed to setup DMA capture with VIDEO1394
********************************

But I could access a single video file with objects.

Then, I inferred that the above error occurs since the firewire camera is being already accessed by the first object and cvCapture could not get the necessary handle for accessing the cameras.

Then, I realized the stupidity of creating copy constructors and overloading assignment operator for a class which access physical hardwares.

I suppose, in general operating system will not allow two processes to simultaneously access a single hardware. Am I correct?