summaryrefslogtreecommitdiffstats
path: root/src/dabInputPrbs.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-29 22:09:13 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-29 22:09:13 +0200
commite7ad2e1fab9c51189fdc8b4f2d81f625da9dd422 (patch)
treeeba50066116cb21fae751f7d7b2a9c10c05e2585 /src/dabInputPrbs.h
parent471e7ee279d633a7b48e73ece42677574a74ad39 (diff)
downloaddabmux-e7ad2e1fab9c51189fdc8b4f2d81f625da9dd422.tar.gz
dabmux-e7ad2e1fab9c51189fdc8b4f2d81f625da9dd422.tar.bz2
dabmux-e7ad2e1fab9c51189fdc8b4f2d81f625da9dd422.zip
Modernise PRBS generator and remove code for cmd line parser
Diffstat (limited to 'src/dabInputPrbs.h')
-rw-r--r--src/dabInputPrbs.h48
1 files changed, 22 insertions, 26 deletions
diff --git a/src/dabInputPrbs.h b/src/dabInputPrbs.h
index 22c088c..9cde7e2 100644
--- a/src/dabInputPrbs.h
+++ b/src/dabInputPrbs.h
@@ -1,6 +1,13 @@
/*
Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
Research Center Canada)
+
+ Copyright (C) 2016
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+ http://www.opendigitalradio.org
+
+ Pseudo-Random Bit Sequence generator for test purposes.
*/
/*
This file is part of ODR-DabMux.
@@ -19,38 +26,27 @@
along with ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef DAB_INPUT_PRBS_H
-#define DAB_INPUT_PRBS_H
-
+#pragma once
#ifdef HAVE_CONFIG_H
-# include "config.h"
+# include "config.h"
#endif
-#include "dabInput.h"
-#include "prbs.h"
-
-#include <errno.h>
+#include <string>
-#ifdef HAVE_FORMAT_RAW
-# ifdef HAVE_INPUT_PRBS
-
-
-extern struct dabInputOperations dabInputPrbsOperations;
-
-int dabInputPrbsInit(void** args);
-int dabInputPrbsOpen(void* args, const char* name);
-int dabInputPrbsRead(void* args, void* buffer, int size);
-int dabInputPrbsReadFrame(dabInputOperations* ops, void* args,
- void* buffer, int size);
-int dabInputPrbsBitrate(dabInputOperations* ops, void* args, int bitrate);
-int dabInputPrbsClose(void* args);
-int dabInputPrbsClean(void** args);
-int dabInputPrbsRewind(void* args);
+#include "dabInput.h"
+#include "prbs.h"
+class DabInputPrbs : public DabInputBase {
+ public:
+ virtual int open(const std::string name);
+ virtual int readFrame(void* buffer, int size);
+ virtual int setBitrate(int bitrate);
+ virtual int close();
-# endif
-#endif
+ private:
+ virtual int rewind();
+ PrbsGenerator m_prbs;
+};
-#endif // DAB_INPUT_PRBS_H