diff options
author | deva <deva> | 2005-10-13 09:08:32 +0000 |
---|---|---|
committer | deva <deva> | 2005-10-13 09:08:32 +0000 |
commit | 56632c4b32abc705f613475c3b78ae7a5dd4a3d2 (patch) | |
tree | 1e64789daa4111a30b20b99405c9cc15c0da98c7 /src/mov_encoder_writer.cc | |
parent | 1d30dc5da0c148982032a2b5a5bdece10b3e80ae (diff) |
*** empty log message ***
Diffstat (limited to 'src/mov_encoder_writer.cc')
-rw-r--r-- | src/mov_encoder_writer.cc | 32 |
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; |