ofVideoGrabber device status

At the moment, if you pull out the capture device used by ofVideoGrabber there is no kind of error returned. Do you know any way we could do this?

Also I was thinking about ways of detecting if your camera goes down/powers off. So in my case I am using usb capture devices, with security cameras plugged in via bnc cable.

If you unplug the camera (but usb capture device remains) then all that happens is all the pixels turn a single blue colour (or black, depending on the device). Perhaps we could this as a way of telling whether any signal is coming in?

What do you think Theo?

Hi Theo

For initGrabber & directShow we have:

  
  
bool bOk = VI.setupDevice(device, width, height);  
  

Instead of making this a local boolean, I have made it as part of the class by putting it under the protected variables. Then under public in videograbber.h added…

  
  
bool isDeviceOk(){ return bOk; };  
  

Now I can check from my code that the video device is enabled.

Maybe something to have in future videoGrabber changes?

hey chris!

Actually there is already a method for doing this.

videoInput::isDeviceSetup(int deviceID);

It returns true if the device is correctly setup.


edit

oh right for openFrameworks.
yes that makes sense of course!