42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
45 #include <visp/vpConfig.h>
46 #if ( defined(VISP_HAVE_DIRECTSHOW) )
48 #include <visp/vpDirectShowDevice.h>
56 bool vpDirectShowDevice::init(
const CComPtr<IMoniker>& pMoniker)
61 CComPtr<IPropertyBag> pPropBag;
62 hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
69 VariantInit(&varName);
70 VariantInit(&varDesc);
71 VariantInit(&varDevPath);
72 char tmp[FILENAME_MAX];
74 hr = pPropBag->Read(L
"FriendlyName", &varName, 0);
79 sprintf(tmp,
"%S", varName.bstrVal);
83 VariantClear(&varName);
85 hr = pPropBag->Read(L
"Description", &varDesc, 0);
90 sprintf(tmp,
"%S", varDesc.bstrVal);
94 VariantClear(&varDesc);
96 hr = pPropBag->Read(L
"DevicePath", &varDevPath, 0);
101 sprintf(tmp,
"%S",varDevPath.bstrVal);
105 VariantClear(&varDevPath);
116 bool vpDirectShowDevice::operator==(vpDirectShowDevice& dev)
118 return name==dev.name
120 && devPath==dev.devPath;
123 VISP_EXPORT std::ostream& operator<<(std::ostream& os, vpDirectShowDevice& dev)
125 return os<<dev.name<<std::endl<<dev.desc<<std::endl<<dev.devPath;