Closed danomatika closed 8 years ago
Nevermind. ofTexture::readToPixels is a noop on OpenGL ES.
its implemented in develop - it uses an fbo
On Mar 16, 2014, at 7:05 PM, Dan Wilcox notifications@github.com wrote:
Nevermind. ofTexture::readToPixels is a noop on OpenGL ES.
Reply to this email directly or view it on GitHubhttps://github.com/jvcleave/ofxRPiCameraVideoGrabber/issues/7#issuecomment-37774575 .
Ok. I just reorganized the develop branch as well and am diving in. Thanks
Sorry, I can't find it. What should I be looking for?
weird - maybe I haven't uploaded my changes
ok - I am getting my addons mixed up
This addon doesn't do it internally but the shaderApp currently demos how to do it
https://github.com/jvcleave/ofxRPiCameraVideoGrabber/blob/develop/src/shaderApp.cpp
Ah ha. Ok. I actually did get it to work using ofImage::grabScreen (uses glReadPixels internally), but an FBO would be better. I'll try that.
I'm currently adding the isFrameNew() internals since glReadPixels is slow, at least it is from the screen buffer.
isFrameNew is kinda tricky as the OpenMax components are a bit different in how that is determined.
It kinda turned into a philosophic question when I did attempted it before (isFrameNew? - depends who is asking and when)
I settled on that is it likely being asked by ofApp::update so I was planning on doing an ofAddListener(ofEvents().update.... against a frame counter that the addon uses internally
So the issue with that where the OMX components differences lie - a non-textured (or direct to screen) can be probed for when a frame is complete. The textured version needs to measure when the buffer is filled
It looks like I implemented it here https://github.com/jvcleave/ofxRPiCameraVideoGrabber/blob/develop/addons/ofxRPiCameraVideoGrabber/src/TextureEngine.cpp#L134
Since this callback process doesn't happen for the for the non-texture I will have to do something different. I recently found a way (at least with video files) to probe an OMX component for a frame count.
In your case (using pixels) the textured is priority anyway
I'm basically using the commented out ofxRPiCameraVideoUpdate::udpate() with textureEngine->renderedFrameCounter. That should suffice as I just need something to keep the update CPU time down.
I'll send you info on the project when it's out. I'm basically making a sound engine generator that uses the camera and ofxPd. My friend has created these massive crystal canvases that will change color over time as the crystals grow and dry. The pi + camera + wide angle lens will be sitting there plugged into speakers generating the soundscape that morphs slowly over time.
awesome! would love to see it :)
Let me know if you need the rest of the remote control functionality and I can piece that together this week. Basically there are so many parameters it became overwhelming to change/compile/change/compile test so I built a system that publishes the settings to an xml file, starts a server you connect to and can change them with a separate app on the desktop (and eventually iPad, etc)
Thanks but no time. I have to finish this tonight as I'm out of town for the next 2 weeks on a freelance thing.
example of a wrapper here https://github.com/jvcleave/ofxRPiCameraVideoGrabber/tree/master/example-wrapper
texture-mode only
Could this inherit ofxBaseVideoGrabber so it's interchangeable with ofxVideoGrabber? I usually do this with cross platform apps.
Also, how do I get access to the raw pixels? Get them out of the texture?