bool ofxOMXPlayer::setup(ofxOMXPlayerSettings settings) { this->settings = settings; addExitHandler(); openEngine(); }
void ofxRPiCameraVideoGrabber::setup(OMXCameraSettings omxCameraSettings_) { ofRemoveListener(ofEvents().update, this, &ofxRPiCameraVideoGrabber::onUpdate); OMX_ERRORTYPE error = OMX_ErrorNone; error = OMX_Init(); OMX_TRACE(error); omxCameraSettings = omxCameraSettings_; ofLogVerbose(__func__) << "omxCameraSettings: " << omxCameraSettings.toString(); if(!hasAddedExithandler) { addExitHandler(); hasAddedExithandler = true; } if(directEngine) { delete directEngine; directEngine = NULL; camera = NULL; ofLogVerbose() << "deleted directEngine"; resetValues(); } if(textureEngine) { delete textureEngine; textureEngine = NULL; camera = NULL; ofLogVerbose() << "deleted textureEngine"; resetValues(); } if (omxCameraSettings.enableTexture) { textureEngine = new TextureEngine(); textureEngine->setup(omxCameraSettings); camera = textureEngine->camera; if (omxCameraSettings.enablePixels) { enablePixels(); } }else { directEngine = new DirectEngine(); directEngine->setup(omxCameraSettings); camera = directEngine->camera; } checkBurstMode(); error = applyExposure(__func__); OMX_TRACE(error); checkFlickerCancellation(); applyAllSettings(); ofAddListener(ofEvents().update, this, &ofxRPiCameraVideoGrabber::onUpdate); }