summaryrefslogtreecommitdiffstats
path: root/src/ModPlugin.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-25 21:34:03 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-25 21:34:03 +0100
commit2bba7d602744ccd6dab26940661f0fdfbf231af8 (patch)
tree590a5808497da3b621e29239cd56db6c89c2d6a9 /src/ModPlugin.h
parentb5fd4a6ab6ac92af2141233f802e71c861cd89f4 (diff)
downloaddabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.tar.gz
dabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.tar.bz2
dabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.zip
Refactor flowgraph and puncturing rules
Diffstat (limited to 'src/ModPlugin.h')
-rw-r--r--src/ModPlugin.h51
1 files changed, 46 insertions, 5 deletions
diff --git a/src/ModPlugin.h b/src/ModPlugin.h
index 215951a..bdc3843 100644
--- a/src/ModPlugin.h
+++ b/src/ModPlugin.h
@@ -1,6 +1,11 @@
/*
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty
the Queen in Right of Canada (Communications Research Center Canada)
+
+ Copyright (C) 2016
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+ http://opendigitalradio.org
*/
/*
This file is part of ODR-DabMod.
@@ -30,16 +35,52 @@
#include <sys/types.h>
#include <vector>
-#ifdef DEBUG
-# include <stdio.h>
-#endif
-
class ModPlugin
{
public:
- virtual int process(std::vector<Buffer*> dataIn,
+ virtual int process(
+ std::vector<Buffer*> dataIn,
std::vector<Buffer*> dataOut) = 0;
virtual const char* name() = 0;
};
+/* Inputs are sources, the output buffers without reading any */
+class ModInput : public ModPlugin
+{
+public:
+ virtual int process(
+ std::vector<Buffer*> dataIn,
+ std::vector<Buffer*> dataOut);
+ virtual int process(Buffer* dataOut) = 0;
+};
+
+/* Codecs are 1-input 1-output flowgraph plugins */
+class ModCodec : public ModPlugin
+{
+public:
+ virtual int process(
+ std::vector<Buffer*> dataIn,
+ std::vector<Buffer*> dataOut);
+ virtual int process(Buffer* const dataIn, Buffer* dataOut) = 0;
+};
+
+/* Muxes are N-input 1-output flowgraph plugins */
+class ModMux : public ModPlugin
+{
+public:
+ virtual int process(
+ std::vector<Buffer*> dataIn,
+ std::vector<Buffer*> dataOut);
+ virtual int process(std::vector<Buffer*> dataIn, Buffer* dataOut) = 0;
+};
+
+/* Outputs do not create any output buffers */
+class ModOutput : public ModPlugin
+{
+public:
+ virtual int process(
+ std::vector<Buffer*> dataIn,
+ std::vector<Buffer*> dataOut);
+ virtual int process(Buffer* dataIn) = 0;
+};