VideoCapture did not detect an unopened camera
This commit is contained in:
parent
4b84d5d2c1
commit
a0e4600364
@ -621,15 +621,15 @@ Ptr<IVideoCapture> VideoCapture::createCameraCapture(int index)
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_DSHOW
|
#ifdef HAVE_DSHOW
|
||||||
case CV_CAP_DSHOW:
|
case CV_CAP_DSHOW:
|
||||||
capture = Ptr<IVideoCapture>(new cv::VideoCapture_DShow(index));
|
capture = makePtr<VideoCapture_DShow>(index);
|
||||||
if (capture)
|
if (capture && capture.dynamicCast<VideoCapture_DShow>()->isOpened())
|
||||||
return capture;
|
return capture;
|
||||||
break; // CV_CAP_DSHOW
|
break; // CV_CAP_DSHOW
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_INTELPERC
|
#ifdef HAVE_INTELPERC
|
||||||
case CV_CAP_INTELPERC:
|
case CV_CAP_INTELPERC:
|
||||||
capture = Ptr<IVideoCapture>(new cv::VideoCapture_IntelPerC());
|
capture = makePtr<VideoCapture_IntelPerC>();
|
||||||
if (capture)
|
if (capture && capture.dynamicCast<VideoCapture_IntelPerC>()->isOpened())
|
||||||
return capture;
|
return capture;
|
||||||
break; // CV_CAP_INTEL_PERC
|
break; // CV_CAP_INTEL_PERC
|
||||||
#endif
|
#endif
|
||||||
|
@ -1590,7 +1590,7 @@ bool videoInput::isFrameNew(int id){
|
|||||||
|
|
||||||
bool videoInput::isDeviceSetup(int id){
|
bool videoInput::isDeviceSetup(int id){
|
||||||
|
|
||||||
if(id<devicesFound && VDList[id]->readyToCapture)return true;
|
if(id>=0 && id<devicesFound && VDList[id]->readyToCapture)return true;
|
||||||
else return false;
|
else return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user