Skip to content

Commit

Permalink
Adding a basic interval to streaming video
Browse files Browse the repository at this point in the history
  • Loading branch information
robotconscience committed Apr 10, 2014
1 parent 5200374 commit 2c99661
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example_binary_stream/src/ofApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
ofBuffer buff, inBuff;
ofImage test, test2;
bool bLoad = false;
int sendInterval = 500;
int lastSent = 0;

//--------------------------------------------------------------
void ofApp::setup(){
Expand All @@ -23,8 +25,8 @@ void ofApp::update(){
}
// outgoing
grabber.update();
if ( grabber.isFrameNew() ){

if ( grabber.isFrameNew() && ofGetElapsedTimeMillis() - lastSent > sendInterval ){
lastSent = ofGetElapsedTimeMillis();
unsigned long size = 0;
unsigned char * data = jpeg.compress(grabber, 50, &size);

Expand Down

0 comments on commit 2c99661

Please sign in to comment.