X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shell%2Fserver.cpp;h=5d9bf906f80ffbf8e496804fa7c1b7a1b1030ff7;hb=ac7b3acb915f90de6b224e54a2240023fc221e5a;hp=b9521a9ff48ac3775fa95eacfe6d4ddef9f8afdb;hpb=c254e5c28f73b6ff36cb4e3dc0cc47d046e050b3;p=casparcg diff --git a/shell/server.cpp b/shell/server.cpp index b9521a9ff..5d9bf906f 100644 --- a/shell/server.cpp +++ b/shell/server.cpp @@ -24,7 +24,10 @@ #include #include -#include +#include +#include +#include +#include #include #include @@ -48,7 +51,6 @@ #include #include -#include #include #include #include @@ -61,25 +63,28 @@ using namespace protocol; struct server::implementation : boost::noncopyable { std::vector> async_servers_; - std::vector> channels_; + std::vector> channels_; + ogl_device ogl_; implementation() { - init_ffmpeg(); - init_bluefish(); - init_decklink(); - init_flash(); - init_oal(); - init_ogl(); - init_silverlight(); - init_image(); + ffmpeg::init(); + bluefish::init(); + decklink::init(); + flash::init(); + oal::init(); + ogl::init(); + //init_silverlight(); + image::init(); setup_channels(env::properties()); setup_controllers(env::properties()); } ~implementation() - { + { + ffmpeg::uninit(); + async_servers_.clear(); channels_.clear(); } @@ -89,11 +94,11 @@ struct server::implementation : boost::noncopyable using boost::property_tree::ptree; BOOST_FOREACH(auto& xml_channel, pt.get_child("configuration.channels")) { - auto format_desc = video_format_desc::get(widen(xml_channel.second.get("videomode", "PAL"))); + auto format_desc = video_format_desc::get(widen(xml_channel.second.get("video-mode", "PAL"))); if(format_desc.format == video_format::invalid) BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Invalid video-mode.")); - channels_.push_back(channel(channels_.size(), format_desc)); + channels_.push_back(video_channel(channels_.size(), format_desc, ogl_)); int index = 0; BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child("consumers")) @@ -101,16 +106,18 @@ struct server::implementation : boost::noncopyable try { const std::string name = xml_consumer.first; - if(name == "ogl") - channels_.back()->consumer()->add(index++, create_ogl_consumer(xml_consumer.second)); + if(name == "screen") + channels_.back()->output()->add(index++, ogl::create_consumer(xml_consumer.second)); else if(name == "bluefish") - channels_.back()->consumer()->add(index++, create_bluefish_consumer(xml_consumer.second)); + channels_.back()->output()->add(index++, bluefish::create_consumer(xml_consumer.second)); else if(name == "decklink") - channels_.back()->consumer()->add(index++, create_decklink_consumer(xml_consumer.second)); + channels_.back()->output()->add(index++, decklink::create_consumer(xml_consumer.second)); + //else if(name == "file") + // channels_.back()->output()->add(index++, create_ffmpeg_consumer(xml_consumer.second)); else if(name == "audio") - channels_.back()->consumer()->add(index++, oal_consumer()); - else - BOOST_THROW_EXCEPTION(caspar_exception() << arg_name_info(name) << msg_info("Invalid consumer.")); + channels_.back()->output()->add(index++, oal::create_consumer()); + else if(name != "") + CASPAR_LOG(warning) << "Invalid consumer: " << widen(name); } catch(...) { @@ -138,7 +145,7 @@ struct server::implementation : boost::noncopyable async_servers_.push_back(asyncbootstrapper); } else - BOOST_THROW_EXCEPTION(caspar_exception() << arg_name_info(name) << msg_info("Invalid controller.")); + CASPAR_LOG(warning) << "Invalid controller: " << widen(name); } catch(...) { @@ -162,7 +169,7 @@ struct server::implementation : boost::noncopyable server::server() : impl_(new implementation()){} -const std::vector> server::get_channels() const +const std::vector> server::get_channels() const { return impl_->channels_; }