Skip to content

Instantly share code, notes, and snippets.

@fishkingsin
Created May 18, 2014 11:08
Show Gist options
  • Save fishkingsin/256f200c7b2f49caf8de to your computer and use it in GitHub Desktop.
Save fishkingsin/256f200c7b2f49caf8de to your computer and use it in GitHub Desktop.
openframeworks + ofxGstreamer + ARDrone Video Stream
#include "ofApp.h"
#include "ofGstVideoPlayer.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofGstVideoPlayer* gstPlayer = new ofGstVideoPlayer();
player.setPlayer(ofPtr<ofGstVideoPlayer>(gstPlayer));
ofGstVideoUtils *gstUtil = gstPlayer->getGstVideoUtils();
gstUtil->setPipeline("tcpclientsrc host=192.168.1.1 port=5555 ! h264parse ! decodebin ! videoconvert ! videoscale",24,true,640,360);
gstUtil->startPipeline();
player.play();
}
//--------------------------------------------------------------
void ofApp::update(){
player.update();
}
//--------------------------------------------------------------
void ofApp::draw(){
player.draw(0,0);
}
//--------------------------------------------------------------
void ofApp::keyPressed(int key){
}
//--------------------------------------------------------------
void ofApp::keyReleased(int key){
}
//--------------------------------------------------------------
void ofApp::mouseMoved(int x, int y ){
}
//--------------------------------------------------------------
void ofApp::mouseDragged(int x, int y, int button){
}
//--------------------------------------------------------------
void ofApp::mousePressed(int x, int y, int button){
}
//--------------------------------------------------------------
void ofApp::mouseReleased(int x, int y, int button){
}
//--------------------------------------------------------------
void ofApp::windowResized(int w, int h){
}
//--------------------------------------------------------------
void ofApp::gotMessage(ofMessage msg){
}
//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment