From afaf35edbad11bc7d71a6793116c229dcfc38f92 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 4 Jul 2013 17:40:56 +0100 Subject: echo trails improvements --- connect | 2 +- rotord/libavwrapper.cpp | 16 ++++++++-------- rotord/rotor.cpp | 12 +++++++++--- rotord/rotor.h | 3 +++ rotord/rotord.cpp | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/connect b/connect index 37cca06..4a9a6c2 100755 --- a/connect +++ b/connect @@ -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 "<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;icancel(); 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"); -- cgit v1.2.3