Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofVideoGrabber with bUseTexture = false does not update #4811

Closed
antimodular opened this issue Feb 11, 2016 · 8 comments
Closed

ofVideoGrabber with bUseTexture = false does not update #4811

antimodular opened this issue Feb 11, 2016 · 8 comments
Milestone

Comments

@antimodular
Copy link

i'm on OS X 10.10 with OF 0.9.0 and Xcode 6.4

will trying to make a headless app via ofAppNoWindow i noticed when setting up ofVideoGrabber like so:

vidGrabber.setup(camWidth,camHeight,false);

vidGrabber.isFrameNew() always returns 0.
looking in to void ofVideoGrabber::update() need bUseTexture to be true otherwise nothing happens.

is it even possible to use the camera image with bUseTexture = false?
thx

@arturoc arturoc added this to the 0.10.0 milestone Feb 11, 2016
@arturoc
Copy link
Member

arturoc commented Feb 11, 2016

this sounds like a bug, even if there's no texture, the pixels are updated and the grabber should return true on isNewFrame. sounds like an easy fix, just moving out of that if wheerever the flag is set to true

@antimodular
Copy link
Author

in the hopes of helping here is a bit more info.

while in headless mode:
if vidGrabber.setup(camWidth,camHeight,true);
then app crashes here in line tex.push_back(ofTexture());
here

    if( grabber->isInitialized() && bUseTexture ){
        if(!grabber->getTexturePtr()){
            for(int i=0;i<grabber->getPixels().getNumPlanes();i++){
                ofPixels plane = grabber->getPixels().getPlane(i);
                tex.push_back(ofTexture());
                tex[i].allocate(plane);
            }
        }
    }

while NOT in headless mode
if vidGrabber.setup(camWidth,camHeight,false);
everything works well and i can pass the ofVideoGrabber pixel to a texture

@arturoc
Copy link
Member

arturoc commented Feb 11, 2016

yes, if you are in headless mode you can't use opengl at all and any call to an opengl command, like creating a texture will crash the app since there's no opengl context.

you should use setUseTexture(false) in that case

@antimodular
Copy link
Author

i did try that with setUseTexture(false) before and after setup.
but that still causes a crash unless is i do setup(camWidth,camHeight,false)

here what crashes in headless mode

        vidGrabber.setUseTexture(false);
        vidGrabber.setDeviceID(deviceID);
        vidGrabber.setup(camWidth,camHeight); //,false);
        vidGrabber.setUseTexture(false);

@arturoc
Copy link
Member

arturoc commented Feb 11, 2016

yes that's true you need to call setup(w,h,false) otherwise it'll try to create a texture in setup and crash too

@bakercp
Copy link
Member

bakercp commented May 20, 2017

@antimodular is this fixed now with #5134?

@stephanschulz
Copy link

yes.
thanks for your efforts.

@bakercp
Copy link
Member

bakercp commented May 23, 2017

Thanks @stephanschulz !

@bakercp bakercp closed this as completed May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants