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?
Subscribe to:
Post Comments (Atom)
i faced the same problem while trying to gather data from a NI-6025e DAQ card using the data acquisition tool box in Simulink. While I was trying to plot the data in Simulink, a program was already running that reads and writes to this card. This second program was written in C++. I was unable to get any data in matlab.
ReplyDelete