summaryrefslogtreecommitdiff
path: root/rotord/rotor.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@herge.(none)>2013-05-18 17:34:53 +0100
committerTim Redfern <tim@herge.(none)>2013-05-18 17:34:53 +0100
commitbcd9eeed1f60c594da11d93c1b52c4ec192280ce (patch)
treeaf760f3e2a1cefc3abcc177f9b5c75a5722c7d67 /rotord/rotor.cpp
parentfad2c7236e70faf0669dde3e6cbd51986fdbc6ee (diff)
dependencies installer
Diffstat (limited to 'rotord/rotor.cpp')
-rwxr-xr-xrotord/rotor.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp
index 52c76df..1768b8b 100755
--- a/rotord/rotor.cpp
+++ b/rotord/rotor.cpp
@@ -221,6 +221,7 @@ bool Video_output::render(const float duration, const float framerate,const stri
}
bool Video_loader::load(const string &filename){
+ /*
//gstreamer needs absolute paths ALWAYS
//string uri="file:///home/tim/workspace/rotor/rotord/"+filename;
Poco::Path path;
@@ -235,16 +236,22 @@ bool Video_loader::load(const string &filename){
image->setup_fromRGB(player->getWidth(),player->getHeight(),(uint8_t*) player->getPixels());
return true;
}
+ */
+ Poco::Path path;
+ string uri="file://"+path.current()+filename;
+
+ if (player.open(uri)){
+ cerr<<"Rotor::Video_loader: "<<filename<<", "<<player.getNumberOfFrames()<<" frames "<<", "<<player.getWidth()<<"x"<<player.getHeight()<<endl;
+ return true;
+ }
+
return false;
}
Image* Video_loader::output(const Frame_spec &frame){
//wonder about the actual mechanism used by gstreamer
//have to implment callback when seek is ready?
//presume gstreamer caches a loaded frame?
- //if (player->isLoaded()){
- // image.setup(player)
- //}
//deal with reolution: swscale from avcodec or put scaler in pipeline?
//can image node point to buffer in gst rather than copying the pixels?
@@ -253,6 +260,7 @@ Image* Video_loader::output(const Frame_spec &frame){
//fix actual duration and audio file
//trace frame that is being read
+ /*
if (player->isLoaded()){
//player->setPosition(frame.time);
int wanted=((int) (frame.time*frame.framerate))%(player->getTotalNumFrames()-2); //-2??
@@ -268,5 +276,15 @@ Image* Video_loader::output(const Frame_spec &frame){
//cerr<<"Video_loader: retrieving frame "<<((int) (frame.time*frame.framerate))<<endl;
return image;
}
+ */
+
+ if (player.isOpen){
+ int wanted=((int) (frame.time*frame.framerate))%(player.getNumberOfFrames()-2); //-2??
+ player.fetchFrame(wanted);
+ image.setup_fromRGB(frame.w,frame.h,player.pFrameRGB->data[0]);
+ return &image;
+ }
+
+
return nullptr;
};