X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shell%2Fserver.cpp;h=dabcccb921e48c49b2cb5e6d47327b91106df0e8;hb=4adbd499aa7106aa49b58a4b62afc7f0cfdb6c80;hp=4d9992a41fcf768bfaf81d69233e06d009bedd62;hpb=43988edef8ab4f75e5d3b1eff4c1d60fd71857e6;p=casparcg diff --git a/shell/server.cpp b/shell/server.cpp index 4d9992a41..dabcccb92 100644 --- a/shell/server.cpp +++ b/shell/server.cpp @@ -24,7 +24,10 @@ #include #include -#include +#include +#include +#include +#include #include #include @@ -58,10 +61,12 @@ namespace caspar { using namespace core; using namespace protocol; + struct server::implementation : boost::noncopyable { std::vector> async_servers_; - std::vector> channels_; + std::vector> channels_; + ogl_device ogl_; implementation() { @@ -71,7 +76,7 @@ struct server::implementation : boost::noncopyable init_flash(); init_oal(); init_ogl(); - init_silverlight(); + //init_silverlight(); init_image(); setup_channels(env::properties()); @@ -79,7 +84,9 @@ struct server::implementation : boost::noncopyable } ~implementation() - { + { + uninit_ffmpeg(); + async_servers_.clear(); channels_.clear(); } @@ -89,11 +96,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 +108,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++, create_ogl_consumer(xml_consumer.second)); else if(name == "bluefish") - channels_.back()->consumer()->add(index++, create_bluefish_consumer(xml_consumer.second)); + channels_.back()->output()->add(index++, create_bluefish_consumer(xml_consumer.second)); else if(name == "decklink") - channels_.back()->consumer()->add(index++, create_decklink_consumer(xml_consumer.second)); + channels_.back()->output()->add(index++, create_decklink_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 - CASPAR_LOG(warning) << "Invalid consumer: " << widen(name); + channels_.back()->output()->add(index++, make_safe()); + else if(name != "") + CASPAR_LOG(warning) << "Invalid consumer: " << widen(name); } catch(...) { @@ -162,7 +171,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_; }