]> git.sesse.net Git - casparcg/commitdiff
2.0.2: Changed ADD syntax. sub-index no longer required. e.g. ADD 1 SCREEN, REMOVE...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 1 Dec 2011 19:40:49 +0000 (19:40 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 1 Dec 2011 19:40:49 +0000 (19:40 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.2@1752 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

17 files changed:
core/consumer/frame_consumer.cpp
core/consumer/frame_consumer.h
core/consumer/output.cpp
core/consumer/output.h
modules/bluefish/consumer/bluefish_consumer.cpp
modules/decklink/consumer/decklink_consumer.cpp
modules/decklink/interop/DeckLinkAPI_h.h
modules/decklink/interop/DeckLinkAPI_i.c
modules/ffmpeg/consumer/ffmpeg_consumer.cpp
modules/ffmpeg/consumer/ffmpeg_consumer.h
modules/ffmpeg/ffmpeg.cpp
modules/image/consumer/image_consumer.cpp
modules/oal/consumer/oal_consumer.cpp
modules/ogl/consumer/ogl_consumer.cpp
protocol/amcp/AMCPCommandsImpl.cpp
shell/casparcg.config
shell/server.cpp

index 35f651b8f602e54aaf9902af6fff3bc401dfae4d..11eb115eed5d5ff18ad28ee8f08cb0f46a4ff9d2 100644 (file)
@@ -76,11 +76,11 @@ public:
        {\r
        }\r
        \r
-       virtual void initialize(const video_format_desc& format_desc, int channel_index, int sub_index) override\r
+       virtual void initialize(const video_format_desc& format_desc, int channel_index) override\r
        {\r
                audio_cadence_  = format_desc.audio_cadence;\r
                sync_buffer_    = boost::circular_buffer<size_t>(format_desc.audio_cadence.size());\r
-               consumer_->initialize(format_desc, channel_index, sub_index);\r
+               consumer_->initialize(format_desc, channel_index);\r
        }\r
 \r
        virtual bool send(const safe_ptr<read_frame>& frame) override\r
@@ -119,6 +119,11 @@ public:
        {\r
                return consumer_->buffer_depth();\r
        }\r
+\r
+       virtual int index() const override\r
+       {\r
+               return consumer_->index();\r
+       }\r
 };\r
 \r
 safe_ptr<frame_consumer> create_consumer_cadence_guard(safe_ptr<frame_consumer>&& consumer)\r
index e4aafca2b8aab4588391f994a95ae14f499d82d4..3d8fb1f93078193220b9fbf86fb45aa91ced856e 100644 (file)
@@ -37,20 +37,22 @@ struct frame_consumer : boost::noncopyable
        virtual ~frame_consumer() {}\r
        \r
        virtual bool send(const safe_ptr<read_frame>& frame) = 0;\r
-       virtual void initialize(const video_format_desc& format_desc, int channel_index, int sub_index) = 0;\r
+       virtual void initialize(const video_format_desc& format_desc, int channel_index) = 0;\r
        virtual std::wstring print() const = 0;\r
        virtual bool has_synchronization_clock() const {return true;}\r
        virtual size_t buffer_depth() const = 0;\r
+       virtual int index() const = 0;\r
 \r
        static const safe_ptr<frame_consumer>& empty()\r
        {\r
                struct empty_frame_consumer : public frame_consumer\r
                {\r
                        virtual bool send(const safe_ptr<read_frame>&) override {return false;}\r
-                       virtual void initialize(const video_format_desc&, int, int) override{}\r
+                       virtual void initialize(const video_format_desc&, int) override{}\r
                        virtual std::wstring print() const override {return L"empty";}\r
                        virtual bool has_synchronization_clock() const override {return false;}\r
                        virtual size_t buffer_depth() const override {return 0;};\r
+                       virtual int index() const{return -1;}\r
                };\r
                static safe_ptr<frame_consumer> consumer = make_safe<empty_frame_consumer>();\r
                return consumer;\r
index a28702c266fe8104e44a76e3742a69ebf3bc9e99..4fc9520772f43019e0ae8d383dfb105e139c03d3 100644 (file)
@@ -69,19 +69,19 @@ public:
                graph_->set_color("consume-time", diagnostics::color(1.0f, 0.4f, 0.0f));\r
        }       \r
        \r
-       void add(int index, safe_ptr<frame_consumer>&& consumer)\r
+       void add(safe_ptr<frame_consumer>&& consumer)\r
        {               \r
                executor_.invoke([&]\r
                {\r
-                       consumers_.erase(index);\r
+                       consumers_.erase(consumer->index());\r
                }, high_priority);\r
 \r
                consumer = create_consumer_cadence_guard(std::move(consumer));\r
-               consumer->initialize(format_desc_, channel_index_, index);\r
+               consumer->initialize(format_desc_, channel_index_);\r
 \r
                executor_.invoke([&]\r
                {\r
-                       consumers_.insert(std::make_pair(index, consumer));\r
+                       consumers_.insert(std::make_pair(consumer->index(), consumer));\r
 \r
                        CASPAR_LOG(info) << print() << L" " << consumer->print() << L" Added.";\r
                }, high_priority);\r
@@ -109,7 +109,7 @@ public:
                        {                                               \r
                                try\r
                                {\r
-                                       it->second->initialize(format_desc_, channel_index_, it->first);\r
+                                       it->second->initialize(format_desc_, channel_index_);\r
                                        ++it;\r
                                }\r
                                catch(...)\r
@@ -191,7 +191,7 @@ public:
                                                CASPAR_LOG_CURRENT_EXCEPTION();\r
                                                try\r
                                                {\r
-                                                       consumer->initialize(format_desc_, channel_index_, it->first);\r
+                                                       consumer->initialize(format_desc_, channel_index_);\r
                                                        if(consumer->send(frame))\r
                                                                ++it;\r
                                                        else\r
@@ -222,7 +222,7 @@ public:
 };\r
 \r
 output::output(const safe_ptr<diagnostics::graph>& graph, const video_format_desc& format_desc, int channel_index) : impl_(new implementation(graph, format_desc, channel_index)){}\r
-void output::add(int index, safe_ptr<frame_consumer>&& consumer){impl_->add(index, std::move(consumer));}\r
+void output::add(safe_ptr<frame_consumer>&& consumer){impl_->add(std::move(consumer));}\r
 void output::remove(int index){impl_->remove(index);}\r
 void output::send(const std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>& frame) {impl_->send(frame); }\r
 void output::set_video_format_desc(const video_format_desc& format_desc){impl_->set_video_format_desc(format_desc);}\r
index 2305a974a2b15cc9dc6635779d225ef7835f9d19..3f9f638b022a730ff45c87daf24d6351849a58bb 100644 (file)
@@ -40,7 +40,7 @@ public:
 \r
        // output\r
 \r
-       void add(int index, safe_ptr<frame_consumer>&& consumer);\r
+       void add(safe_ptr<frame_consumer>&& consumer);\r
        void remove(int index);\r
        \r
        void set_video_format_desc(const video_format_desc& format_desc);\r
index 875be4583f6a9c4a4e1c48b29d5847211eb8ab40..b3f859a8acb460523d123031f1031065e32569e7 100644 (file)
@@ -53,7 +53,6 @@ struct bluefish_consumer : boost::noncopyable
        const unsigned int                                      device_index_;\r
        const core::video_format_desc           format_desc_;\r
        const int                                                       channel_index_;\r
-       const int                                                       sub_index_;\r
 \r
        const std::wstring                                      model_name_;\r
 \r
@@ -72,12 +71,11 @@ struct bluefish_consumer : boost::noncopyable
                \r
        executor                                                        executor_;\r
 public:\r
-       bluefish_consumer(const core::video_format_desc& format_desc, unsigned int device_index, bool embedded_audio, bool key_only, int channel_index, int sub_index\r
+       bluefish_consumer(const core::video_format_desc& format_desc, unsigned int device_index, bool embedded_audio, bool key_only, int channel_index) \r
                : blue_(create_blue(device_index))\r
                , device_index_(device_index)\r
                , format_desc_(format_desc) \r
                , channel_index_(channel_index)\r
-               , sub_index_(sub_index)\r
                , model_name_(get_card_desc(*blue_))\r
                , vid_fmt_(get_video_mode(*blue_, format_desc))\r
                , embedded_audio_(embedded_audio)\r
@@ -286,7 +284,7 @@ public:
        \r
        std::wstring print() const\r
        {\r
-               return model_name_ + L" [" + boost::lexical_cast<std::wstring>(channel_index_) + L"-" + boost::lexical_cast<std::wstring>(sub_index_) + L"|device " + \r
+               return model_name_ + L" [" + boost::lexical_cast<std::wstring>(channel_index_) + L"|device " + \r
                        boost::lexical_cast<std::wstring>(device_index_) + L"|" +  format_desc_.name + L"]";\r
        }\r
 };\r
@@ -319,9 +317,9 @@ public:
 \r
        // frame_consumer\r
        \r
-       virtual void initialize(const core::video_format_desc& format_desc, int channel_index, int sub_index) override\r
+       virtual void initialize(const core::video_format_desc& format_desc, int channel_index) override\r
        {\r
-               consumer_.reset(new bluefish_consumer(format_desc, device_index_, embedded_audio_, key_only_, channel_index, sub_index));\r
+               consumer_.reset(new bluefish_consumer(format_desc, device_index_, embedded_audio_, key_only_, channel_index));\r
                audio_cadence_ = format_desc.audio_cadence;\r
                CASPAR_LOG(info) << print() << L" Successfully Initialized.";   \r
        }\r
@@ -344,6 +342,11 @@ public:
        {\r
                return 1;\r
        }\r
+       \r
+       virtual int index() const override\r
+       {\r
+               return 400 + device_index_;\r
+       }\r
 };     \r
 \r
 safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
index e748a2b3885b8b26baf205c5d79f116ac03acbd5..d6bf924b24f371f15f41e5fea06c2b9fcc8b7751 100644 (file)
@@ -138,7 +138,6 @@ public:
 struct decklink_consumer : public IDeckLinkVideoOutputCallback, public IDeckLinkAudioOutputCallback, boost::noncopyable\r
 {              \r
        const int                                                       channel_index_;\r
-       const int                                                       sub_index_;\r
        const configuration                                     config_;\r
 \r
        CComPtr<IDeckLink>                                      decklink_;\r
@@ -169,9 +168,8 @@ struct decklink_consumer : public IDeckLinkVideoOutputCallback, public IDeckLink
        boost::timer tick_timer_;\r
 \r
 public:\r
-       decklink_consumer(const configuration& config, const core::video_format_desc& format_desc, int channel_index, int sub_index\r
+       decklink_consumer(const configuration& config, const core::video_format_desc& format_desc, int channel_index) \r
                : channel_index_(channel_index)\r
-               , sub_index_(sub_index)\r
                , config_(config)\r
                , decklink_(get_device(config.device_index))\r
                , output_(decklink_)\r
@@ -428,7 +426,7 @@ public:
        \r
        std::wstring print() const\r
        {\r
-               return model_name_ + L" [" + boost::lexical_cast<std::wstring>(channel_index_) + L"-" + boost::lexical_cast<std::wstring>(sub_index_) + L"|device " +\r
+               return model_name_ + L" [" + boost::lexical_cast<std::wstring>(channel_index_) + L"|device " +\r
                        boost::lexical_cast<std::wstring>(config_.device_index) + L"|" +  format_desc_.name + L"]";\r
        }\r
 };\r
@@ -458,9 +456,9 @@ public:
 \r
        // frame_consumer\r
        \r
-       virtual void initialize(const core::video_format_desc& format_desc, int channel_index, int sub_index) override\r
+       virtual void initialize(const core::video_format_desc& format_desc, int channel_index) override\r
        {\r
-               context_.reset([&]{return new decklink_consumer(config_, format_desc, channel_index, sub_index);});             \r
+               context_.reset([&]{return new decklink_consumer(config_, format_desc, channel_index);});                \r
                audio_cadence_ = format_desc.audio_cadence;             \r
 \r
                CASPAR_LOG(info) << print() << L" Successfully Initialized.";   \r
@@ -484,6 +482,11 @@ public:
        {\r
                return config_.buffer_depth;\r
        }\r
+\r
+       virtual int index() const override\r
+       {\r
+               return 300 + config_.device_index;\r
+       }\r
 };     \r
 \r
 safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params) \r
index 1ea2456c46832218c815f056794ea13dd8a9a659..67c772703ea9e3660efea16a3f292642f64cf63a 100644 (file)
@@ -4,7 +4,7 @@
 \r
 \r
  /* File created by MIDL compiler version 7.00.0555 */\r
-/* at Wed Nov 30 19:17:46 2011\r
+/* at Thu Dec 01 20:20:22 2011\r
  */\r
 /* Compiler settings for interop\DeckLinkAPI.idl:\r
     Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
index 45cfc15768bef312bd92fb109326fb90d00e3cdc..1e212c1502eafa65efb7f98b19c4a540c6c58f0b 100644 (file)
@@ -6,7 +6,7 @@
 \r
 \r
  /* File created by MIDL compiler version 7.00.0555 */\r
-/* at Wed Nov 30 19:17:46 2011\r
+/* at Thu Dec 01 20:20:22 2011\r
  */\r
 /* Compiler settings for interop\DeckLinkAPI.idl:\r
     Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
index 8a5fc7d6d3112ffbc5bc4ed1ea836807221b7523..129d31917020140110d67112def8d05ed7a60420 100644 (file)
@@ -90,7 +90,7 @@ struct ffmpeg_consumer : boost::noncopyable
        \r
 public:\r
        ffmpeg_consumer(const std::string& filename, const core::video_format_desc& format_desc, const std::string& codec, const std::string& options)\r
-               : filename_(filename + ".mov")\r
+               : filename_(filename)\r
                , video_outbuf_(1920*1080*8)\r
                , oc_(avformat_alloc_context(), av_free)\r
                , format_desc_(format_desc)\r
@@ -98,6 +98,9 @@ public:
                , file_write_executor_(print() + L"/output")\r
                , frame_number_(0)\r
        {\r
+               // TODO: Ask stakeholders about case where file already exists.\r
+               boost::filesystem2::remove(boost::filesystem2::wpath(env::media_folder() + widen(filename))); // Delete the file if it exists\r
+\r
                graph_->add_guide("frame-time", 0.5);\r
                graph_->set_color("frame-time", diagnostics::color(0.1f, 1.0f, 0.1f));\r
                graph_->set_color("write-time", diagnostics::color(0.5f, 0.5f, 0.1f));\r
@@ -396,7 +399,7 @@ public:
        {\r
        }\r
        \r
-       virtual void initialize(const core::video_format_desc& format_desc, int, int)\r
+       virtual void initialize(const core::video_format_desc& format_desc, int)\r
        {\r
                consumer_.reset();\r
                consumer_.reset(new ffmpeg_consumer(narrow(filename_), format_desc, codec_, options_));\r
@@ -422,15 +425,20 @@ public:
        {\r
                return 1;\r
        }\r
+\r
+       virtual int index() const override\r
+       {\r
+               return 200;\r
+       }\r
 };     \r
 \r
-safe_ptr<core::frame_consumer> create_ffmpeg_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
 {\r
-       if(params.size() < 2 || params[0] != L"FILE")\r
+       if(params.size() < 1 || params[0] != L"FILE")\r
                return core::frame_consumer::empty();\r
        \r
-       // TODO: Ask stakeholders about case where file already exists.\r
-       boost::filesystem::remove(boost::filesystem::wpath(env::media_folder() + params[1])); // Delete the file if it exists\r
+       auto filename = (params.size() > 1 ? params[1] : L"");\r
+\r
        bool key_only = std::find(params.begin(), params.end(), L"KEY_ONLY") != params.end();\r
 \r
        std::string codec = "libx264";\r
@@ -449,10 +457,10 @@ safe_ptr<core::frame_consumer> create_ffmpeg_consumer(const std::vector<std::wst
        if(options_it != params.end() && options_it++ != params.end())\r
                options = narrow(*options_it);\r
 \r
-       return make_safe<ffmpeg_consumer_proxy>(env::media_folder() + params[1], key_only, codec, boost::to_lower_copy(options));\r
+       return make_safe<ffmpeg_consumer_proxy>(env::media_folder() + filename, key_only, codec, boost::to_lower_copy(options));\r
 }\r
 \r
-safe_ptr<core::frame_consumer> create_ffmpeg_consumer(const boost::property_tree::ptree& ptree)\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree)\r
 {\r
        std::string filename = ptree.get<std::string>("path");\r
        auto key_only            = ptree.get("key-only", false);\r
index e647572b84baca4f1578af15fe5840dea8b54a44..00d21a661692f571ea96a25d724ea3178c578234 100644 (file)
@@ -33,7 +33,7 @@ namespace core {
 namespace ffmpeg {\r
 \r
        \r
-safe_ptr<core::frame_consumer> create_ffmpeg_consumer(const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_consumer> create_ffmpeg_consumer(const boost::property_tree::ptree& ptree);\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree);\r
 \r
 }}
\ No newline at end of file
index 5d1095eba56efd965d32a42cce585dc10719fa67..1f4e8e349a2eb1eda2e946ab31dc9c878b6c8032 100644 (file)
@@ -200,7 +200,7 @@ void init()
        av_lockmgr_register(ffmpeg_lock_callback);\r
        av_log_set_callback(log_callback);\r
        \r
-       core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_ffmpeg_consumer(params);});\r
+       core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
        core::register_producer_factory(create_producer);\r
 }\r
 \r
index 417e1f1c15734ad9be44fe315f29b7e0af07bc58..b4b7db10cf38ed3e2ec5da4f0d903ee5a584179d 100644 (file)
@@ -47,7 +47,7 @@ public:
 \r
        // frame_consumer\r
 \r
-       virtual void initialize(const core::video_format_desc& format_desc, int, int) override\r
+       virtual void initialize(const core::video_format_desc& format_desc, int) override\r
        {\r
                format_desc_ = format_desc;\r
        }\r
@@ -85,6 +85,11 @@ public:
        {\r
                return 0;\r
        }\r
+\r
+       virtual int index() const override\r
+       {\r
+               return 100;\r
+       }\r
 };\r
 \r
 safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
index 55ac212e7ed0798db55a1ea8c23c1d8925947753..41826d8da3f5e775638af76b2f747cafba42d9a5 100644 (file)
@@ -48,7 +48,6 @@ struct oal_consumer : public core::frame_consumer,  public sf::SoundStream
        safe_ptr<diagnostics::graph>                                            graph_;\r
        boost::timer                                                                            perf_timer_;\r
        int                                                                                                     channel_index_;\r
-       int                                                                                                     sub_index_;\r
 \r
        tbb::concurrent_bounded_queue<std::shared_ptr<audio_buffer_16>> input_;\r
        boost::circular_buffer<audio_buffer_16>                 container_;\r
@@ -60,7 +59,6 @@ public:
        oal_consumer() \r
                : container_(16)\r
                , channel_index_(-1)\r
-               , sub_index_(-1)\r
        {\r
                graph_->add_guide("tick-time", 0.5);\r
                graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f));   \r
@@ -85,11 +83,10 @@ public:
 \r
        // frame consumer\r
 \r
-       virtual void initialize(const core::video_format_desc& format_desc, int channel_index, int sub_index) override\r
+       virtual void initialize(const core::video_format_desc& format_desc, int channel_index) override\r
        {\r
                format_desc_    = format_desc;          \r
                channel_index_  = channel_index;\r
-               sub_index_      = sub_index;\r
                if(Status() != Playing)\r
                {\r
                        sf::SoundStream::Initialize(2, 48000);\r
@@ -106,7 +103,7 @@ public:
        \r
        virtual std::wstring print() const override\r
        {\r
-               return L"oal[" + boost::lexical_cast<std::wstring>(channel_index_) + L"-" + boost::lexical_cast<std::wstring>(sub_index_) + L"|" + format_desc_.name + L"]";\r
+               return L"oal[" + boost::lexical_cast<std::wstring>(channel_index_) + L"|" + format_desc_.name + L"]";\r
        }\r
        \r
        virtual size_t buffer_depth() const override\r
@@ -130,6 +127,11 @@ public:
 \r
                return is_running_;\r
        }\r
+\r
+       virtual int index() const override\r
+       {\r
+               return 500;\r
+       }\r
 };\r
 \r
 safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
index e7a78afe3af1e7dd7f23c0683eedfae04043684d..f0ef11566c3db94b1d93f3cfc9514a24905a8fc3 100644 (file)
@@ -101,7 +101,6 @@ struct ogl_consumer : boost::noncopyable
        const configuration             config_;\r
        core::video_format_desc format_desc_;\r
        int                                             channel_index_;\r
-       int                                             sub_index_;\r
 \r
        GLuint                                  texture_;\r
        std::vector<GLuint>             pbos_;\r
@@ -125,15 +124,13 @@ struct ogl_consumer : boost::noncopyable
 \r
        boost::thread                   thread_;\r
        tbb::atomic<bool>               is_running_;\r
-\r
        \r
        ffmpeg::filter                  filter_;\r
 public:\r
-       ogl_consumer(const configuration& config, const core::video_format_desc& format_desc, int channel_index, int sub_index\r
+       ogl_consumer(const configuration& config, const core::video_format_desc& format_desc, int channel_index) \r
                : config_(config)\r
                , format_desc_(format_desc)\r
                , channel_index_(channel_index)\r
-               , sub_index_(sub_index)\r
                , texture_(0)\r
                , pbos_(2, 0)   \r
                , screen_width_(format_desc.width)\r
@@ -367,7 +364,7 @@ public:
                \r
        std::wstring print() const\r
        {       \r
-               return config_.name + L"[" + boost::lexical_cast<std::wstring>(channel_index_) + L"-" + boost::lexical_cast<std::wstring>(sub_index_) + L"|" + format_desc_.name + L"]";\r
+               return config_.name + L"[" + boost::lexical_cast<std::wstring>(channel_index_) + L"|" + format_desc_.name + L"]";\r
        }\r
        \r
        void calculate_aspect()\r
@@ -450,10 +447,10 @@ public:
 \r
        // frame_consumer\r
 \r
-       virtual void initialize(const core::video_format_desc& format_desc, int channel_index, int sub_index) override\r
+       virtual void initialize(const core::video_format_desc& format_desc, int channel_index) override\r
        {\r
                consumer_.reset();\r
-               consumer_.reset(new ogl_consumer(config_, format_desc, channel_index, sub_index));\r
+               consumer_.reset(new ogl_consumer(config_, format_desc, channel_index));\r
                CASPAR_LOG(info) << print() << L" Successfully Initialized.";   \r
        }\r
        \r
@@ -476,6 +473,11 @@ public:
        {\r
                return 1;\r
        }\r
+\r
+       virtual int index() const override\r
+       {\r
+               return 600;\r
+       }\r
 };     \r
 \r
 safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
index 62ffd1b23403f938a621ff8ccca11db188b6e94f..339415d7b898a471d79337b561ee83463d5c01fa 100644 (file)
@@ -525,7 +525,7 @@ bool AddCommand::DoExecute()
        //Perform loading of the clip\r
        try\r
        {\r
-               GetChannel()->output()->add(GetLayerIndex(), create_consumer(_parameters));\r
+               GetChannel()->output()->add(create_consumer(_parameters));\r
        \r
                CASPAR_LOG(info) << "Added " <<  _parameters[0] << TEXT(" successfully");\r
 \r
@@ -552,7 +552,11 @@ bool RemoveCommand::DoExecute()
        //Perform loading of the clip\r
        try\r
        {\r
-               GetChannel()->output()->remove(GetLayerIndex());\r
+               auto index = GetLayerIndex(std::numeric_limits<int>::min());\r
+               if(index == std::numeric_limits<int>::min())\r
+                       index = create_consumer(_parameters)->index();\r
+\r
+               GetChannel()->output()->remove(index);\r
 \r
                SetReplyString(TEXT("202 REMOVE OK\r\n"));\r
 \r
@@ -793,7 +797,7 @@ bool ClearCommand::DoExecute()
 \r
 bool PrintCommand::DoExecute()\r
 {\r
-       GetChannel()->output()->add(99978, create_consumer(boost::assign::list_of(L"IMAGE")));\r
+       GetChannel()->output()->add(create_consumer(boost::assign::list_of(L"IMAGE")));\r
                \r
        SetReplyString(TEXT("202 PRINT OK\r\n"));\r
 \r
index 4d3d10108d3c4062f8facce97dd12f1ed508f111..092fa0334fec5ec661480540c7b3a3c7b3a2d5a8 100644 (file)
@@ -8,11 +8,12 @@
   </paths>\r
   <channels>\r
     <channel>\r
-      <video-mode>PAL</video-mode>\r
+      <video-mode>720p5000</video-mode>\r
       <consumers>\r
-        <decklink>\r
-          <embedded-audio>true</embedded-audio>\r
-        </decklink>\r
+        <screen>\r
+          <device>2</device>\r
+        </screen>\r
+        <system-audio></system-audio>\r
       </consumers>\r
     </channel>\r
   </channels>\r
index c26e38e99be73cdff0d8cae389258db2e9054748..50a6752b3b3ae7cdcedf5fb31eb65d7559140972 100644 (file)
@@ -116,22 +116,21 @@ struct server::implementation : boost::noncopyable
                        \r
                        channels_.push_back(make_safe<video_channel>(channels_.size()+1, format_desc, ogl_));\r
                        \r
-                       int index = 0;\r
                        BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child("consumers"))\r
                        {\r
                                try\r
                                {\r
                                        const std::string name = xml_consumer.first;\r
                                        if(name == "screen")\r
-                                               channels_.back()->output()->add(index++, ogl::create_consumer(xml_consumer.second));                                    \r
+                                               channels_.back()->output()->add(ogl::create_consumer(xml_consumer.second));                                     \r
                                        else if(name == "bluefish")                                     \r
-                                               channels_.back()->output()->add(index++, bluefish::create_consumer(xml_consumer.second));                                       \r
+                                               channels_.back()->output()->add(bluefish::create_consumer(xml_consumer.second));                                        \r
                                        else if(name == "decklink")                                     \r
-                                               channels_.back()->output()->add(index++, decklink::create_consumer(xml_consumer.second));                               \r
-                                       //else if(name == "file")                                       \r
-                                       //      channels_.back()->output()->add(index++, create_ffmpeg_consumer(xml_consumer.second));                                          \r
+                                               channels_.back()->output()->add(decklink::create_consumer(xml_consumer.second));                                \r
+                                       else if(name == "file")                                 \r
+                                               channels_.back()->output()->add(ffmpeg::create_consumer(xml_consumer.second));                                          \r
                                        else if(name == "system-audio")\r
-                                               channels_.back()->output()->add(index++, oal::create_consumer());               \r
+                                               channels_.back()->output()->add(oal::create_consumer());                \r
                                        else if(name != "<xmlcomment>")\r
                                                CASPAR_LOG(warning) << "Invalid consumer: " << widen(name);     \r
                                }\r