Created
August 27, 2012 04:31
-
-
Save bakercp/3485582 to your computer and use it in GitHub Desktop.
Testing Sequential Synchronous Access ofQuickTimePlayer vs ofQTKitPlayer
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 "ofMain.h" | |
#include "testApp.h" | |
#include "ofAppGlutWindow.h" | |
//======================================================================== | |
int main( ){ | |
ofAppGlutWindow window; | |
ofSetupOpenGL(&window, 320,240, OF_WINDOW); // <-------- setup the GL context | |
// this kicks off the running of my app | |
// can be OF_WINDOW or OF_FULLSCREEN | |
// pass in width and height too: | |
ofRunApp( new testApp()); | |
} |
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" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofBackground(255, 255, 255); | |
// ofSetFrameRate(60); | |
player.loadMovie("movies/fingers.mov"); | |
player.play(); | |
totalFrames = player.getTotalNumFrames(); | |
frameNum = 0; | |
} | |
//-------------------------------------------------------------- | |
void testApp::update(){ | |
frameNum = (frameNum + 1) % totalFrames; | |
player.setFrame(frameNum); | |
img.setFromPixels(player.getPixelsRef()); | |
} | |
//-------------------------------------------------------------- | |
void testApp::draw(){ | |
ofBackground(0,0,0); | |
ofSetColor(255); | |
img.draw(0,0); | |
ofDrawBitmapString("FPS:" + ofToString(ofGetFrameRate()), 10, ofGetHeight() - 10); | |
} |
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
#pragma once | |
#include "ofMain.h" | |
class testApp : public ofBaseApp { | |
public: | |
void setup(); | |
void update(); | |
void draw(); | |
void loadFrames(); | |
void randomAccess(); | |
int totalFrames; | |
int frameNum; | |
ofVideoPlayer player; | |
ofImage img; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment