summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DabMod.cpp220
-rw-r--r--src/FIRFilter.cpp4
-rw-r--r--src/InputFileReader.cpp266
-rw-r--r--src/InputReader.h125
-rw-r--r--src/Makefile.am8
-rw-r--r--src/Makefile.in230
-rw-r--r--src/PhaseReference.cpp6
-rw-r--r--src/PhaseReference.h4
-rw-r--r--src/RemoteControl.h2
-rw-r--r--src/TimestampDecoder.cpp2
10 files changed, 590 insertions, 277 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index c15f7e4..64e557c 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -34,6 +34,7 @@
#include "InputMemory.h"
#include "OutputFile.h"
#include "OutputUHD.h"
+#include "InputReader.h"
#include "PcDebug.h"
#include "TimestampDecoder.h"
#include "FIRFilter.h"
@@ -77,8 +78,8 @@ void signalHandler(int signalNb)
void printUsage(char* progName, FILE* out = stderr)
{
- fprintf(out, "Welcome to %s %s, compiled at %s, %s\n\n",
- PACKAGE, VERSION, __DATE__, __TIME__);
+ fprintf(out, "Welcome to %s %s%s, compiled at %s, %s\n\n",
+ PACKAGE, VERSION, HGVERSION, __DATE__, __TIME__);
fprintf(out, "Usage with configuration file:\n");
fprintf(out, "\t%s -C config_file.ini\n\n", progName);
@@ -157,11 +158,7 @@ int main(int argc, char* argv[])
int useFileOutput = 0;
int useUHDOutput = 0;
- FILE* inputFile = NULL;
- uint32_t sync = 0;
- uint32_t nbFrames = 0;
- uint32_t frame = 0;
- uint16_t frameSize = 0;
+ uint64_t frame = 0;
size_t outputRate = 2048000;
size_t clockRate = 0;
unsigned dabMode = 0;
@@ -192,6 +189,7 @@ int main(int argc, char* argv[])
BaseRemoteController* rc = NULL;
Logger logger;
+ InputFileReader inputFileReader(logger);
signal(SIGINT, signalHandler);
@@ -529,11 +527,9 @@ int main(int argc, char* argv[])
}
// Opening ETI input file
- inputFile = fopen(inputName.c_str(), "r");
- if (inputFile == NULL) {
+ if (inputFileReader.Open(inputName) == -1) {
fprintf(stderr, "Unable to open input file!\n");
logger.level(error) << "Unable to open input file!";
- perror(inputName.c_str());
ret = -1;
goto END_MAIN;
}
@@ -572,203 +568,50 @@ int main(int argc, char* argv[])
((OutputUHD*)output)->setETIReader(modulator->getEtiReader());
}
+ inputFileReader.PrintInfo();
+
try {
while (running) {
- enum EtiStreamType {
- ETI_STREAM_TYPE_NONE = 0,
- ETI_STREAM_TYPE_RAW,
- ETI_STREAM_TYPE_STREAMED,
- ETI_STREAM_TYPE_FRAMED,
- };
- EtiStreamType streamType = ETI_STREAM_TYPE_NONE;
-
- struct stat inputFileStat;
- fstat(fileno(inputFile), &inputFileStat);
- size_t inputFileLength = inputFileStat.st_size;
-
- if (fread(&sync, sizeof(sync), 1, inputFile) != 1) {
- fprintf(stderr, "Unable to read sync in input file!\n");
- logger.level(error) << "Unable to read sync in input file!";
- perror(inputName.c_str());
- ret = -1;
- goto END_MAIN;
- }
- if ((sync == 0x49c5f8ff) || (sync == 0xb63a07ff)) {
- streamType = ETI_STREAM_TYPE_RAW;
- if (inputFileLength > 0) {
- nbFrames = inputFileLength / 6144;
- } else {
- nbFrames = (uint32_t)-1;
- }
- if (fseek(inputFile, -sizeof(sync), SEEK_CUR) != 0) {
- if (fread(data.getData(), 6144 - sizeof(sync), 1, inputFile)
- != 1) {
- fprintf(stderr, "Unable to seek in input file!\n");
- logger.level(error) << "Unable to seek in input file!";
- ret = -1;
- goto END_MAIN;
- }
- }
- goto START;
- }
- nbFrames = sync;
- if (fread(&frameSize, sizeof(frameSize), 1, inputFile) != 1) {
- fprintf(stderr, "Unable to read frame size in input file!\n");
- logger.level(error) << "Unable to read frame size in input file!";
- perror(inputName.c_str());
- ret = -1;
- goto END_MAIN;
- }
- sync >>= 16;
- sync &= 0xffff;
- sync |= ((uint32_t)frameSize) << 16;
-
- if ((sync == 0x49c5f8ff) || (sync == 0xb63a07ff)) {
- streamType = ETI_STREAM_TYPE_STREAMED;
- frameSize = nbFrames & 0xffff;
- if (inputFileLength > 0) {
- nbFrames = inputFileLength / (frameSize + 2);
- } else {
- nbFrames = (uint32_t)-1;
- }
- if (fseek(inputFile, -6, SEEK_CUR) != 0) {
- if (fread(data.getData(), frameSize - 4, 1, inputFile)
- != 1) {
- fprintf(stderr, "Unable to seek in input file!\n");
- logger.level(error) << "Unable to seek in input file!";
- ret = -1;
- goto END_MAIN;
- }
- }
- goto START;
- }
-
- if (fread(&sync, sizeof(sync), 1, inputFile) != 1) {
- fprintf(stderr, "Unable to read nb frame in input file!\n");
- logger.level(error) << "Unable to read nb frame in input file!";
- perror(inputName.c_str());
- ret = -1;
- goto END_MAIN;
- }
- if ((sync == 0x49c5f8ff) || (sync == 0xb63a07ff)) {
- streamType = ETI_STREAM_TYPE_FRAMED;
- if (fseek(inputFile, -6, SEEK_CUR) != 0) {
- if (fread(data.getData(), frameSize - 4, 1, inputFile)
- != 1) {
- fprintf(stderr, "Unable to seek in input file!\n");
- logger.level(error) << "Unable to seek in input file!";
- ret = -1;
- goto END_MAIN;
- }
- }
- goto START;
- }
+ int framesize;
- for (size_t i = 10; i < 6144 + 10; ++i) {
- sync >>= 8;
- sync &= 0xffffff;
- if (fread((uint8_t*)&sync + 3, 1, 1, inputFile) != 1) {
- fprintf(stderr, "Unable to read from input file!\n");
- logger.level(error) << "Unable to read from input file!";
- ret = 1;
- goto END_MAIN;
- }
- if ((sync == 0x49c5f8ff) || (sync == 0xb63a07ff)) {
- streamType = ETI_STREAM_TYPE_RAW;
- if (inputFileLength > 0) {
- nbFrames = (inputFileLength - i) / 6144;
- } else {
- nbFrames = (uint32_t)-1;
- }
- if (fseek(inputFile, -sizeof(sync), SEEK_CUR) != 0) {
- if (fread(data.getData(), 6144 - sizeof(sync), 1, inputFile)
- != 1) {
- fprintf(stderr, "Unable to seek in input file!\n");
- logger.level(error) << "Unable to seek in input file!";
- ret = -1;
- goto END_MAIN;
- }
- }
- goto START;
- }
- }
-
- fprintf(stderr, "Bad input file format!\n");
- logger.level(error) << "Bad input file format!";
- ret = -1;
- goto END_MAIN;
-
-START:
- fprintf(stderr, "Input file format: ");
- switch (streamType) {
- case ETI_STREAM_TYPE_RAW:
- fprintf(stderr, "raw");
- break;
- case ETI_STREAM_TYPE_STREAMED:
- fprintf(stderr, "streamed");
- break;
- case ETI_STREAM_TYPE_FRAMED:
- fprintf(stderr, "framed");
- break;
- default:
- fprintf(stderr, "unknown\n");
- logger.level(error) << "Input file format unknown!";
- ret = -1;
- goto END_MAIN;
- }
- fprintf(stderr, "\n");
- fprintf(stderr, "Input file length: %zu\n", inputFileLength);
- fprintf(stderr, "Input file nb frames: %u\n", nbFrames);
-
- for (frame = 0; frame < nbFrames; ++frame) {
+ PDEBUG("*****************************************\n");
+ PDEBUG("* Starting main loop\n");
+ PDEBUG("*****************************************\n");
+ while ((framesize = inputFileReader.GetNextFrame(data.getData())) > 0) {
if (!running) {
break;
}
+ frame++;
+
PDEBUG("*****************************************\n");
- PDEBUG("* Reading frame %u\n", frame);
+ PDEBUG("* Read frame %lu\n", frame);
PDEBUG("*****************************************\n");
- if (streamType == ETI_STREAM_TYPE_RAW) {
- frameSize = 6144;
- } else {
- if (fread(&frameSize, sizeof(frameSize), 1, inputFile)
- != 1) {
- PDEBUG("End of file!\n");
- logger.level(error) << "Reached end of file!";
- goto END_MAIN;
- }
- }
- PDEBUG("Frame size: %i\n", frameSize);
-
- if (fread(data.getData(), frameSize, 1, inputFile) != 1) {
- fprintf(stderr,
- "Unable to read %i data bytes in input file!\n",
- frameSize);
- perror(inputName.c_str());
- ret = -1;
- logger.level(error) << "Unable to read from input file!";
- goto END_MAIN;
- }
- memset(&((uint8_t*)data.getData())[frameSize], 0x55, 6144 - frameSize);
+ fprintf(stderr, "Reading frame %lu\n", frame);
////////////////////////////////////////////////////////////////
// Proccessing data
////////////////////////////////////////////////////////////////
flowgraph->run();
}
- fprintf(stderr, "End of file reached.\n");
- if (!loop) {
+ if (framesize == 0) {
+ fprintf(stderr, "End of file reached.\n");
+ if (!loop) {
+ running = false;
+ } else {
+ fprintf(stderr, "Rewinding file.\n");
+ inputFileReader.Rewind();
+ }
+ }
+ else {
+ fprintf(stderr, "Input read error.\n");
running = false;
- } else {
- fprintf(stderr, "Rewinding file.\n");
- rewind(inputFile);
}
}
} catch (std::exception& e) {
fprintf(stderr, "EXCEPTION: %s\n", e.what());
ret = -1;
- goto END_MAIN;
}
END_MAIN:
@@ -776,7 +619,7 @@ END_MAIN:
// Cleaning things
////////////////////////////////////////////////////////////////////////
fprintf(stderr, "\n\n");
- fprintf(stderr, "%u DAB frames encoded\n", frame);
+ fprintf(stderr, "%lu DAB frames encoded\n", frame);
fprintf(stderr, "%f seconds encoded\n", (float)frame * 0.024f);
fprintf(stderr, "\nCleaning flowgraph...\n");
@@ -785,11 +628,6 @@ END_MAIN:
// Cif
fprintf(stderr, "\nCleaning buffers...\n");
- fprintf(stderr, "\nClosing input file...\n");
- if (inputFile != NULL) {
- fclose(inputFile);
- }
-
logger.level(info) << "Terminating";
return ret;
diff --git a/src/FIRFilter.cpp b/src/FIRFilter.cpp
index 5d112d0..d110060 100644
--- a/src/FIRFilter.cpp
+++ b/src/FIRFilter.cpp
@@ -64,7 +64,7 @@ void FIRFilterWorker::process(struct FIRFilterWorkerData *fwd)
dataOut = new Buffer();
dataOut->setLength(dataIn->getLength());
- PDEBUG("FIRFilterWorker: dataIn->getLength() %d\n", dataIn->getLength());
+ PDEBUG("FIRFilterWorker: dataIn->getLength() %lu\n", dataIn->getLength());
#if __AVX__
#define _mm256_load1_ps(x) _mm256_set_ps(x, x, x, x, x, x, x, x)
@@ -304,7 +304,7 @@ FIRFilter::FIRFilter(std::string taps_file) :
myTapsFile(taps_file)
{
PDEBUG("FIRFilter::FIRFilter(%s) @ %p\n",
- taps_file, this);
+ taps_file.c_str(), this);
RC_ADD_PARAMETER(ntaps, "(Read-only) number of filter taps.");
RC_ADD_PARAMETER(tapsfile, "Filename containing filter taps. When written to, the new file gets automatically loaded.");
diff --git a/src/InputFileReader.cpp b/src/InputFileReader.cpp
new file mode 100644
index 0000000..1be1ad7
--- /dev/null
+++ b/src/InputFileReader.cpp
@@ -0,0 +1,266 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ Her Majesty the Queen in Right of Canada (Communications Research
+ Center Canada)
+
+ Copyrigth (C) 2013
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+
+ Input module for reading the ETI data from file or pipe.
+
+ Supported formats: RAW, FRAMED, STREAMED
+ Supports re-sync to RAW ETI
+ */
+/*
+ This file is part of CRC-DADMOD.
+
+ CRC-DADMOD is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ CRC-DADMOD is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DADMOD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <string>
+#include <cstdio>
+#include <cstring>
+#include <errno.h>
+#include <stdint.h>
+#include <sys/stat.h>
+#include "porting.h"
+#include "InputReader.h"
+#include "PcDebug.h"
+
+int InputFileReader::Open(std::string filename)
+{
+ filename_ = filename;
+ inputfile_ = fopen(filename_.c_str(), "r");
+ if (inputfile_ == NULL) {
+ fprintf(stderr, "Unable to open input file!\n");
+ logger_.level(error) << "Unable to open input file!";
+ perror(filename_.c_str());
+ return -1;
+ }
+
+ return IdentifyType();
+}
+
+int InputFileReader::Rewind()
+{
+ rewind(inputfile_);
+ return IdentifyType();
+}
+
+int InputFileReader::IdentifyType()
+{
+ EtiStreamType streamType = ETI_STREAM_TYPE_NONE;
+
+ struct stat inputFileStat;
+ fstat(fileno(inputfile_), &inputFileStat);
+ inputfilelength_ = inputFileStat.st_size;
+
+ uint32_t sync;
+ uint32_t nbFrames;
+ uint16_t frameSize;
+
+ char discard_buffer[6144];
+
+ if (fread(&sync, sizeof(sync), 1, inputfile_) != 1) {
+ fprintf(stderr, "Unable to read sync in input file!\n");
+ logger_.level(error) << "Unable to read sync in input file!";
+ perror(filename_.c_str());
+ return -1;
+ }
+ if ((sync == 0x49c5f8ff) || (sync == 0xb63a07ff)) {
+ streamType = ETI_STREAM_TYPE_RAW;
+ if (inputfilelength_ > 0) {
+ nbframes_ = inputfilelength_ / 6144;
+ }
+ else {
+ nbframes_ = ~0;
+ }
+ if (fseek(inputfile_, -sizeof(sync), SEEK_CUR) != 0) {
+ // if the seek fails, consume the rest of the frame
+ if (fread(discard_buffer, 6144 - sizeof(sync), 1, inputfile_)
+ != 1) {
+ fprintf(stderr, "Unable to read from input file!\n");
+ logger_.level(error) << "Unable to read from input file!";
+ perror(filename_.c_str());
+ return -1;
+ }
+ }
+ this->streamtype_ = streamType;
+ return 0;
+ }
+
+ nbFrames = sync;
+ if (fread(&frameSize, sizeof(frameSize), 1, inputfile_) != 1) {
+ fprintf(stderr, "Unable to read frame size in input file!\n");
+ logger_.level(error) << "Unable to read frame size in input file!";
+ perror(filename_.c_str());
+ return -1;
+ }
+ sync >>= 16;
+ sync &= 0xffff;
+ sync |= ((uint32_t)frameSize) << 16;
+
+ if ((sync == 0x49c5f8ff) || (sync == 0xb63a07ff)) {
+ streamType = ETI_STREAM_TYPE_STREAMED;
+ frameSize = nbFrames & 0xffff;
+ if (inputfilelength_ > 0) {
+ nbframes_ = inputfilelength_ / (frameSize + 2);
+ }
+ else {
+ nbframes_ = ~0;
+ }
+ if (fseek(inputfile_, -6, SEEK_CUR) != 0) {
+ // if the seek fails, consume the rest of the frame
+ if (fread(discard_buffer, frameSize - 4, 1, inputfile_)
+ != 1) {
+ fprintf(stderr, "Unable to read from input file!\n");
+ logger_.level(error) << "Unable to read from input file!";
+ perror(filename_.c_str());
+ return -1;
+ }
+ }
+ this->streamtype_ = streamType;
+ return 0;
+ }
+
+ if (fread(&sync, sizeof(sync), 1, inputfile_) != 1) {
+ fprintf(stderr, "Unable to read nb frame in input file!\n");
+ logger_.level(error) << "Unable to read nb frame in input file!";
+ perror(filename_.c_str());
+ return -1;
+ }
+ if ((sync == 0x49c5f8ff) || (sync == 0xb63a07ff)) {
+ streamType = ETI_STREAM_TYPE_FRAMED;
+ if (fseek(inputfile_, -6, SEEK_CUR) != 0) {
+ // if the seek fails, consume the rest of the frame
+ if (fread(discard_buffer, frameSize - 4, 1, inputfile_)
+ != 1) {
+ fprintf(stderr, "Unable to read from input file!\n");
+ logger_.level(error) << "Unable to read from input file!";
+ perror(filename_.c_str());
+ return -1;
+ }
+ }
+ this->streamtype_ = streamType;
+ nbframes_ = ~0;
+ return 0;
+ }
+
+ // Search for the sync marker byte by byte
+ for (size_t i = 10; i < 6144 + 10; ++i) {
+ sync >>= 8;
+ sync &= 0xffffff;
+ if (fread((uint8_t*)&sync + 3, 1, 1, inputfile_) != 1) {
+ fprintf(stderr, "Unable to read from input file!\n");
+ logger_.level(error) << "Unable to read from input file!";
+ perror(filename_.c_str());
+ return -1;
+ }
+ if ((sync == 0x49c5f8ff) || (sync == 0xb63a07ff)) {
+ streamType = ETI_STREAM_TYPE_RAW;
+ if (inputfilelength_ > 0) {
+ nbframes_ = (inputfilelength_ - i) / 6144;
+ }
+ else {
+ nbframes_ = ~0;
+ }
+ if (fseek(inputfile_, -sizeof(sync), SEEK_CUR) != 0) {
+ if (fread(discard_buffer, 6144 - sizeof(sync), 1, inputfile_)
+ != 1) {
+ fprintf(stderr, "Unable to read from input file!\n");
+ logger_.level(error) << "Unable to read from input file!";
+ perror(filename_.c_str());
+ return -1;
+ }
+ }
+ this->streamtype_ = streamType;
+ return 0;
+ }
+ }
+
+ fprintf(stderr, "Bad input file format!\n");
+ logger_.level(error) << "Bad input file format!";
+ return -1;
+}
+
+void InputFileReader::PrintInfo()
+{
+ fprintf(stderr, "Input file format: ");
+ switch (streamtype_) {
+ case ETI_STREAM_TYPE_RAW:
+ fprintf(stderr, "raw");
+ break;
+ case ETI_STREAM_TYPE_STREAMED:
+ fprintf(stderr, "streamed");
+ break;
+ case ETI_STREAM_TYPE_FRAMED:
+ fprintf(stderr, "framed");
+ break;
+ default:
+ fprintf(stderr, "unkown!");
+ break;
+ }
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Input file length: %zu\n", inputfilelength_);
+ if (~nbframes_ != 0) {
+ fprintf(stderr, "Input file nb frames: %lu\n", nbframes_);
+ }
+ else {
+ fprintf(stderr, "Input file nb frames: endless\n");
+ }
+}
+
+int InputFileReader::GetNextFrame(void* buffer)
+{
+ uint16_t frameSize;
+
+ if (streamtype_ == ETI_STREAM_TYPE_RAW) {
+ frameSize = 6144;
+ }
+ else {
+ if (fread(&frameSize, sizeof(frameSize), 1, inputfile_) != 1) {
+ PDEBUG("End of file!\n");
+ logger_.level(error) << "Reached end of file!";
+ return 0;
+ }
+ }
+ if (frameSize > 6144) { // there might be a better limit
+ logger_.level(error) << "Wrong frame size " << frameSize << " in ETI file!";
+ fprintf(stderr, "Wrong frame size %u in ETI file!\n", frameSize);
+ return -1;
+ }
+
+ PDEBUG("Frame size: %u\n", frameSize);
+
+ if (fread(buffer, frameSize, 1, inputfile_) != 1) {
+ // A short read of a frame (i.e. reading an incomplete frame)
+ // is not tolerated. Input files must not contain incomplete frames
+ fprintf(stderr,
+ "Unable to read a complete frame of %u data bytes from input file!\n",
+ frameSize);
+
+ perror(filename_.c_str());
+ logger_.level(error) << "Unable to read from input file!";
+ return -1;
+ }
+
+ memset(&((uint8_t*)buffer)[frameSize], 0x55, 6144 - frameSize);
+
+ return 6144;
+}
diff --git a/src/InputReader.h b/src/InputReader.h
new file mode 100644
index 0000000..dbc7c11
--- /dev/null
+++ b/src/InputReader.h
@@ -0,0 +1,125 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ Her Majesty the Queen in Right of Canada (Communications Research
+ Center Canada)
+
+ Copyrigth (C) 2013
+ Matthias P. Braendli, matthias.braendli@mpb.li
+ */
+/*
+ This file is part of CRC-DADMOD.
+
+ CRC-DADMOD is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ CRC-DADMOD is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DADMOD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef INPUTREADER_H
+#define INPUTREADER_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <cstdio>
+#include "porting.h"
+#include "Log.h"
+
+/* Known types of input streams. Description taken from the CRC mmbTools forum.
+
+ All numbers are little-endian.
+
+ Framed format is used for file recording. It is the default format. The
+ padding can be removed from data. Format:
+ uint32_t nbFrames
+ for each frame
+ uint16_t frameSize
+ uint8_t data[frameSize]
+
+ Streamed format is used for streamed applications. As the total number of
+ frames is unknown before end of transmission, the corresponding field is
+ removed. The padding can be removed from data. Format:
+ for each frame
+ uint16_t frameSize
+ uint8_t data[frameSize]
+
+ Raw format is a bit-by-bit (but byte aligned on sync) recording of a G.703
+ data stream. The padding is always present. Format:
+ for each frame
+ uint8_t data[6144]
+
+ Please note that our raw format can also be referred to as ETI(NI, G.703) or ETI(NI).
+*/
+enum EtiStreamType {
+ ETI_STREAM_TYPE_NONE = 0,
+ ETI_STREAM_TYPE_RAW,
+ ETI_STREAM_TYPE_STREAMED,
+ ETI_STREAM_TYPE_FRAMED,
+};
+
+class InputReader
+{
+ public:
+ // Save the next frame into the buffer, and return the number of bytes read.
+ virtual int GetNextFrame(void* buffer) = 0;
+};
+
+class InputFileReader : public InputReader
+{
+ public:
+ InputFileReader(Logger logger) :
+ streamtype_(ETI_STREAM_TYPE_NONE),
+ inputfile_(NULL), logger_(logger) {};
+
+ ~InputFileReader()
+ {
+ fprintf(stderr, "\nClosing input file...\n");
+
+ if (inputfile_ != NULL) {
+ fclose(inputfile_);
+ }
+ }
+
+ // open file and determine stream type
+ int Open(std::string filename);
+
+ // Print information about the file opened
+ void PrintInfo();
+
+ // Rewind the file, and replay anew
+ // returns 0 on success, -1 on failure
+ int Rewind();
+
+ // Put next frame into buffer. This function will never write more than
+ // 6144 bytes into buffer.
+ // returns number of bytes written to buffer, 0 on eof, -1 on error
+ int GetNextFrame(void* buffer);
+
+ EtiStreamType GetStreamType()
+ {
+ return streamtype_;
+ }
+
+ private:
+ int IdentifyType();
+
+ std::string filename_;
+ EtiStreamType streamtype_;
+ FILE* inputfile_;
+ Logger logger_;
+
+ size_t inputfilelength_;
+ uint64_t nbframes_; // 64-bit because 32-bit overflow is
+ // after 2**32 * 24ms ~= 3.3 years
+};
+
+#endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 991267b..0bb9dc9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,6 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with CRC-DADMOD. If not, see <http://www.gnu.org/licenses/>.
+if IS_HG_REPO
+HGVERSION_FLAGS = -DHGVERSION="\"`hg parents --template '-{node|short}'`\""
+else
+HGVERSION_FLAGS = -DHGVERSION="\"-modified\""
+endif
FFT_DIR=$(top_builddir)/lib/kiss_fft129
FFT_INC=-I$(FFT_DIR) -I$(FFT_DIR)/tools
@@ -35,7 +40,7 @@ $(FFT_DIR):
tar xzf $(top_srcdir)/lib/kiss_fft129.tar.gz -C $(top_builddir)/lib; \
fi
-crc_dabmod_CPPFLAGS = $(FFT_INC) $(FFT_FLG) -msse -msse2
+crc_dabmod_CPPFLAGS = $(FFT_INC) $(FFT_FLG) -msse -msse2 $(HGVERSION_FLAGS)
crc_dabmod_SOURCES = DabMod.cpp \
PcDebug.h \
porting.c porting.h \
@@ -59,6 +64,7 @@ crc_dabmod_SOURCES = DabMod.cpp \
OutputUHD.cpp OutputUHD.h \
ModOutput.cpp ModOutput.h \
InputMemory.cpp InputMemory.h \
+ InputFileReader.cpp InputReader.h \
OutputFile.cpp OutputFile.h \
FrameMultiplexer.cpp FrameMultiplexer.h \
ModMux.cpp ModMux.h \
diff --git a/src/Makefile.in b/src/Makefile.in
index 3b4adc1..0a1e7ad 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.14 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -35,23 +34,51 @@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -73,8 +100,8 @@ host_triplet = @host@
target_triplet = @target@
bin_PROGRAMS = crc-dabmod$(EXEEXT)
subdir = src
-DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(dist_bin_SCRIPTS) $(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_boost_base.m4 \
$(top_srcdir)/configure.ac
@@ -102,6 +129,7 @@ am_crc_dabmod_OBJECTS = crc_dabmod-DabMod.$(OBJEXT) \
crc_dabmod-TimestampDecoder.$(OBJEXT) \
crc_dabmod-OutputUHD.$(OBJEXT) crc_dabmod-ModOutput.$(OBJEXT) \
crc_dabmod-InputMemory.$(OBJEXT) \
+ crc_dabmod-InputFileReader.$(OBJEXT) \
crc_dabmod-OutputFile.$(OBJEXT) \
crc_dabmod-FrameMultiplexer.$(OBJEXT) \
crc_dabmod-ModMux.$(OBJEXT) crc_dabmod-PrbsGenerator.$(OBJEXT) \
@@ -154,6 +182,18 @@ am__uninstall_files_from_dir = { \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
SCRIPTS = $(dist_bin_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
@@ -161,33 +201,32 @@ am__mv = mv -f
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
+am__v_lt_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
-am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo " CXXLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
SOURCES = $(crc_dabmod_SOURCES) $(nodist_crc_dabmod_SOURCES)
DIST_SOURCES = $(crc_dabmod_SOURCES)
am__can_run_installinfo = \
@@ -195,6 +234,23 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -303,11 +359,13 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+@IS_HG_REPO_FALSE@HGVERSION_FLAGS = -DHGVERSION="\"-modified\""
+@IS_HG_REPO_TRUE@HGVERSION_FLAGS = -DHGVERSION="\"`hg parents --template '-{node|short}'`\""
FFT_DIR = $(top_builddir)/lib/kiss_fft129
FFT_INC = -I$(FFT_DIR) -I$(FFT_DIR)/tools
FFT_SRC = $(FFT_DIR)/kiss_fft.c $(FFT_DIR)/kiss_fft.h $(FFT_DIR)/tools/kiss_fftr.c $(FFT_DIR)/tools/kiss_fftr.h kiss_fftsimd.c kiss_fftsimd.h
FFT_FLG = -ffast-math
-crc_dabmod_CPPFLAGS = $(FFT_INC) $(FFT_FLG) -msse -msse2
+crc_dabmod_CPPFLAGS = $(FFT_INC) $(FFT_FLG) -msse -msse2 $(HGVERSION_FLAGS)
crc_dabmod_SOURCES = DabMod.cpp \
PcDebug.h \
porting.c porting.h \
@@ -331,6 +389,7 @@ crc_dabmod_SOURCES = DabMod.cpp \
OutputUHD.cpp OutputUHD.h \
ModOutput.cpp ModOutput.h \
InputMemory.cpp InputMemory.h \
+ InputFileReader.cpp InputReader.h \
OutputFile.cpp OutputFile.h \
FrameMultiplexer.cpp FrameMultiplexer.h \
ModMux.cpp ModMux.h \
@@ -397,10 +456,11 @@ install-binPROGRAMS: $(bin_PROGRAMS)
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p; \
- then echo "$$p"; echo "$$p"; else :; fi; \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -421,13 +481,15 @@ uninstall-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
crc-dabmod$(EXEEXT): $(crc_dabmod_OBJECTS) $(crc_dabmod_DEPENDENCIES) $(EXTRA_crc_dabmod_DEPENDENCIES)
@rm -f crc-dabmod$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(crc_dabmod_OBJECTS) $(crc_dabmod_LDADD) $(LIBS)
@@ -489,6 +551,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc_dabmod-FrequencyInterleaver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc_dabmod-GainControl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc_dabmod-GuardIntervalInserter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc_dabmod-InputFileReader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc_dabmod-InputMemory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc_dabmod-Log.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc_dabmod-ModCodec.Po@am__quote@
@@ -523,14 +586,14 @@ distclean-compile:
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
crc_dabmod-porting.o: porting.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(crc_dabmod_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crc_dabmod-porting.o -MD -MP -MF $(DEPDIR)/crc_dabmod-porting.Tpo -c -o crc_dabmod-porting.o `test -f 'porting.c' || echo '$(srcdir)/'`porting.c
@@ -896,6 +959,20 @@ crc_dabmod-InputMemory.obj: InputMemory.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(crc_dabmod_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o crc_dabmod-InputMemory.obj `if test -f 'InputMemory.cpp'; then $(CYGPATH_W) 'InputMemory.cpp'; else $(CYGPATH_W) '$(srcdir)/InputMemory.cpp'; fi`
+crc_dabmod-InputFileReader.o: InputFileReader.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(crc_dabmod_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT crc_dabmod-InputFileReader.o -MD -MP -MF $(DEPDIR)/crc_dabmod-InputFileReader.Tpo -c -o crc_dabmod-InputFileReader.o `test -f 'InputFileReader.cpp' || echo '$(srcdir)/'`InputFileReader.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/crc_dabmod-InputFileReader.Tpo $(DEPDIR)/crc_dabmod-InputFileReader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InputFileReader.cpp' object='crc_dabmod-InputFileReader.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(crc_dabmod_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o crc_dabmod-InputFileReader.o `test -f 'InputFileReader.cpp' || echo '$(srcdir)/'`InputFileReader.cpp
+
+crc_dabmod-InputFileReader.obj: InputFileReader.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(crc_dabmod_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT crc_dabmod-InputFileReader.obj -MD -MP -MF $(DEPDIR)/crc_dabmod-InputFileReader.Tpo -c -o crc_dabmod-InputFileReader.obj `if test -f 'InputFileReader.cpp'; then $(CYGPATH_W) 'InputFileReader.cpp'; else $(CYGPATH_W) '$(srcdir)/InputFileReader.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/crc_dabmod-InputFileReader.Tpo $(DEPDIR)/crc_dabmod-InputFileReader.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InputFileReader.cpp' object='crc_dabmod-InputFileReader.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(crc_dabmod_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o crc_dabmod-InputFileReader.obj `if test -f 'InputFileReader.cpp'; then $(CYGPATH_W) 'InputFileReader.cpp'; else $(CYGPATH_W) '$(srcdir)/InputFileReader.cpp'; fi`
+
crc_dabmod-OutputFile.o: OutputFile.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(crc_dabmod_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT crc_dabmod-OutputFile.o -MD -MP -MF $(DEPDIR)/crc_dabmod-OutputFile.Tpo -c -o crc_dabmod-OutputFile.o `test -f 'OutputFile.cpp' || echo '$(srcdir)/'`OutputFile.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/crc_dabmod-OutputFile.Tpo $(DEPDIR)/crc_dabmod-OutputFile.Po
@@ -1162,26 +1239,15 @@ crc_dabmod-RemoteControl.obj: RemoteControl.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(crc_dabmod_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o crc_dabmod-RemoteControl.obj `if test -f 'RemoteControl.cpp'; then $(CYGPATH_W) 'RemoteControl.cpp'; else $(CYGPATH_W) '$(srcdir)/RemoteControl.cpp'; fi`
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -1193,15 +1259,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -1210,6 +1272,21 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -1352,18 +1429,19 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dist_binSCRIPTS
.MAKE: install-am install-strip
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
- clean-generic clean-local ctags distclean distclean-compile \
- distclean-generic distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-binPROGRAMS \
- install-data install-data-am install-dist_binSCRIPTS \
- install-dvi install-dvi-am install-exec install-exec-am \
- install-html install-html-am install-info install-info-am \
- install-man install-pdf install-pdf-am install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
- ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic clean-local cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-data \
+ install-data-am install-dist_binSCRIPTS install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-dist_binSCRIPTS
diff --git a/src/PhaseReference.cpp b/src/PhaseReference.cpp
index bebbec6..ff6a776 100644
--- a/src/PhaseReference.cpp
+++ b/src/PhaseReference.cpp
@@ -42,11 +42,11 @@ const unsigned char PhaseReference::d_h[4][32] = {
};
-PhaseReference::PhaseReference(size_t dabmode) :
+PhaseReference::PhaseReference(unsigned int dabmode) :
ModCodec(ModFormat(0), ModFormat(0)),
d_dabmode(dabmode)
{
- PDEBUG("PhaseReference::PhaseReference(%zu) @ %p\n", dabmode, this);
+ PDEBUG("PhaseReference::PhaseReference(%u) @ %p\n", dabmode, this);
switch (d_dabmode) {
case 1:
@@ -138,7 +138,7 @@ void PhaseReference::fillData()
},
};
- if ((d_dabmode < 0) || (d_dabmode > 3)) {
+ if (d_dabmode > 3) {
throw std::runtime_error(
"PhaseReference::fillData invalid DAB mode!");
}
diff --git a/src/PhaseReference.h b/src/PhaseReference.h
index 5122f02..40870ed 100644
--- a/src/PhaseReference.h
+++ b/src/PhaseReference.h
@@ -36,7 +36,7 @@
class PhaseReference : public ModCodec
{
public:
- PhaseReference(size_t dabmode);
+ PhaseReference(unsigned int dabmode);
virtual ~PhaseReference();
PhaseReference(const PhaseReference&);
PhaseReference& operator=(const PhaseReference&);
@@ -46,7 +46,7 @@ public:
const char* name() { return "PhaseReference"; }
protected:
- size_t d_dabmode;
+ unsigned int d_dabmode;
size_t d_carriers;
size_t d_num;
const static unsigned char d_h[4][32];
diff --git a/src/RemoteControl.h b/src/RemoteControl.h
index 17352bf..79b330f 100644
--- a/src/RemoteControl.h
+++ b/src/RemoteControl.h
@@ -59,7 +59,7 @@ class ParameterError : public std::exception
public:
ParameterError(string message) : message_(message) {}
~ParameterError() throw() {};
- const char* what() { return message_.c_str(); }
+ const char* what() const throw() { return message_.c_str(); }
private:
string message_;
diff --git a/src/TimestampDecoder.cpp b/src/TimestampDecoder.cpp
index a0c457a..7883da9 100644
--- a/src/TimestampDecoder.cpp
+++ b/src/TimestampDecoder.cpp
@@ -170,7 +170,7 @@ void TimestampDecoder::updateTimestampPPS(double pps)
if (time_pps > pps) // Second boundary crossed
{
- MDEBUG("TimestampDecoder::updateTimestampPPS crossed second\n", pps);
+ MDEBUG("TimestampDecoder::updateTimestampPPS crossed second\n");
// The second for the next eight frames will not
// be defined by the MNSC