Grabbing frames with ofVideoGrabber while window is minimized/hidden

Hey,

i’ve written a simple app, that saves a frame from a cam in a given interval, what works fine.
The code can be found on github: https://github.com/wirbrennen/ofxDocuApp

But here comes the problem:
As soon as the window is hidden or minimized, the app stops taking pictures. I’m running on a mac book, using a external cam and oF 0.7.4.

When researching this issue, i found that everything inside the update-function should run fine, only the draw-function should stop. If you have a look at the code above, but in my case it seems, that the app freezes while minimized.

Any ideas?

you might try grabbing in a seperate thread (see ofThread example), i think the thread should keep running while minimised.

you’ll have something like this then:

  
threadedClass::threadedFunction() {  
     while( isThreadRunning()){  
            //update your cam  
            if (camframe is new)  
                  save your frame  
  
            ofSleepMillis(1);  
    }  
}  

Has nobody ever encountered this issue or is there no solution?

Looks like there is already an answer, but somehow i can only see it while replying.

Thanks, i’ll give it a try.

oops the spambot ate my reply i guess.

But finally i found it. And you solved my problem.
Thanks for the hint! (Code can be found here)