diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-07-04 17:40:56 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-07-04 17:40:56 +0100 |
| commit | afaf35edbad11bc7d71a6793116c229dcfc38f92 (patch) | |
| tree | c5831004589b5368de766fb3e3a06e4ef2f04767 | |
| parent | d80323174f5be46051dd494308a92cfe12e2c1f5 (diff) | |
echo trails improvements
| -rwxr-xr-x | connect | 2 | ||||
| -rwxr-xr-x | rotord/libavwrapper.cpp | 16 | ||||
| -rwxr-xr-x | rotord/rotor.cpp | 12 | ||||
| -rwxr-xr-x | rotord/rotor.h | 3 | ||||
| -rwxr-xr-x | rotord/rotord.cpp | 2 |
5 files changed, 22 insertions, 13 deletions
@@ -1 +1 @@ -ssh -i rotored.pem ubuntu@54.229.80.0 +ssh -i rotored.pem ubuntu@54.229.50.45 diff --git a/rotord/libavwrapper.cpp b/rotord/libavwrapper.cpp index d5ee9cf..43c20f4 100755 --- a/rotord/libavwrapper.cpp +++ b/rotord/libavwrapper.cpp @@ -222,9 +222,9 @@ bool libav::decoder::openUsingInitializedContainer(enum PixelFormat formatParam) //numFrames = (int)(( container->duration / (double)AV_TIME_BASE ) * pCtx->time_base.den + 0.5); //this approach just seems wrong! - - numFrames=container->streams[videoStream]->nb_frames-2; + + numFrames=container->streams[videoStream]->nb_frames-1; if (numFrames<1){ //some codecs don't keep this info in the header @@ -234,7 +234,7 @@ bool libav::decoder::openUsingInitializedContainer(enum PixelFormat formatParam) //could alternatively just redefine the length if the reader fails } - + init_buffers_and_scaler(); @@ -321,15 +321,15 @@ bool libav::decoder::fetchFrame(int targetFrameIndex) if ((targetFrameIndex < 0) || (targetFrameIndex > numFrames)) return false; if (targetFrameIndex == (previousFrameIndex + 1)) { - if (! readNextFrame(targetFrameIndex)) + if (! readNextFrame(targetFrameIndex+1)) //frame indexing starts at 1 return false; } else { - int64_t response=seekToFrame(targetFrameIndex); + int64_t response=seekToFrame(targetFrameIndex+1); //frame indexing starts at 1 if (response < 0) return false; - if (response!=targetFrameIndex){ - cerr<<"libav::decoder asked for "<<targetFrameIndex<<", got "<<response<<endl; //does not seem to be aware of wrong frame + if (response!=targetFrameIndex+1) { + cerr<<"libav::decoder asked for "<<targetFrameIndex<<", got "<<(response-1)<<endl; //does not seem to be aware of wrong frame } } previousFrameIndex = targetFrameIndex; @@ -410,7 +410,7 @@ bool libav::decoder::readNextFrameWithPacket(int targetFrameIndex, AVPacket& pac //throw std::runtime_error(""); //why does it want to throw an error here, isn't the frame succesfully decoded? // - //when we allow these packets through we get + //when we allow these packets through we get //[swscaler @ 0x9ef0c80] bad src image pointers //trying to ignore timestamp below if (packet.size == 0) // packet.size==0 usually means EOF diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp index 2d33755..3166de8 100755 --- a/rotord/rotor.cpp +++ b/rotord/rotor.cpp @@ -379,16 +379,22 @@ Image* Video_loader::output(const Frame_spec &frame){ */ if (isLoaded){ - int wanted=(((int) ((frame.time*frame.framerate)+0.5))%(player.getNumberOfFrames()))+1; //+1 is necessary because 1st frame in a video is number 1? + int wanted=(((int) ((frame.time*frame.framerate)+0.5))%(player.getNumberOfFrames())); //+1 is necessary because 1st frame in a video is number 1? //if (wanted==99){ // cerr<<"videoloader: near the end"<<endl; //} - //cerr<<"videoloader: getting frame "<<wanted<<endl; + //cerr<<"videoloader: requesting frame "<<wanted<<endl; + //if (wanted==68) { + // int nothing=0; + //} - if (!player.fetchFrame(frame.w,frame.h,wanted)) { cerr<<"Rotor: frame returned false"<<endl; return nullptr; }; + if (!player.fetchFrame(frame.w,frame.h,wanted)) { + cerr<<"Rotor: frame returned false"<<endl; + return nullptr; + }; image.setup_fromRGB(frame.w,frame.h,player.pFrameRGB->data[0]); return ℑ } diff --git a/rotord/rotor.h b/rotord/rotor.h index 7430ab0..93fab03 100755 --- a/rotord/rotor.h +++ b/rotord/rotor.h @@ -946,9 +946,12 @@ namespace Rotor { if (image_inputs.size()) { if (image_inputs[0]->connection){ if (LUT) { + //need a better strategy here, should be able to get each image once //copy incoming image **writable if (image) image->free(); image=(((Image_node*)image_inputs[0]->connection)->get_output(frame))->clone(); + images[thisframe]=new Image(frame.w,frame.h); + apply_LUT(*(image),*(images[thisframe])); for (int i=1;i<number;i++){ //check echo frame isn't at negative time int absframe=thisframe-i; diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp index c47823d..6832318 100755 --- a/rotord/rotord.cpp +++ b/rotord/rotord.cpp @@ -169,7 +169,7 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS if (request.getMethod()=="DELETE") { task->cancel(); status=HTTPResponse::HTTP_OK; - XML.addValue("status","context deleted succesfully"); + XML.addValue("status","context deleted successfully"); } else { XML.addValue("error","Render context invoked with no command"); |
