mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-12-24 11:20:23 -05:00
basic visual data pass-thru distributor
This commit is contained in:
parent
090062191c
commit
0198f2410f
@ -32,16 +32,18 @@ public:
|
|||||||
|
|
||||||
void run() {
|
void run() {
|
||||||
busy_update.lock();
|
busy_update.lock();
|
||||||
process();
|
if (input && !input->empty()) {
|
||||||
|
process();
|
||||||
|
}
|
||||||
busy_update.unlock();
|
busy_update.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
virtual void process() {
|
virtual void process() {
|
||||||
// process inputs to output
|
// process inputs to output
|
||||||
// distribute(output);
|
// distribute(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
void distribute(ReferenceCounter *output) {
|
void distribute(ReferenceCounter *output) {
|
||||||
// distribute outputs
|
// distribute outputs
|
||||||
output->setRefCount(outputs.size());
|
output->setRefCount(outputs.size());
|
||||||
@ -56,3 +58,17 @@ protected:
|
|||||||
std::mutex busy_update;
|
std::mutex busy_update;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class VisualDataDistributor : public VisualProcessor {
|
||||||
|
protected:
|
||||||
|
virtual void process() {
|
||||||
|
while (!input->empty()) {
|
||||||
|
ReferenceCounter *inp;
|
||||||
|
input->pop(inp);
|
||||||
|
if (inp) {
|
||||||
|
distribute(inp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user