Commit 076a4d1316f5260d8ef8fc04bb2027e748f1e36b

Authored by Charles Otto
1 parent 5d38207e

Make ProgressCounter behave slightly better

Move progress counter after gallery output, this should hopefully give slightly
more accurate initial ETAs.

When doing the finalize step in stream projectUpdate, don't push empty sets
through the rest of the transforms (this reduces spurious calls to project,
making progress counter work slightly better).
openbr/core/core.cpp
@@ -151,10 +151,9 @@ struct AlgorithmCore @@ -151,10 +151,9 @@ struct AlgorithmCore
151 if (data.empty()) 151 if (data.empty())
152 return files; 152 return files;
153 153
154 -  
155 // Trust me, this makes complete sense. 154 // Trust me, this makes complete sense.
156 // We're just going to make a pipe with a placeholder first transform 155 // We're just going to make a pipe with a placeholder first transform
157 - QString pipeDesc = "Identity+ProgressCounter("+QString::number(data.length())+")+GalleryOutput("+gallery.flat()+")+Discard"; 156 + QString pipeDesc = "Identity+GalleryOutput("+gallery.flat()+")+ProgressCounter("+QString::number(data.length())+")+Discard";
158 QScopedPointer<Transform> basePipe(Transform::make(pipeDesc,NULL)); 157 QScopedPointer<Transform> basePipe(Transform::make(pipeDesc,NULL));
159 158
160 CompositeTransform * downcast = dynamic_cast<CompositeTransform *>(basePipe.data()); 159 CompositeTransform * downcast = dynamic_cast<CompositeTransform *>(basePipe.data());
openbr/plugins/misc.cpp
@@ -602,7 +602,7 @@ class ProgressCounterTransform : public TimeVaryingTransform @@ -602,7 +602,7 @@ class ProgressCounterTransform : public TimeVaryingTransform
602 602
603 void init() 603 void init()
604 { 604 {
605 - calls = -1; 605 + calls = 0;
606 set_calls = 0; 606 set_calls = 0;
607 timer.start(); 607 timer.start();
608 Globals->startTime.start(); 608 Globals->startTime.start();
openbr/plugins/stream.cpp
@@ -448,6 +448,8 @@ public: @@ -448,6 +448,8 @@ public:
448 // we will return the first frame on the lookAhead buffer 448 // we will return the first frame on the lookAhead buffer
449 FrameData * rVal = lookAhead.first(); 449 FrameData * rVal = lookAhead.first();
450 lookAhead.pop_front(); 450 lookAhead.pop_front();
  451 + if (rVal->data.empty())
  452 + qDebug("returning empty frame from look ahead!");
451 453
452 // If this is the last frame, say so 454 // If this is the last frame, say so
453 if (rVal->sequenceNumber == final_frame) { 455 if (rVal->sequenceNumber == final_frame) {
@@ -675,6 +677,7 @@ public: @@ -675,6 +677,7 @@ public:
675 if (input == NULL) { 677 if (input == NULL) {
676 qFatal("null input to multi-thread stage"); 678 qFatal("null input to multi-thread stage");
677 } 679 }
  680 +
678 input->data >> *transform; 681 input->data >> *transform;
679 682
680 should_continue = nextStage->tryAcquireNextStage(input); 683 should_continue = nextStage->tryAcquireNextStage(input);
@@ -1062,6 +1065,8 @@ public: @@ -1062,6 +1065,8 @@ public:
1062 { 1065 {
1063 TemplateList output_set; 1066 TemplateList output_set;
1064 transforms[i]->finalize(output_set); 1067 transforms[i]->finalize(output_set);
  1068 + if (output_set.empty())
  1069 + continue;
1065 1070
1066 for (int j=i+1; j < transforms.size();j++) 1071 for (int j=i+1; j < transforms.size();j++)
1067 { 1072 {