directshow - Deadlocked on IGraphbuilder->connect () -
so calling out expert in windows direct show:
i trying run multiple cameras on single computer our test application , getting intermittent deadlocks in relation directshow. recent deadlock hitting in igraphbuilder connect function.
i first add filter want add, 2 pins want connect , when call connect, app go deadlock.
in code below m_graphbuilder igraphbuilder object.
here code:
hresult uvccamera::setupframegrabfilter() { hresult hr = s_ok; cunknown* unknown = framegrabber::createinstance(null, &hr); _assert(succeeded(hr)); _assert(unknown); if (failed(hr)) return hr; hr = unknown->nondelegatingqueryinterface(iid_ibasefilter, (void**)&m_framegrabber); assert(succeeded(hr)); hr = m_graphbuilder->addfilter(m_framegrabber, text("frame grabber filter")); assert(succeeded(hr)); if (failed(hr)) return hr; stopcapture(); // output pin , input pin ccomptr<ipin> sourcepin; ccomptr<ipin> dumppin; // filter correpsonding capture device can connect camera grabber utility::getpin(m_uvcextension.getcapturefilter(), pindir_output, 0, &sourcepin); utility::getpin(m_framegrabber, pindir_input, 0, &dumppin); // connect filters (returns vfw_e_cannot_connect if not starting in disconnected state) **return m_graphbuilder->connect(sourcepin, dumppin);**** deadlock source <----- not return** }
here callstack:
ntdll.dll!_zwcreatefile@44() + 0x12 bytes ntdll.dll!_zwcreatefile@44() + 0x12 bytes ole32.dll!cretailmalloc_alloc(imalloc * pthis, unsigned long cb) line 641 c++ ksproxy.ax!createpinhandle() + 0x70 bytes ksproxy.ax!cksoutputpin::processcompleteconnect() + 0x14e bytes ksproxy.ax!cksoutputpin::completeconnect() + 0x12 bytes ksproxy.ax!cbasepin::attemptconnection() + 0x62 bytes ksproxy.ax!cbasepin::trymediatypes() + 0x68 bytes ksproxy.ax!cbasepin::agreemediatype() + 0x73 bytes ksproxy.ax!cbasepin::connect() + 0x64 bytes ksproxy.ax!cksoutputpin::connect() + 0x17d bytes quartz.dll!cfiltergraph::connectdirectinternal() + 0x83 bytes quartz.dll!cfiltergraph::connectbyfindingpin() + 0x71 bytes quartz.dll!cfiltergraph::connectusingfilter() + 0x72 bytes quartz.dll!cfiltergraph::connectviaintermediate() + 0x113 bytes quartz.dll!cfiltergraph::connectrecursively() + 0x78 bytes quartz.dll!cfiltergraph::connectinternal() + 0xde bytes **quartz.dll!cfiltergraph::connect() + 0x17 bytes** ---< called directshow cam.dll!uvccamera::setupframegrabfilter() line 827 + 0x16 bytes c++ cam.dll!uvccamera::setupcapture(const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & deviceinstanceid) line 305 + 0x7 bytes c++ cam.dll!uvccamera::initialize(const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & deviceinstanceid, int timeout, int flags) line 113 + 0xa bytes c++ cam.dll!`anonymous namespace'::createcamera(unsigned int & hcamera, int timeout, int flags) line 252 + 0x13 bytes c++ cam.dll!`anonymous namespace'::corethreadfunc(void * data) line 912 + 0x17 bytes c++ kernel32.dll!@basethreadinitthunk@12() + 0x12 bytes ntdll.dll!___rtluserthreadstart@8() + 0x27 bytes ntdll.dll!__rtluserthreadstart@8() + 0x1b bytes what can prevent deadlock?
Comments
Post a Comment