Created
December 5, 2012 08:00
-
-
Save jvcleave/4213640 to your computer and use it in GitHub Desktop.
ofVideoGrabberRPI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testApp.h" | |
bool hasStarted = false; | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofSetLogLevel(OF_LOG_VERBOSE); | |
camWidth = 320; // try to grab at this size. | |
camHeight = 240; | |
} | |
//-------------------------------------------------------------- | |
void testApp::update(){ | |
ofBackground(100,100,100); | |
int delay = 2000; | |
unsigned long long currentTime = ofGetElapsedTimeMillis(); | |
if (currentTime > delay) | |
{ | |
if (!hasStarted) | |
{ | |
hasStarted = true; | |
vidGrabber.setVerbose(true); | |
vidGrabber.setDesiredFrameRate(60); | |
vidGrabber.initGrabber(camWidth,camHeight); | |
}else { | |
vidGrabber.update(); | |
} | |
}else | |
{ | |
ofLogVerbose() << "waiting " << delay - currentTime << "ms"; | |
} | |
} | |
//-------------------------------------------------------------- | |
void testApp::draw(){ | |
if (!hasStarted) { | |
return; | |
} | |
vidGrabber.draw(20, 20, camWidth, camHeight); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment