Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ofVideoGrabber: desiredFramerate was not being set if called before init

Closes #769
  • Loading branch information...
commit 04f44b0b4b7b6f21b307bee8680c22bc9e5cf2f1 1 parent be2b260
arturo arturoc authored
6 libs/openFrameworks/video/ofVideoGrabber.cpp
View
@@ -19,6 +19,7 @@ ofVideoGrabber::ofVideoGrabber(){
bInitialized = false;
RequestedDeviceID = -1;
internalPixelFormat = OF_PIXELS_RGB;
+ desiredFramerate = -1;
#ifdef TARGET_ANDROID
if(!ofxAndroidInitGrabber(this)) return;
@@ -63,6 +64,10 @@ bool ofVideoGrabber::initGrabber(int w, int h, bool setUseTexture){
grabber->setPixelFormat(internalPixelFormat);
+ if( desiredFramerate!=-1 ){
+ grabber->setDesiredFrameRate(desiredFramerate);
+ }
+
bool bOk = grabber->initGrabber(w, h);
width = (int)grabber->getWidth();
height = (int)grabber->getHeight();
@@ -118,6 +123,7 @@ void ofVideoGrabber::setDeviceID(int _deviceID){
//--------------------------------------------------------------------
void ofVideoGrabber::setDesiredFrameRate(int framerate){
+ desiredFramerate = framerate;
if( grabber != NULL ){
grabber->setDesiredFrameRate(framerate);
}
1  libs/openFrameworks/video/ofVideoGrabber.h
View
@@ -87,6 +87,7 @@ class ofVideoGrabber : public ofBaseVideoGrabber,public ofBaseVideoDraws{
int RequestedDeviceID;
ofPixelFormat internalPixelFormat;
+ int desiredFramerate;
};
Please sign in to comment.
Something went wrong with that request. Please try again.