From 56632c4b32abc705f613475c3b78ae7a5dd4a3d2 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 13 Oct 2005 09:08:32 +0000 Subject: *** empty log message *** --- src/mov_encoder_writer.cc | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'src/mov_encoder_writer.cc') 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; -- cgit v1.2.3