X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shell%2Fserver.cpp;h=5d9bf906f80ffbf8e496804fa7c1b7a1b1030ff7;hb=ac7b3acb915f90de6b224e54a2240023fc221e5a;hp=204e54dd33d5d94152edbc5181cd5f95b9f69b80;hpb=ca38969bf0f0f4137ee96f8d772d575c71593e19;p=casparcg diff --git a/shell/server.cpp b/shell/server.cpp index 204e54dd3..5d9bf906f 100644 --- a/shell/server.cpp +++ b/shell/server.cpp @@ -25,7 +25,9 @@ #include #include -#include +#include +#include +#include #include #include @@ -49,7 +51,6 @@ #include #include -#include #include #include #include @@ -59,30 +60,31 @@ namespace caspar { using namespace core; using namespace protocol; - struct server::implementation : boost::noncopyable { std::vector> async_servers_; - std::vector> channels_; - safe_ptr ogl_; + std::vector> channels_; + ogl_device ogl_; implementation() { - init_ffmpeg(); - init_bluefish(); - init_decklink(); - init_flash(); - init_oal(); - init_ogl(); + ffmpeg::init(); + bluefish::init(); + decklink::init(); + flash::init(); + oal::init(); + ogl::init(); //init_silverlight(); - init_image(); + image::init(); setup_channels(env::properties()); setup_controllers(env::properties()); } ~implementation() - { + { + ffmpeg::uninit(); + async_servers_.clear(); channels_.clear(); } @@ -92,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, ogl_)); + channels_.push_back(video_channel(channels_.size(), format_desc, ogl_)); int index = 0; BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child("consumers")) @@ -104,16 +106,16 @@ 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)); - else if(name == "file") - channels_.back()->consumer()->add(index++, create_ffmpeg_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()); + channels_.back()->output()->add(index++, oal::create_consumer()); else if(name != "") CASPAR_LOG(warning) << "Invalid consumer: " << widen(name); } @@ -167,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_; }