Commit 076a4d1316f5260d8ef8fc04bb2027e748f1e36b
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).
Showing
3 changed files
with
7 additions
and
3 deletions
openbr/core/core.cpp
| ... | ... | @@ -151,10 +151,9 @@ struct AlgorithmCore |
| 151 | 151 | if (data.empty()) |
| 152 | 152 | return files; |
| 153 | 153 | |
| 154 | - | |
| 155 | 154 | // Trust me, this makes complete sense. |
| 156 | 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 | 157 | QScopedPointer<Transform> basePipe(Transform::make(pipeDesc,NULL)); |
| 159 | 158 | |
| 160 | 159 | CompositeTransform * downcast = dynamic_cast<CompositeTransform *>(basePipe.data()); | ... | ... |
openbr/plugins/misc.cpp
openbr/plugins/stream.cpp
| ... | ... | @@ -448,6 +448,8 @@ public: |
| 448 | 448 | // we will return the first frame on the lookAhead buffer |
| 449 | 449 | FrameData * rVal = lookAhead.first(); |
| 450 | 450 | lookAhead.pop_front(); |
| 451 | + if (rVal->data.empty()) | |
| 452 | + qDebug("returning empty frame from look ahead!"); | |
| 451 | 453 | |
| 452 | 454 | // If this is the last frame, say so |
| 453 | 455 | if (rVal->sequenceNumber == final_frame) { |
| ... | ... | @@ -675,6 +677,7 @@ public: |
| 675 | 677 | if (input == NULL) { |
| 676 | 678 | qFatal("null input to multi-thread stage"); |
| 677 | 679 | } |
| 680 | + | |
| 678 | 681 | input->data >> *transform; |
| 679 | 682 | |
| 680 | 683 | should_continue = nextStage->tryAcquireNextStage(input); |
| ... | ... | @@ -1062,6 +1065,8 @@ public: |
| 1062 | 1065 | { |
| 1063 | 1066 | TemplateList output_set; |
| 1064 | 1067 | transforms[i]->finalize(output_set); |
| 1068 | + if (output_set.empty()) | |
| 1069 | + continue; | |
| 1065 | 1070 | |
| 1066 | 1071 | for (int j=i+1; j < transforms.size();j++) |
| 1067 | 1072 | { | ... | ... |