summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-30 12:08:29 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-30 12:08:29 +0100
commit5aa8118d99b104402bf044e57c473a7156dc2314 (patch)
treeeb6f71ca23ada1af6c0f38915f8a53ee31b05762
parent8dd686beafc67bc9f5aa666c50b7a71b77cd6baf (diff)
downloaddabmux-5aa8118d99b104402bf044e57c473a7156dc2314.tar.gz
dabmux-5aa8118d99b104402bf044e57c473a7156dc2314.tar.bz2
dabmux-5aa8118d99b104402bf044e57c473a7156dc2314.zip
Remove bridge format and input
-rw-r--r--configure.ac8
-rw-r--r--src/ConfigParser.cpp11
-rw-r--r--src/DabMux.cpp1
-rw-r--r--src/Makefile.am2
-rw-r--r--src/bridge.c515
-rw-r--r--src/bridge.h112
-rw-r--r--src/dabInputBridgeUdp.cpp129
-rw-r--r--src/dabInputBridgeUdp.h49
-rw-r--r--src/utils.cpp3
9 files changed, 1 insertions, 829 deletions
diff --git a/configure.ac b/configure.ac
index 39d3f19..06a2249 100644
--- a/configure.ac
+++ b/configure.ac
@@ -198,12 +198,6 @@ AC_ARG_ENABLE([format_raw],
[], [enable_format_raw=yes])
AS_IF([test "x$enable_format_raw" = "xyes"],
[AC_DEFINE(HAVE_FORMAT_RAW, [1], [Define if RAW format is enabled])])
-# BRIDGE
-AC_ARG_ENABLE([format_bridge],
- [AS_HELP_STRING([--enable-format-bridge], [Enable BRIDGE format])],
- [], [enable_format_bridge=no])
-AS_IF([test "x$enable_format_bridge" = "xno"],
- [AC_DEFINE(HAVE_FORMAT_BRIDGE, [1], [Define if BRIDGE format is enabled])])
# MPEG
AC_ARG_ENABLE([format_mpeg],
[AS_HELP_STRING([--disable-format-mpeg], [Disable MPEG format])],
@@ -266,7 +260,7 @@ echo
echo "Formats:"
enabled=""
disabled=""
-for format in raw bridge mpeg packet dabplus dmb epm
+for format in raw mpeg packet dabplus dmb epm
do
eval var=\$enable_format_$format
AS_IF([test "x$var" = "xyes"],
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index e68f98f..aee86fc 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -60,7 +60,6 @@
#include "dabInputEnhancedPacketFile.h"
#include "dabInputEnhancedFifo.h"
#include "dabInputUdp.h"
-#include "dabInputBridgeUdp.h"
#include "dabInputTest.h"
#include "dabInputPrbs.h"
#include "dabInputRawFile.h"
@@ -714,16 +713,6 @@ static void setup_subchannel_from_ptree(DabSubchannel* subchan,
throw runtime_error(ss.str());
}
#endif // defined(HAVE_FORMAT_DABPLUS)
- } else if (type == "bridge") {
- // TODO default proto should be udp://
- if (0) {
-#if defined(HAVE_FORMAT_BRIDGE)
-#if defined(HAVE_INPUT_UDP)
- } else if (proto == "udp") {
- operations = dabInputBridgeUdpOperations;
-#endif // defined(HAVE_INPUT_UDP)
-#endif // defined(HAVE_FORMAT_BRIDGE)
- }
} else if (type == "data" and proto == "prbs") {
input_is_old_style = false;
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index f72ea8d..a4605e7 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -104,7 +104,6 @@ typedef DWORD32 uint32_t;
#include "dabInputEnhancedPacketFile.h"
#include "dabInputEnhancedFifo.h"
#include "dabInputUdp.h"
-#include "dabInputBridgeUdp.h"
#include "dabInputTest.h"
#include "dabInputPrbs.h"
#include "dabInputRawFile.h"
diff --git a/src/Makefile.am b/src/Makefile.am
index dfcdb12..b23e71c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,7 +48,6 @@ odr_dabmux_LDADD =$(ZMQ_LIBS) $(CURL_LIBS) \
odr_dabmux_SOURCES =DabMux.cpp DabMux.h \
DabMultiplexer.cpp DabMultiplexer.h \
dabInput.h dabInput.cpp \
- dabInputBridgeUdp.h dabInputBridgeUdp.cpp \
dabInputDabplusFifo.h dabInputDabplusFifo.cpp \
dabInputDabplusFile.h dabInputDabplusFile.cpp \
dabInputDmbFile.h dabInputDmbFile.cpp \
@@ -93,7 +92,6 @@ odr_dabmux_SOURCES =DabMux.cpp DabMux.h \
TcpSocket.h TcpSocket.cpp \
UdpSocket.h UdpSocket.cpp \
ThreadsafeQueue.h \
- bridge.h bridge.c \
crc.h crc.c \
fig/FIG.h fig/FIG.cpp \
fig/FIG0.h fig/FIG0structs.h \
diff --git a/src/bridge.c b/src/bridge.c
deleted file mode 100644
index d66a7b2..0000000
--- a/src/bridge.c
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
- Queen in Right of Canada (Communications Research Center Canada)
- */
-/*
- This file is part of ODR-DabMux.
-
- ODR-DabMux 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.
-
- ODR-DabMux 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 ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdio.h>
-#ifdef _WIN32
-# include <winsock2.h>
-#else
-# include <netinet/in.h>
-#endif // _WIN32
-#include <string.h>
-#include "bridge.h"
-#include "crc.h"
-
-#include <assert.h>
-#include "PcDebug.h"
-
-#ifdef _WIN32
-# ifdef _DEBUG
- int bridgeVerbosity = 0;
-# endif
-#else
-# ifdef DEBUG
- int bridgeVerbosity = 0;
-# endif
-#endif
-
-void printStats(struct bridgeInfo* info, FILE* out)
-{
- struct bridgeStats stats = getStats(info);
- fprintf(out, "frames : %lu\n", stats.frames);
- fprintf(out, " valids : %lu\n", stats.valids);
- fprintf(out, " invalids : %lu\n", stats.invalids);
- fprintf(out, " bytes : %lu\n", stats.bytes);
- fprintf(out, " packets : %lu\n", stats.packets);
- fprintf(out, " errors : %lu\n", stats.errors);
- fprintf(out, " missings : %lu\n", stats.missings);
- fprintf(out, " dropped : %lu\n", stats.dropped);
- fprintf(out, " crc : %lu\n", stats.crc);
- fprintf(out, " overruns : %lu\n", stats.overruns);
-}
-
-
-void resetStats(struct bridgeInfo* info)
-{
- memset(&info->stats, 0, sizeof(info->stats));
-}
-
-
-struct bridgeStats getStats(struct bridgeInfo* info)
-{
- return info->stats;
-}
-
-
-void bridgeInitInfo(struct bridgeInfo* info)
-{
- memset(info, 0, sizeof(*info));
- info->transmitted = -8;
-};
-
-
-int writePacket(void* dataIn, int sizeIn, void* dataOut, int sizeOut,
- struct bridgeInfo* info)
-{
- static struct bridgeHdr header = { 0 };
-
- PDEBUG4_VERBOSE(1, bridgeVerbosity, "writePacket\n sizeIn: %i, sizeOut: %i, "
- "offset: %i, transmitted: %i\n",
- sizeIn, sizeOut, info->offset, info->transmitted);
-
- assert(info->transmitted < sizeIn);
-
- if ((info->offset == 0) && (sizeIn > 0)) {
- ((unsigned short*)dataOut)[0] = 0xb486;
- info->offset = 2;
- }
- if (sizeIn == 0) {
- memset((unsigned char*)dataOut + info->offset, 0, sizeOut - info->offset);
- info->offset = 0;
- info->transmitted = -8;
- PDEBUG1_VERBOSE(1, bridgeVerbosity, " return %i (sizeIn == 0)\n",
- sizeOut);
- return 0;
- }
-
- while (info->offset < sizeOut) {
- switch (info->transmitted) {
- case (-8):
- ((unsigned char*)dataOut)[info->offset++] = 0xcb;
- ++info->transmitted;
- break;
- case (-7):
- ((unsigned char*)dataOut)[info->offset++] = 0x28;
- ++info->transmitted;
- break;
- case (-6):
- header.size = htons((unsigned short)sizeIn);
- header.crc = htons((unsigned short)(crc16(0xffff, &header, 4) ^ 0xffff));
- ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[0];
- ++info->transmitted;
- break;
- case (-5):
- ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[1];
- ++info->transmitted;
- break;
- case (-4):
- ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[2];
- ++info->transmitted;
- break;
- case (-3):
- ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[3];
- ++info->transmitted;
- break;
- case (-2):
- ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[4];
- ++info->transmitted;
- break;
- case (-1):
- ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[5];
- ++info->transmitted;
- header.seqNb = htons((unsigned short)(ntohs(header.seqNb) + 1));
- break;
- default:
- ((unsigned char*)dataOut)[info->offset++] =
- ((unsigned char*)dataIn)[info->transmitted++];
- if (info->transmitted == sizeIn) {
- PDEBUG2_VERBOSE(1, bridgeVerbosity,
- " Packet done, %i bytes at offset %i\n",
- info->transmitted, info->offset);
- PDEBUG1_VERBOSE(1, bridgeVerbosity,
- " return %i (sizeIn == transmitted)\n", info->offset);
- info->transmitted = -8;
- return info->offset;
- }
- }
- }
-
- PDEBUG1_VERBOSE(1, bridgeVerbosity, " return %i (offset >= sizeOut)\n",
- info->offset);
- info->offset = 0;
- return 0;
-}
-
-
-int getPacket(void* dataIn, int sizeIn, void* dataOut, int sizeOut,
- struct bridgeInfo* info, char async)
-{
- unsigned char* in = (unsigned char*)dataIn;
- unsigned char* out = (unsigned char*)dataOut;
- unsigned char ch;
- unsigned short crc;
- unsigned short diff;
-
- PDEBUG3_VERBOSE(1, bridgeVerbosity,
- "getPacket\n pos\t%i\n state\t%i\n received\t%i\n",
- info->pos, info->state, info->received);
-
- if (info->pos == 0) {
- ++info->stats.frames;
- if (((unsigned short*)dataIn)[0] != 0xb486) {
- if (((unsigned short*)dataIn)[0] != 0) {
- ++info->stats.invalids;
- printf("WARNING: processing frame with invalid magic "
- "number!\n");
- } else {
- PDEBUG0_VERBOSE(1, bridgeVerbosity,
- "getPacket: not a valid frame\n");
- return 0;
- }
- } else {
- PDEBUG0_VERBOSE(2, bridgeVerbosity, "Valid frame\n");
- info->pos += 2;
- ++info->stats.valids;
- }
- info->stats.bytes += sizeIn;
- }
- while (info->pos < sizeIn) {
- ch = in[info->pos++];
- switch (info->state) {
- case 0: // sync search
- info->sync <<= 8;
- info->sync |= ch;
- if (info->sync == 0xcb28) {
- PDEBUG0_VERBOSE(2, bridgeVerbosity, "Sync found\n");
- ++info->stats.packets;
- info->received = 0;
- info->state = 1;
- }
- if (info->sync == 0) { // Padding
- info->pos = 0;
- return 0;
- }
- break;
- case 1: // header search
- ((char*)&info->header)[info->received++] = ch;
- if (info->received == sizeof(struct bridgeHdr)) {
- PDEBUG0_VERBOSE(2, bridgeVerbosity, "Header found\n");
- out = (unsigned char*)dataOut;
- info->received = 0;
- info->state = 2;
- crc = crc16(0xffff, &info->header, 4);
- crc ^= 0xffff;
- info->header.size = ntohs(info->header.size);
- info->header.seqNb = ntohs(info->header.seqNb);
- info->header.crc = ntohs(info->header.crc);
- PDEBUG4_VERBOSE(2, bridgeVerbosity,
- " size\t%i\n seq\t%i\n crc\t0x%.4x (0x%.4x)\n",
- info->header.size, info->header.seqNb,
- info->header.crc, crc);
- if (crc != info->header.crc) {
- PDEBUG0_VERBOSE(2, bridgeVerbosity, "CRC error\n");
- ++info->stats.errors;
- ++info->stats.crc;
- info->state = 0;
- if (info->pos < sizeof(struct bridgeHdr) + 2 + 2) {
- info->pos = 2;
- }
- } else {
- if (!info->initSeq) {
- info->lastSeq = info->header.seqNb;
- info->initSeq = 1;
- } else {
- if (info->header.seqNb > info->lastSeq) {
- diff = (info->header.seqNb - info->lastSeq) - 1;
- } else {
- diff = ((short)info->lastSeq -
- (short)info->header.seqNb) - 1;
- }
- info->stats.errors += diff;
- info->stats.missings += diff;
- info->lastSeq = info->header.seqNb;
- }
- }
- }
- break;
- case 2: // data
- out[info->received++] = ch;
- if (info->received == info->header.size) {
- PDEBUG0_VERBOSE(2, bridgeVerbosity, "data found\n");
- info->state = 0;
- return info->received;
- }
- if (info->received == sizeOut) {
- PDEBUG1_VERBOSE(1, bridgeVerbosity, "To much data: %i\n",
- info->received);
- ++info->stats.errors;
- ++info->stats.overruns;
- info->sync = 0;
- info->state = 0;
- return -1;
- }
- break;
- case 3: // Padding or sync
- if (ch == 0) { // Padding
- info->pos = 0;
- return 0;
- }
- if (ch != 0xcb) { // error
- info->sync = ch;
- info->state = 0;
- } else {
- info->state = 4;
- }
- break;
- case 4: // Low byte sync
- if (ch != 28) { // error
- info->sync <<= 8;
- info->sync |= ch;
- info->state = 0;
- } else {
- info->state = 2;
- }
- break;
- }
- }
- info->pos = 0;
- return 0;
-}
-
-
-void dump(void* data, int size, FILE* stream)
-{
- int i;
- fprintf(stream, "%i bytes\n", size);
- for (i = 0; i < size; ++i) {
- fprintf(stream, " 0x%.2x", ((unsigned char*)data)[i]);
- if (i % 8 == 7)
- fprintf(stream, "\n");
- }
- fprintf(stream, "\n");
-}
-
-
-#ifdef BRIDGE_TEST
-#include <stdlib.h>
-
-
-int test(const unsigned char* data)
-{
- unsigned char bridgeSize = data[0];
- unsigned char nbInput = data[1];
- unsigned char nbBridge = 1;
- struct bridgeInfo info;
-
- int i, j;
- int index = 0;
- int max = 0;
- int nbBytes;
-
- unsigned char** inputData;
- unsigned char** bridgeData;
- unsigned char* outputData;
-
- inputData = malloc(nbInput * 4);
- bridgeData = malloc(nbBridge * 4);
- for (i = 0; i < nbInput; ++i) {
- if (data[i + 2] > 0)
- inputData[i] = malloc(data[i + 2]);
- if (data[i + 2] > max) {
- max = data[i + 2];
- }
- for (j = 0; j < data[i + 2]; ++j) {
- inputData[i][j] = index++;
- }
- }
- bridgeData[0] = malloc(bridgeSize);
- memset(bridgeData[0], 0, bridgeSize);
- outputData = malloc(max);
- bridgeInitInfo(&info);
-
- // Write packets
- index = 0;
- while (1) {
- if (data[index + 2] == 0) {
- if (++index == nbInput)
- break;
- }
- while ((nbBytes = writePacket(inputData[index], data[index + 2],
- bridgeData[nbBridge - 1], bridgeSize, &info))
- != 0) {
- if (++index == nbInput) {
- break;
- }
- }
- if (index == nbInput)
- break;
- // TODO check null
- bridgeData = realloc(bridgeData, (++nbBridge) * 4);
- bridgeData[nbBridge - 1] = malloc(bridgeSize);
- memset(bridgeData[nbBridge - 1], 0, bridgeSize);
- }
-// if (nbBytes != bridgeSize) {
- writePacket(NULL, 0, bridgeData[nbBridge - 1], bridgeSize, &info);
-// }
-
- // read packets
- index = 0;
- for (i = 0; i < nbBridge; ++i) {
- while ((nbBytes = getPacket(bridgeData[i], bridgeSize, outputData, max,
- &info, 0)) != 0) {
- while (data[index + 2] == 0) {
- ++index;
- }
- if (nbBytes != data[index + 2]) {
- printf("FAILED\n");
- printf("Invalid size at bridge %i, data %i: %i != %i\n",
- i, index, nbBytes, data[index + 2]);
- for (i = 0; i < nbInput; ++i) {
- printf("Input %i: ", i);
- dump(inputData[i], data[i + 2], stdout);
- }
- for (i = 0; i < nbBridge; ++i) {
- printf("Bridge %i: ", i);
- dump(bridgeData[i], bridgeSize, stdout);
- }
- printf("Output %i: ", index);
- dump(outputData, nbBytes, stdout);
- return -1;
- }
- if (memcmp(outputData, inputData[index], data[index + 2]) != 0) {
- printf("FAILED\n");
- printf("output != input\n");
- for (i = 0; i < nbInput; ++i) {
- printf("Input %i: ", i);
- dump(inputData[i], data[i + 2], stdout);
- }
- for (i = 0; i < nbBridge; ++i) {
- printf("Bridge %i: ", i);
- dump(bridgeData[i], bridgeSize, stdout);
- }
- printf("Output %i: ", index);
- dump(outputData, nbBytes, stdout);
- }
- ++index;
- }
- }
-
- printf("SUCCESS\n");
-
- for (i = 0; i < nbInput; ++i) {
- if (data[i + 2] > 0)
- free(inputData[i]);
- }
- free(inputData);
- free(outputData);
- for (i = 0; i < nbBridge; ++i) {
- free(bridgeData[i]);
- }
- free(bridgeData);
-
- return -1;
-}
-
-
-int main(int argc, char* argv[])
-{
- int i;
- // test: bridgesize, nbinput [, input1, input2, ... ]
- const unsigned char complete[] = { 32, 1, 16 };
- const unsigned char split[] = { 32, 1, 48 };
- const unsigned char twice[] = {32, 2, 8, 4 };
- const unsigned char secondSplit[] = { 32, 2, 16, 16 };
- const unsigned char headerSplit[][4] = {
- { 32, 2, 23, 16 },
- { 32, 2, 22, 16 },
- { 32, 2, 21, 16 },
- { 32, 2, 20, 16 },
- { 32, 2, 19, 16 },
- { 32, 2, 18, 16 },
- { 32, 2, 17, 16 }
- };
- const unsigned char two[] = { 32, 3, 16, 0, 16 };
- const unsigned char doubleSplit[] = { 32, 2, 32, 32 };
- const unsigned char full[] = { 32, 2, 24, 12 };
- const unsigned char empty[] = { 32, 3, 0, 0, 5 };
-
-#ifdef _WIN32
- #ifdef _DEBUG
- bridgeVerbosity = argc - 1;
- #endif // DEBUG
-#else
- #ifdef DEBUG
- bridgeVerbosity = argc - 1;
- #endif // DEBUG
-#endif // _WIN32
-
- printf("Complete: ");
- test(complete);
- // printStats(stdout);
- fflush(stdout);
-
- printf("split: ");
- test(split);
- // printStats(stdout);
- fflush(stdout);
-
- printf("twice: ");
- test(twice);
- // printStats(stdout);
- fflush(stdout);
-
- printf("second split: ");
- test(secondSplit);
- // printStats(stdout);
- fflush(stdout);
-
- for (i = 0; i < sizeof(headerSplit) / sizeof(headerSplit[0]); ++i) {
- printf("headerSplit%i: ", i);
- test(headerSplit[i]);
- // printStats(stdout);
- fflush(stdout);
- }
-
- printf("two: ");
- test(two);
- // printStats(stdout);
- fflush(stdout);
-
- printf("doubleSplit: ");
- test(doubleSplit);
- // printStats(stdout);
- fflush(stdout);
-
- printf("full: ");
- test(full);
- // printStats(stdout);
- fflush(stdout);
-
- printf("empty: ");
- test(empty);
- // printStats(stdout);
- fflush(stdout);
-
- return 0;
-}
-
-#endif // BRIDGE_TEST
diff --git a/src/bridge.h b/src/bridge.h
deleted file mode 100644
index 0bae007..0000000
--- a/src/bridge.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
- Queen in Right of Canada (Communications Research Center Canada)
- */
-/*
- This file is part of ODR-DabMux.
-
- ODR-DabMux 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.
-
- ODR-DabMux 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 ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _BRIDGE
-#define _BRIDGE
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _WIN32
-# ifdef _DEBUG
- extern int bridgeVerbosity;
-# endif // _DEBUG
-#else
-# ifndef DEBUG
-# ifndef NDEBUG
-# define NDEBUG
-# endif
-# else
- extern int bridgeVerbosity;
-# endif // DEBUG
-#endif // _WIN32
-
-struct bridgeStats {
- unsigned long frames; // Number of frames analyzed
- unsigned long valids; // Nb of frames with a good magic number
- unsigned long invalids; // Nb of frames with a good magic number
- unsigned long bytes; // Nb of data bytes
- unsigned long packets; // Nb of packets found
- unsigned long errors;
- unsigned long missings;
- unsigned long dropped;
- unsigned long crc; // Nb of crc errors
- unsigned long overruns; // Nb of packet too big
-};
-
-
-struct bridgeHdr {
- unsigned short size;
- unsigned short seqNb;
- unsigned short crc;
-};
-
-
-struct bridgeInfo {
- // Tx
- int transmitted; // Nb bytes written
- int offset; // Offset of the next byte to write
- // Rx
- int received;
- int pos;
- int state;
- unsigned short lastSeq;
- unsigned short sync;
- char initSeq;
- // General
- struct bridgeHdr header;
- struct bridgeStats stats;
-};
-
-
-
-void dump(void* data, int size, FILE* stream);
-
-/*
- * Example of usae:
- * if (data.length == 0)
- * read(data)
- * while (writePacket() != 0)
- * read(read)
- * ...
- */
-int writePacket(void* dataIn, int sizeIn, void* dataOut, int sizeOut, struct bridgeInfo* info);
-
-int getPacket(void* dataIn, int sizeIn, void* dataOut, int sizeOut, struct bridgeInfo* info, char async);
-
-void bridgeInitInfo(struct bridgeInfo* info);
-struct bridgeStats getStats(struct bridgeInfo* info);
-void resetStats(struct bridgeInfo* info);
-void printStats(struct bridgeInfo* info, FILE* out);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _BRIDGE
diff --git a/src/dabInputBridgeUdp.cpp b/src/dabInputBridgeUdp.cpp
deleted file mode 100644
index fdf3d1f..0000000
--- a/src/dabInputBridgeUdp.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
- Research Center Canada)
- */
-/*
- This file is part of ODR-DabMux.
-
- ODR-DabMux 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.
-
- ODR-DabMux 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 ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "dabInputBridgeUdp.h"
-#include "dabInputUdp.h"
-#include "bridge.h"
-
-#ifdef HAVE_FORMAT_BRIDGE
-# ifdef HAVE_INPUT_UDP
-
-struct dabInputBridgeUdpData {
- dabInputUdpData* udpData;
- bridgeInfo* info;
-};
-
-
-struct dabInputOperations dabInputBridgeUdpOperations = {
- dabInputBridgeUdpInit,
- dabInputBridgeUdpOpen,
- dabInputSetbuf,
- NULL,
- NULL,
- NULL,
- dabInputBridgeUdpRead,
- dabInputSetbitrate,
- dabInputBridgeUdpClose,
- dabInputBridgeUdpClean,
- NULL
-};
-
-
-int dabInputBridgeUdpInit(void** args)
-{
- dabInputBridgeUdpData* input = new dabInputBridgeUdpData;
- dabInputUdpInit((void**)&input->udpData);
- input->info = new bridgeInfo;
- bridgeInitInfo(input->info);
- *args = input;
-
- return 0;
-}
-
-
-int dabInputBridgeUdpOpen(void* args, const char* inputName)
-{
- dabInputBridgeUdpData* input = (dabInputBridgeUdpData*)args;
-
- return dabInputUdpOpen(input->udpData, inputName);
-}
-
-
-int dabInputBridgeUdpRead(dabInputOperations* ops, void* args, void* buffer, int size)
-{
- int nbBytes = 0;
- dabInputBridgeUdpData* input = (dabInputBridgeUdpData*)args;
- dabInputFifoStats* stats = (dabInputFifoStats*)&input->udpData->stats;
-
- stats->frameRecords[stats->frameCount].curSize = 0;
- stats->frameRecords[stats->frameCount].maxSize = size;
-
- if (input->udpData->packet->getSize() == 0) {
- input->udpData->socket->receive(*input->udpData->packet);
- }
- while ((nbBytes = writePacket(input->udpData->packet->getData(),
- input->udpData->packet->getSize(), buffer, size,
- input->info))
- != 0) {
- stats->frameRecords[stats->frameCount].curSize = nbBytes;
- input->udpData->socket->receive(*input->udpData->packet);
- }
-
- if (input->udpData->packet->getSize() != 0) {
- stats->frameRecords[stats->frameCount].curSize = size;
- }
-
- if (++stats->frameCount == NB_RECORDS) {
- etiLog.log(info, "Data subchannel usage: (%i)",
- stats->id);
- for (int i = 0; i < stats->frameCount; ++i) {
- etiLog.log(info, " %i/%i",
- stats->frameRecords[i].curSize,
- stats->frameRecords[i].maxSize);
- }
- etiLog.log(info, "\n");
- stats->frameCount = 0;
- }
- return size;
-}
-
-
-int dabInputBridgeUdpClose(void* args)
-{
- dabInputBridgeUdpData* input = (dabInputBridgeUdpData*)args;
-
- return dabInputUdpClose(input->udpData);
-}
-
-
-int dabInputBridgeUdpClean(void** args)
-{
- dabInputBridgeUdpData* input = (dabInputBridgeUdpData*)(*args);
- dabInputUdpClean((void**)&input->udpData);
- delete input->info;
- delete input;
- return 0;
-}
-
-
-# endif // HAVE_INPUT_UDP
-#endif // HAVE_FORMAT_BRIDGE
-
diff --git a/src/dabInputBridgeUdp.h b/src/dabInputBridgeUdp.h
deleted file mode 100644
index ed00952..0000000
--- a/src/dabInputBridgeUdp.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
- Research Center Canada)
- */
-/*
- This file is part of ODR-DabMux.
-
- ODR-DabMux 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.
-
- ODR-DabMux 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 ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef DAB_INPUT_BRIDGE_UDP_H
-#define DAB_INPUT_BRIDGE_UDP_H
-
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include "dabInput.h"
-
-
-#ifdef HAVE_FORMAT_BRIDGE
-# ifdef HAVE_INPUT_UDP
-
-
-extern struct dabInputOperations dabInputBridgeUdpOperations;
-
-int dabInputBridgeUdpInit(void** args);
-int dabInputBridgeUdpOpen(void* args, const char* inputName);
-int dabInputBridgeUdpRead(dabInputOperations* ops, void* args, void* buffer, int size);
-int dabInputBridgeUdpClose(void* args);
-int dabInputBridgeUdpClean(void** args);
-
-
-# endif
-#endif
-
-
-#endif // DAB_INPUT_BRIDGE_UDP_H
diff --git a/src/utils.cpp b/src/utils.cpp
index f0df772..5e7cf7a 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -124,9 +124,6 @@ void header_message()
#if defined(HAVE_FORMAT_RAW)
" raw" <<
#endif
-#if defined(HAVE_FORMAT_BRIDGE)
- " bridge" <<
-#endif
#if defined(HAVE_FORMAT_MPEG)
" mpeg" <<
#endif