Commit 5c750607792b36b1bade51ff205fd2d4db69884d
1 parent
83b596bd
Almost have copying done, need to work out enums
Showing
4 changed files
with
33 additions
and
3 deletions
openbr/core/core.cpp
| ... | ... | @@ -45,7 +45,7 @@ struct AlgorithmCore |
| 45 | 45 | qDebug("Training on %s%s", qPrintable(input.flat()), |
| 46 | 46 | model.isEmpty() ? "" : qPrintable(" to " + model)); |
| 47 | 47 | |
| 48 | - QScopedPointer<Transform> trainingWrapper(Transform::make("DirectStream([Identity])", NULL)); | |
| 48 | + QScopedPointer<Transform> trainingWrapper(Transform::make("DirectStream([Identity], readMode=DistributeFrames)", NULL)); | |
| 49 | 49 | CompositeTransform * downcast = dynamic_cast<CompositeTransform *>(trainingWrapper.data()); |
| 50 | 50 | if (downcast == NULL) |
| 51 | 51 | qFatal("downcast failed?"); | ... | ... |
openbr/plugins/openbr_internal.h
| 1 | 1 | #ifndef OPENBR_INTERNAL_H |
| 2 | 2 | #define OPENBR_INTERNAL_H |
| 3 | 3 | |
| 4 | +#include <QMetaProperty> | |
| 5 | + | |
| 4 | 6 | #include "openbr/openbr_plugin.h" |
| 5 | 7 | #include "openbr/core/resource.h" |
| 6 | 8 | |
| ... | ... | @@ -260,9 +262,27 @@ public: |
| 260 | 262 | newTransform = true; |
| 261 | 263 | |
| 262 | 264 | QString name = metaObject()->className(); |
| 265 | + | |
| 263 | 266 | name.replace("Transform",""); |
| 264 | - name += "([])"; | |
| 267 | + name += "(["; | |
| 268 | + name += "],"; | |
| 269 | + | |
| 270 | + QStringList parameters; | |
| 271 | + | |
| 272 | + // Skip name and transforms (handled below) | |
| 273 | + for (int i = 2; i < metaObject()->propertyCount();i++) { | |
| 274 | + QMetaProperty property = metaObject()->property(i); | |
| 275 | + parameters.append(property.read(this).toString()); | |
| 276 | + } | |
| 277 | + | |
| 278 | + name += parameters.join(","); | |
| 279 | + | |
| 280 | + name += ")"; | |
| 281 | + | |
| 265 | 282 | name.replace("br::",""); |
| 283 | + | |
| 284 | + qDebug() << name; | |
| 285 | + | |
| 266 | 286 | CompositeTransform * output = dynamic_cast<CompositeTransform *>(Transform::make(name, NULL)); |
| 267 | 287 | |
| 268 | 288 | if (output == NULL) | ... | ... |
openbr/plugins/quality.cpp
openbr/plugins/stream.cpp
| ... | ... | @@ -253,6 +253,8 @@ public: |
| 253 | 253 | |
| 254 | 254 | bool getNextTemplate(Template & output) |
| 255 | 255 | { |
| 256 | + qDebug() << "Next as video"; | |
| 257 | + | |
| 256 | 258 | if (!isOpen()) { |
| 257 | 259 | qDebug("video source is not open"); |
| 258 | 260 | return false; |
| ... | ... | @@ -1058,7 +1060,9 @@ public: |
| 1058 | 1060 | if (src.empty()) |
| 1059 | 1061 | return; |
| 1060 | 1062 | |
| 1061 | - bool res = readStage->dataSource.open(src,readMode); | |
| 1063 | + qDebug() << "Reading with mode:" << readMode; | |
| 1064 | + | |
| 1065 | + bool res = readStage->dataSource.open(src,br::Idiocy::DistributeFrames); | |
| 1062 | 1066 | if (!res) { |
| 1063 | 1067 | qDebug("stream failed to open %s", qPrintable(dst[0].file.name)); |
| 1064 | 1068 | return; |
| ... | ... | @@ -1206,6 +1210,8 @@ public: |
| 1206 | 1210 | // And the collection stage points to the read stage, because this is |
| 1207 | 1211 | // a ring buffer. |
| 1208 | 1212 | collectionStage->nextStage = readStage; |
| 1213 | + | |
| 1214 | + qDebug() << "Init Readmode:" << readMode; | |
| 1209 | 1215 | } |
| 1210 | 1216 | |
| 1211 | 1217 | DirectStreamTransform() |
| ... | ... | @@ -1323,6 +1329,7 @@ public: |
| 1323 | 1329 | basis.activeFrames = this->activeFrames; |
| 1324 | 1330 | basis.readMode = this->readMode; |
| 1325 | 1331 | |
| 1332 | + qDebug() << basis.readMode; | |
| 1326 | 1333 | // We need at least a CompositeTransform * to acess transform's children. |
| 1327 | 1334 | CompositeTransform * downcast = dynamic_cast<CompositeTransform *> (transform); |
| 1328 | 1335 | ... | ... |