编译通过,尚差链接错误

master
a7458969 2020-05-13 01:28:24 +08:00
parent 16c2747b11
commit 5a40ac88a4
1 changed files with 14 additions and 10 deletions

View File

@ -1,6 +1,7 @@
#include "CameraCapture.h"
#include "Debuger.h"
#pragma comment(lib, "strmiids")
//define release maco
@ -237,20 +238,23 @@ bool Camera::Open(std::wstring &camera_name)
if (names.empty())
{
Close(); return false;
Close();
return false;
}
auto name_it = find(names.begin(), names.end(), camera_name);
if (name_it == names.end())
{
Close(); return false;
bool founded = false;
for(std::wstring i : names ){
if(i == camera_name){
founded = true;
}
}
if (!founded){
int deviceID = static_cast<int>(distance(names.begin(), name_it));
}
int deviceID = 0;
// create grabber filter instance
CHECK_HR(CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
CHECK_HR(CoCreateInstance(IID_ISampleGrabber, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (LPVOID*)&pSampleGrabberFilter));
// bind source device