]> git.sesse.net Git - casparcg/blobdiff - shell/server.cpp
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / shell / server.cpp
index c83565b208ec82ad1aecfea2fbfdaa669e911f00..b121b809819c43776d951fd00d19f20f75717842 100644 (file)
@@ -25,7 +25,9 @@
 #include <common/utility/string.h>\r
 \r
 #include <core/mixer/gpu/ogl_device.h>\r
-#include <core/channel.h>\r
+#include <core/video_channel.h>\r
+#include <core/producer/stage.h>\r
+#include <core/consumer/output.h>\r
 \r
 #include <modules/bluefish/bluefish.h>\r
 #include <modules/decklink/decklink.h>\r
@@ -49,7 +51,6 @@
 \r
 #include <boost/algorithm/string.hpp>\r
 #include <boost/lexical_cast.hpp>\r
-#include <boost/filesystem.hpp>\r
 #include <boost/foreach.hpp>\r
 #include <boost/property_tree/ptree.hpp>\r
 #include <boost/property_tree/xml_parser.hpp>\r
@@ -59,11 +60,10 @@ namespace caspar {
 using namespace core;\r
 using namespace protocol;\r
 \r
-\r
 struct server::implementation : boost::noncopyable\r
 {\r
        std::vector<safe_ptr<IO::AsyncEventServer>> async_servers_;     \r
-       std::vector<safe_ptr<channel>>                          channels_;\r
+       std::vector<safe_ptr<video_channel>>            channels_;\r
        ogl_device                                                                      ogl_;\r
 \r
        implementation()                                                                                                \r
@@ -82,7 +82,9 @@ struct server::implementation : boost::noncopyable
        }\r
 \r
        ~implementation()\r
-       {                               \r
+       {               \r
+               uninit_ffmpeg();\r
+\r
                async_servers_.clear();\r
                channels_.clear();\r
        }\r
@@ -92,11 +94,11 @@ struct server::implementation : boost::noncopyable
                using boost::property_tree::ptree;\r
                BOOST_FOREACH(auto& xml_channel, pt.get_child("configuration.channels"))\r
                {               \r
-                       auto format_desc = video_format_desc::get(widen(xml_channel.second.get("videomode", "PAL")));           \r
+                       auto format_desc = video_format_desc::get(widen(xml_channel.second.get("video-mode", "PAL")));          \r
                        if(format_desc.format == video_format::invalid)\r
                                BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Invalid video-mode."));\r
                        \r
-                       channels_.push_back(channel(channels_.size(), format_desc, ogl_));\r
+                       channels_.push_back(video_channel(channels_.size(), format_desc, ogl_));\r
                        \r
                        int index = 0;\r
                        BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child("consumers"))\r
@@ -104,16 +106,16 @@ struct server::implementation : boost::noncopyable
                                try\r
                                {\r
                                        const std::string name = xml_consumer.first;\r
-                                       if(name == "ogl")\r
-                                               channels_.back()->consumer()->add(index++, create_ogl_consumer(xml_consumer.second));                                   \r
+                                       if(name == "screen")\r
+                                               channels_.back()->output()->add(index++, create_ogl_consumer(xml_consumer.second));                                     \r
                                        else if(name == "bluefish")                                     \r
-                                               channels_.back()->consumer()->add(index++, create_bluefish_consumer(xml_consumer.second));                                      \r
+                                               channels_.back()->output()->add(index++, create_bluefish_consumer(xml_consumer.second));                                        \r
                                        else if(name == "decklink")                                     \r
-                                               channels_.back()->consumer()->add(index++, create_decklink_consumer(xml_consumer.second));                              \r
-                                       else if(name == "file")                                 \r
-                                               channels_.back()->consumer()->add(index++, create_ffmpeg_consumer(xml_consumer.second));                                                \r
+                                               channels_.back()->output()->add(index++, create_decklink_consumer(xml_consumer.second));                                \r
+                                       //else if(name == "file")                                       \r
+                                       //      channels_.back()->output()->add(index++, create_ffmpeg_consumer(xml_consumer.second));                                          \r
                                        else if(name == "audio")\r
-                                               channels_.back()->consumer()->add(index++, oal_consumer());             \r
+                                               channels_.back()->output()->add(index++, create_oal_consumer());                \r
                                        else if(name != "<xmlcomment>")\r
                                                CASPAR_LOG(warning) << "Invalid consumer: " << widen(name);     \r
                                }\r
@@ -167,7 +169,7 @@ struct server::implementation : boost::noncopyable
 \r
 server::server() : impl_(new implementation()){}\r
 \r
-const std::vector<safe_ptr<channel>> server::get_channels() const\r
+const std::vector<safe_ptr<video_channel>> server::get_channels() const\r
 {\r
        return impl_->channels_;\r
 }\r