summaryrefslogtreecommitdiff
path: root/src/mov_encoder_writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mov_encoder_writer.cc')
-rw-r--r--src/mov_encoder_writer.cc32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/mov_encoder_writer.cc b/src/mov_encoder_writer.cc
index 7f3bfec..d533b81 100644
--- a/src/mov_encoder_writer.cc
+++ b/src/mov_encoder_writer.cc
@@ -46,7 +46,9 @@ using namespace std;
#include "multiplexer.h"
-MovEncoderWriter::MovEncoderWriter(const char* cpr,
+#include "multicast_configuration.h"
+
+MovEncoderWriter::MovEncoderWriter(const char *clientip, const char* cpr,
ThreadSafeQueuePriority *video_q,
ThreadSafeQueuePriority *audio_q,
Info *i)
@@ -57,6 +59,7 @@ MovEncoderWriter::MovEncoderWriter(const char* cpr,
// Create path and filename
char fname[256];
string *server_root;
+ string *mcconfig_file;
char birthmonth[3];
char date[32];
@@ -81,15 +84,24 @@ MovEncoderWriter::MovEncoderWriter(const char* cpr,
file = new File(fname, "mpg", info);
- if(config->readBool("server_multicast")) {
- string *addr = config->readString("server_multicast_addr");
- int port = config->readInt("server_multicast_port");
- info->info("Enabling multicast %s : %d", addr->c_str(), port);
- multicast = new Multicast(info, (char*)addr->c_str(), port);
- } else {
- info->info("Disabling multicast");
- multicast = NULL;
- }
+ // Get multicast configuration filename
+ mcconfig_file = config->readString("multicast_configurationfile");
+
+ MulticastConfiguration mcconfig(info, (char*)mcconfig_file->c_str());
+
+ mcastconf_t mcclientconf = mcconfig.getConf((char*)clientip);
+
+ info->info("Client: %s - Enabled: %s - Addr: %s - Port: %d",
+ mcclientconf.client.c_str(),
+ mcclientconf.enabled?"Yes\0":"No\0",
+ mcclientconf.addr.c_str(),
+ mcclientconf.port);
+
+
+ multicast = NULL;
+ if(mcclientconf.enabled) multicast = new Multicast(info,
+ (char*)mcclientconf.addr.c_str(),
+ mcclientconf.port);
video_queue = video_q;
audio_queue = audio_q;