summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/simplertp.cc33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/simplertp.cc b/src/simplertp.cc
index 16b60ed..964c850 100644
--- a/src/simplertp.cc
+++ b/src/simplertp.cc
@@ -26,20 +26,43 @@
*/
#include <QApplication>
+#include <QSettings>
+
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QString v4ldev = "/dev/video0";
- QString adev = "hw:1,0";
+ if(argc < 2) {
+ printf("Usage: %s configfile\n", argv[0]);
+ return 1;
+ }
+
+ QSettings settings(argv[1], QSettings::IniFormat);
+
+ settings.beginGroup("hardware");
+ QString v4ldev = settings.value("v4ldev", "/dev/video0").toString();
+ QString adev = settings.value("adev", "hw:0,0").toString();
+ settings.endGroup();
+
+ settings.beginGroup("crypto");
+ QString key = settings.value("key").toString();
+ settings.endGroup();
+
+ settings.beginGroup("peers");
+ int num_peers = settings.value("num_peers", "0").toInt();
+ for(int peer = 1; peer < num_peers + 1; peer++) {
+ QString addr = settings.value("addr" + QString::number(peer)).toString();
+ quint16 port = settings.value("port" + QString::number(peer)).toInt();
+ unsigned int ssrc = settings.value("ssrc" + QString::number(peer)).toInt();
+ // Create
+ }
+ settings.endGroup();
+
QHostAddress addr("127.0.0.1");
quint16 port = 10000;
- if(argc > 1) v4ldev = argv[1];
- if(argc > 2) adev = argv[2];
-
MainWindow wnd(v4ldev, adev, addr, port);
wnd.show();