Dynamically change capture device in OSGART2.0_RC3

Community support forum for users of the GPL-licensed osgART Standard Edition v1.0 and proprietary-licensed osgART Professional Edition v1.1
Posts: 2
Joined: Wed Dec 19, 2007 6:08 am

Dynamically change capture device in OSGART2.0_RC3

Postby topscores » Fri Oct 07, 2011 5:52 am

Dear all,

I'm trying to add a feature to allow users to switch between multiple capture devices. The problem is osgART::video::close does not release the capture device. I check the source code in ARToolkitVideo.cpp and found a comment that said

/* Currently ar2VideoClose hangs on Windows when the DirectShow filter graph is
* stopped. Therefore the function will not be called here. It is only really
* needed if the video capture library is to be reloaded.
* Other platforms do not suffer from this problem.
#if defined(_WIN32)

So, I comment out #if define(_WIN32) until #else line. After that everything works fine. I can switch between multiple capture devices. However, when the program terminate, it still leave a process in windows task manager which I think it's what the comment suggest.

I tried to create a very small program to test this behavior by calling
1. ar2VideoOpen
2. ar2CapStart
3. ar2CapStop
4. ar2VideoClose
The program works fine and terminate normally.

Anybody has ideas to solve this issue or are there any known workarounds to to add support for switching multiple capture devices. I'm working on windows XP, VS2003 .net.

Thank you for your help in advance.

Return to “[ARCHIVED] osgART Standard & Professional Editions”

Who is online

Users browsing this forum: No registered users and 2 guests