aboutsummaryrefslogtreecommitdiffstats
path: root/src/odr-sourcecompanion.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-25 15:25:55 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-25 15:25:55 +0100
commite9e1b673a111366ad9071933f3469891a735243a (patch)
tree0c82a2031a82b7d56537ff23f8084c42382ecbd7 /src/odr-sourcecompanion.cpp
parent7ad4a211a9bcba9c78e6a41e0ad1f20460e8896e (diff)
downloadODR-SourceCompanion-e9e1b673a111366ad9071933f3469891a735243a.tar.gz
ODR-SourceCompanion-e9e1b673a111366ad9071933f3469891a735243a.tar.bz2
ODR-SourceCompanion-e9e1b673a111366ad9071933f3469891a735243a.zip
Add --identifier option to specify content of EDI ODRv TAG
Diffstat (limited to 'src/odr-sourcecompanion.cpp')
-rw-r--r--src/odr-sourcecompanion.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/odr-sourcecompanion.cpp b/src/odr-sourcecompanion.cpp
index b8c5547..b233e2c 100644
--- a/src/odr-sourcecompanion.cpp
+++ b/src/odr-sourcecompanion.cpp
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 2019 Matthias P. Braendli
+ * Copyright (C) 2020 Matthias P. Braendli
* Copyright (C) 2017 AVT GmbH - Fabien Vercasson
* Copyright (C) 2011 Martin Storsjo
*
@@ -89,6 +89,7 @@ void usage(const char* name) {
" --sbr Force the usage of SBR\n"
" --ps Force the usage of PS\n"
" Output and pad parameters:\n"
+ " --identifier=ID An identifier string that is sent in the ODRv EDI TAG. Max 32 characters length.\n"
" -o, --output=URI Output ZMQ uri. (e.g. 'tcp://localhost:9000')\n"
" If more than one ZMQ output is given, the socket\n"
" will be connected to all listed endpoints.\n"
@@ -151,6 +152,7 @@ int main(int argc, char *argv[])
{"rate", required_argument, 0, 'r'},
{"stats", required_argument, 0, 'S'},
{"secret-key", required_argument, 0, 'k'},
+ {"identifier", required_argument, 0, 3 },
{"input-uri", required_argument, 0, 'I'},
{"control-uri", required_argument, 0, 6 },
{"timeout", required_argument, 0, 7 },
@@ -185,6 +187,8 @@ int main(int argc, char *argv[])
bool allowSBR = false;
bool allowPS = false;
+ string identifier;
+
vector<string> edi_output_uris;
bool tist_enabled = false;
uint32_t tist_delay_ms = 0;
@@ -209,6 +213,16 @@ int main(int argc, char *argv[])
allowPS = true;
allowSBR = true;
break;
+ case 3: // Identifier for in-band version information
+ identifier = optarg;
+ /* The 32 character length restriction is arbitrary, but guarantees
+ * that the EDI packet will not grow too large */
+ if (identifier.size() > 32) {
+ fprintf(stderr, "Output Identifier too long!\n");
+ usage(argv[0]);
+ return 1;
+ }
+ break;
case 'b':
bitrate = stoi(optarg);
break;
@@ -323,6 +337,18 @@ int main(int argc, char *argv[])
}
}
+ if (not edi_output_uris.empty()) {
+ stringstream ss;
+ ss << PACKAGE_NAME << " " <<
+#if defined(GITVERSION)
+ GITVERSION <<
+#else
+ PACKAGE_VERSION <<
+#endif
+ " " << identifier;
+ edi_output.set_odr_version_tag(ss.str());
+ }
+
if (padlen != 0) {
int flags;
if (mkfifo(pad_fifo, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH) != 0) {