]> git.sesse.net Git - casparcg/commitdiff
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 11 Feb 2012 01:24:51 +0000 (01:24 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 11 Feb 2012 01:24:51 +0000 (01:24 +0000)
22 files changed:
core/consumer/output.cpp
core/frame/frame_factory.h
core/producer/frame_producer.cpp
core/producer/frame_producer.h
core/producer/layer.cpp
core/producer/transition/transition_producer.cpp
core/video_channel.cpp
core/video_channel.h
modules/decklink/producer/decklink_producer.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/muxer/frame_muxer.cpp
modules/ffmpeg/producer/util/util.cpp
modules/flash/producer/cg_proxy.cpp
modules/flash/producer/flash_producer.cpp
modules/image/producer/image_scroll_producer.cpp
modules/reroute/producer/reroute_producer.cpp
protocol/amcp/AMCPCommandsImpl.cpp
protocol/cii/CIICommandsImpl.cpp
protocol/cii/CIIProtocolStrategy.cpp
protocol/clk/CLKProtocolStrategy.cpp
shell/casparcg.config
shell/server.cpp

index 2771afb5e8e547d0153f6d3a02d99d0521bfb72d..60fd4bc1818f24f41afbd81bc1eb74723e300c39 100644 (file)
@@ -100,11 +100,12 @@ public:
                remove(consumer->index());\r
        }\r
        \r
-       void set_video_format_desc(const video_format_desc& format_desc)\r
+       void video_format_desc(const core::video_format_desc& format_desc)\r
        {\r
                executor_.invoke([&]\r
                {\r
-                       boost::timer frame_timer;\r
+                       if(format_desc_ == format_desc)\r
+                               return;\r
 \r
                        auto it = consumers_.begin();\r
                        while(it != consumers_.end())\r
@@ -124,8 +125,6 @@ public:
                        \r
                        format_desc_ = format_desc;\r
                        frames_.clear();\r
-\r
-                       graph_->set_value("consume-time", frame_timer.elapsed()*format_desc.fps*0.5);\r
                });\r
        }\r
 \r
@@ -147,16 +146,17 @@ public:
                return boost::range::count_if(consumers_ | boost::adaptors::map_values, [](const spl::shared_ptr<frame_consumer>& x){return x->has_synchronization_clock();}) > 0;\r
        }\r
                \r
-       void operator()(spl::shared_ptr<const data_frame> input_frame, const video_format_desc& format_desc)\r
+       void operator()(spl::shared_ptr<const data_frame> input_frame, const core::video_format_desc& format_desc)\r
        {\r
+               video_format_desc(format_desc);\r
+\r
                executor_.invoke([=]\r
                {                       \r
+                       boost::timer frame_timer;\r
+\r
                        if(!has_synchronization_clock())\r
                                sync_timer_.tick(1.0/format_desc_.fps);\r
                                \r
-                       if(format_desc_ != format_desc)\r
-                               set_video_format_desc(format_desc);\r
-\r
                        if(input_frame->image_data().size() != format_desc_.size)\r
                        {\r
                                sync_timer_.tick(1.0/format_desc_.fps);\r
@@ -184,6 +184,8 @@ public:
                                        consumers_.erase(it++);\r
                                }\r
                        }\r
+\r
+                       graph_->set_value("consume-time", frame_timer.elapsed()*format_desc.fps*0.5);\r
                });\r
        }\r
 \r
index 4411abc6aa04135c1c5f23c6a069fd347742c1b7..fc0329284b44f2ba856c2a77f5765031a0cdbf80 100644 (file)
@@ -34,7 +34,7 @@ struct frame_factory : boost::noncopyable
        virtual ~frame_factory(){}\r
 \r
        virtual spl::shared_ptr<struct write_frame> create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc) = 0;               \r
-       virtual struct video_format_desc get_video_format_desc() const = 0; // nothrow\r
+       virtual struct video_format_desc video_format_desc() const = 0; // nothrow\r
 };\r
 \r
 }}
\ No newline at end of file
index 66e865d5f5f700f5763e0e329aa14997d38a92da..fb8544d6d3f7cd1bae0bafe267380e49eea96b76 100644 (file)
@@ -90,8 +90,8 @@ public:
        virtual std::wstring                                                                            name() const override                                                                                                                   {return producer_->name();}\r
        virtual boost::property_tree::wptree                                            info() const override                                                                                                                   {return producer_->info();}\r
        virtual boost::unique_future<std::wstring>                                      call(const std::wstring& str) override                                                                                  {return producer_->call(str);}\r
-       virtual spl::shared_ptr<frame_producer>                                         get_following_producer() const override                                                                                 {return producer_->get_following_producer();}\r
-       virtual void                                                                                            set_leading_producer(const spl::shared_ptr<frame_producer>& producer) override  {return producer_->set_leading_producer(producer);}\r
+       virtual spl::shared_ptr<frame_producer>                                         following_producer() const override                                                                                     {return producer_->following_producer();}\r
+       virtual void                                                                                            leading_producer(const spl::shared_ptr<frame_producer>& producer) override      {return producer_->leading_producer(producer);}\r
        virtual uint32_t                                                                                        nb_frames() const override                                                                                                              {return producer_->nb_frames();}\r
        virtual void subscribe(const monitor::observable::observer_ptr& o)                                                                                                                                                      {return producer_->subscribe(o);}\r
        virtual void unsubscribe(const monitor::observable::observer_ptr& o)                                                                                                                                            {return producer_->unsubscribe(o);}\r
@@ -113,10 +113,10 @@ public:
                if(frame == draw_frame::eof())\r
                {\r
                        CASPAR_LOG(info) << producer_->print() << " End Of File.";\r
-                       auto following = producer_->get_following_producer();\r
+                       auto following = producer_->following_producer();\r
                        if(following != frame_producer::empty())\r
                        {\r
-                               following->set_leading_producer(spl::make_shared_ptr(producer_));\r
+                               following->leading_producer(spl::make_shared_ptr(producer_));\r
 \r
                                producer_->unsubscribe(event_subject_);\r
                                producer_ = std::move(following);\r
index abbc3784715834fb89198042696410bcb6dc7f50..ab3d24a267b7a9ca3026836d78ec0a4d838f5511 100644 (file)
@@ -64,15 +64,14 @@ struct frame_producer : public monitor::observable
 \r
        virtual boost::unique_future<std::wstring> call(const std::wstring&);\r
 \r
-       virtual spl::shared_ptr<frame_producer> get_following_producer() const {return frame_producer::empty();}  // nothrow\r
-       virtual void set_leading_producer(const spl::shared_ptr<frame_producer>&) {}  // nothrow\r
+       virtual spl::shared_ptr<frame_producer> following_producer() const {return frame_producer::empty();}  // nothrow\r
+       virtual void leading_producer(const spl::shared_ptr<frame_producer>&) {}  // nothrow\r
                \r
        virtual uint32_t nb_frames() const {return std::numeric_limits<uint32_t>::max();}\r
        \r
-       virtual spl::shared_ptr<class draw_frame> receive(int flags) = 0;\r
+       virtual spl::shared_ptr<class draw_frame> receive(int fBlags) = 0;\r
        virtual spl::shared_ptr<class draw_frame> last_frame() const = 0;\r
-\r
-\r
+       \r
        static const spl::shared_ptr<frame_producer>& empty(); // nothrow\r
 \r
        // monitor::observable\r
index 49acdbb209c4c26516ce52b99afb3dfa51e9570c..795eb259b18ee81070ee05302ad7208657c2cec7 100644 (file)
@@ -85,7 +85,7 @@ public:
        {                       \r
                if(background_ != frame_producer::empty())\r
                {\r
-                       background_->set_leading_producer(foreground_);\r
+                       background_->leading_producer(foreground_);\r
 \r
                        background_->unsubscribe(background_event_subject_);\r
                        foreground_->unsubscribe(foreground_event_subject_);\r
index d39bec7d240686ca2302a832e1f3a0c9756097f8..40c37654aa5e2d5fa77b4b1ee58a8789f7f0fd47 100644 (file)
@@ -58,12 +58,12 @@ struct transition_producer : public frame_producer
        \r
        // frame_producer\r
 \r
-       virtual spl::shared_ptr<frame_producer> get_following_producer() const override\r
+       virtual spl::shared_ptr<frame_producer> following_producer() const override\r
        {\r
                return dest_producer_;\r
        }\r
        \r
-       virtual void set_leading_producer(const spl::shared_ptr<frame_producer>& producer) override\r
+       virtual void leading_producer(const spl::shared_ptr<frame_producer>& producer) override\r
        {\r
                source_producer_ = producer;\r
        }\r
@@ -114,7 +114,7 @@ struct transition_producer : public frame_producer
 \r
        virtual uint32_t nb_frames() const override\r
        {\r
-               return get_following_producer()->nb_frames();\r
+               return following_producer()->nb_frames();\r
        }\r
 \r
        virtual std::wstring print() const override\r
index 2d138058fa9ede2a0c77ee9799e110a14f43e66d..46c80c1beb9334b5646fac047966a7332756af74 100644 (file)
@@ -52,30 +52,30 @@ struct video_channel::impl sealed : public frame_factory
        const int                                                                               index_;\r
 \r
        mutable tbb::spin_mutex                                                 format_desc_mutex_;\r
-       video_format_desc                                                               format_desc_;\r
+       core::video_format_desc                                                 format_desc_;\r
        \r
        const spl::shared_ptr<diagnostics::graph>               graph_;\r
 \r
-       const spl::shared_ptr<caspar::core::output>             output_;\r
-       const spl::shared_ptr<caspar::core::mixer>              mixer_;\r
-       const spl::shared_ptr<caspar::core::stage>              stage_; \r
+       caspar::core::output                                                    output_;\r
+       caspar::core::mixer                                                             mixer_;\r
+       caspar::core::stage                                                             stage_; \r
 \r
        executor                                                                                executor_;\r
 public:\r
-       impl(int index, const video_format_desc& format_desc, spl::shared_ptr<image_mixer> image_mixer)  \r
+       impl(int index, const core::video_format_desc& format_desc, spl::shared_ptr<image_mixer> image_mixer)  \r
                : event_subject_(new monitor::subject(monitor::path() % "channel" % index))\r
                , index_(index)\r
                , format_desc_(format_desc)\r
-               , output_(new caspar::core::output(graph_, format_desc, index))\r
-               , mixer_(new caspar::core::mixer(graph_, std::move(image_mixer)))\r
-               , stage_(new caspar::core::stage(graph_))       \r
+               , output_(graph_, format_desc, index)\r
+               , mixer_(graph_, std::move(image_mixer))\r
+               , stage_(graph_)\r
                , executor_(L"video_channel")\r
        {\r
                graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f));   \r
                graph_->set_text(print());\r
                diagnostics::register_graph(graph_);\r
 \r
-               stage_->subscribe(event_subject_);\r
+               stage_.subscribe(event_subject_);\r
 \r
                executor_.begin_invoke([=]{tick();});\r
 \r
@@ -86,10 +86,10 @@ public:
                                                \r
        virtual spl::shared_ptr<write_frame> create_frame(const void* tag, const core::pixel_format_desc& desc) override\r
        {               \r
-               return mixer_->create_frame(tag, desc);\r
+               return mixer_.create_frame(tag, desc);\r
        }\r
        \r
-       virtual core::video_format_desc get_video_format_desc() const override\r
+       virtual core::video_format_desc video_format_desc() const\r
        {\r
                return lock(format_desc_mutex_, [&]\r
                {\r
@@ -98,28 +98,36 @@ public:
        }\r
        \r
        // video_channel\r
+       \r
+       void video_format_desc(const core::video_format_desc& format_desc)\r
+       {\r
+               lock(format_desc_mutex_, [&]\r
+               {\r
+                       format_desc_ = format_desc;\r
+               });\r
+       }\r
 \r
        void tick()\r
        {\r
                try\r
                {\r
-                       auto format_desc = get_video_format_desc();\r
+                       auto format_desc = video_format_desc();\r
 \r
                        boost::timer frame_timer;\r
 \r
                        // Produce\r
                        \r
-                       auto stage_frames = (*stage_)(format_desc);\r
+                       auto stage_frames = stage_(format_desc);\r
 \r
                        // Mix\r
                        \r
-                       auto mixed_frame  = (*mixer_)(std::move(stage_frames), format_desc);\r
+                       auto mixed_frame  = mixer_(std::move(stage_frames), format_desc);\r
 \r
                        // Consume\r
                        \r
                        frame_subject_ << mixed_frame;\r
                        \r
-                       (*output_)(std::move(mixed_frame), format_desc);\r
+                       output_(std::move(mixed_frame), format_desc);\r
                \r
                        graph_->set_value("tick-time", frame_timer.elapsed()*format_desc.fps*0.5);\r
 \r
@@ -133,27 +141,19 @@ public:
 \r
                executor_.begin_invoke([=]{tick();});\r
        }\r
-\r
-       void set_video_format_desc(const video_format_desc& format_desc)\r
-       {\r
-               lock(format_desc_mutex_, [&]\r
-               {\r
-                       format_desc_ = format_desc;\r
-               });\r
-       }\r
-               \r
+                       \r
        std::wstring print() const\r
        {\r
-               return L"video_channel[" + boost::lexical_cast<std::wstring>(index_) + L"|" +  get_video_format_desc().name + L"]";\r
+               return L"video_channel[" + boost::lexical_cast<std::wstring>(index_) + L"|" +  video_format_desc().name + L"]";\r
        }\r
 \r
        boost::property_tree::wptree info() const\r
        {\r
                boost::property_tree::wptree info;\r
 \r
-               auto stage_info  = stage_->info();\r
-               auto mixer_info  = mixer_->info();\r
-               auto output_info = output_->info();\r
+               auto stage_info  = stage_.info();\r
+               auto mixer_info  = mixer_.info();\r
+               auto output_info = output_.info();\r
 \r
                info.add(L"video-mode", format_desc_.name);\r
                info.add_child(L"stage", stage_info.get());\r
@@ -164,16 +164,19 @@ public:
        }\r
 };\r
 \r
-video_channel::video_channel(int index, const video_format_desc& format_desc, spl::shared_ptr<image_mixer> image_mixer) : impl_(new impl(index, format_desc, image_mixer)){}\r
-spl::shared_ptr<stage> video_channel::stage() { return impl_->stage_;} \r
-spl::shared_ptr<mixer> video_channel::mixer() { return impl_->mixer_;} \r
+video_channel::video_channel(int index, const core::video_format_desc& format_desc, spl::shared_ptr<image_mixer> image_mixer) : impl_(new impl(index, format_desc, image_mixer)){}\r
+const stage& video_channel::stage() const { return impl_->stage_;} \r
+stage& video_channel::stage() { return impl_->stage_;} \r
+const mixer& video_channel::mixer() const{ return impl_->mixer_;} \r
+mixer& video_channel::mixer() { return impl_->mixer_;} \r
+const output& video_channel::output() const { return impl_->output_;} \r
+output& video_channel::output() { return impl_->output_;} \r
 spl::shared_ptr<frame_factory> video_channel::frame_factory() { return impl_;} \r
-spl::shared_ptr<output> video_channel::output() { return impl_->output_;} \r
-video_format_desc video_channel::get_video_format_desc() const{return impl_->format_desc_;}\r
-void video_channel::set_video_format_desc(const video_format_desc& format_desc){impl_->set_video_format_desc(format_desc);}\r
+core::video_format_desc video_channel::video_format_desc() const{return impl_->video_format_desc();}\r
+void core::video_channel::video_format_desc(const core::video_format_desc& format_desc){impl_->video_format_desc(format_desc);}\r
 boost::property_tree::wptree video_channel::info() const{return impl_->info();}\r
-void video_channel::subscribe(const frame_observer::observer_ptr& o) {impl_->frame_subject_.subscribe(o);}\r
-void video_channel::unsubscribe(const frame_observer::observer_ptr& o) {impl_->frame_subject_.unsubscribe(o);}         \r
+void video_channel::subscribe(const frame_observable::observer_ptr& o) {impl_->frame_subject_.subscribe(o);}\r
+void video_channel::unsubscribe(const frame_observable::observer_ptr& o) {impl_->frame_subject_.unsubscribe(o);}               \r
 void video_channel::subscribe(const monitor::observable::observer_ptr& o) {impl_->event_subject_->subscribe(o);}\r
 void video_channel::unsubscribe(const monitor::observable::observer_ptr& o) {impl_->event_subject_->unsubscribe(o);}\r
 \r
index 2fb89e5865980efbbef93454016f0333313944d9..92921e3224b00d3014675e05092dcd29e5c3b3dc 100644 (file)
 #include <boost/property_tree/ptree_fwd.hpp>\r
 \r
 FORWARD3(caspar, core, ogl, class accelerator);\r
+FORWARD2(caspar, core, class stage);\r
+FORWARD2(caspar, core, class mixer);\r
+FORWARD2(caspar, core, class output);\r
+FORWARD2(caspar, core, struct image_mixer);\r
+FORWARD2(caspar, core, struct video_format_desc);\r
+FORWARD2(caspar, core, struct frame_factory);\r
 \r
 namespace caspar { namespace core {\r
        \r
-typedef reactive::observable<spl::shared_ptr<const struct data_frame>> frame_observer;\r
+typedef reactive::observable<spl::shared_ptr<const struct data_frame>> frame_observable;\r
 \r
-class video_channel sealed : public frame_observer\r
+class video_channel sealed : public frame_observable\r
                                                   , public monitor::observable\r
 {\r
        video_channel(const video_channel&);\r
        video_channel& operator=(const video_channel&);\r
 public:\r
-       explicit video_channel(int index, const struct video_format_desc& format_desc, spl::shared_ptr<struct image_mixer> image_mixer);\r
-\r
-       spl::shared_ptr<class stage>                    stage();\r
-       spl::shared_ptr<class mixer>                    mixer();\r
-       spl::shared_ptr<class output>                   output();\r
-       spl::shared_ptr<struct frame_factory>   frame_factory();\r
+       explicit video_channel(int index, const video_format_desc& format_desc, spl::shared_ptr<image_mixer> image_mixer);\r
        \r
-       struct video_format_desc get_video_format_desc() const;\r
-       void set_video_format_desc(const struct video_format_desc& format_desc);\r
+       const core::stage&      stage() const;\r
+       core::stage&            stage();\r
+       const core::mixer&      mixer() const;\r
+       core::mixer&            mixer();\r
+       const core::output&     output() const;\r
+       core::output&           output();\r
+               \r
+       core::video_format_desc video_format_desc() const;\r
+       void video_format_desc(const core::video_format_desc& format_desc);\r
        \r
+       spl::shared_ptr<core::frame_factory> frame_factory();\r
+\r
        boost::property_tree::wptree info() const;\r
 \r
        // observable<spl::shared_ptr<const struct data_frame>>\r
        \r
-       virtual void subscribe(const frame_observer::observer_ptr& o) override;\r
-       virtual void unsubscribe(const frame_observer::observer_ptr& o) override;\r
+       virtual void subscribe(const frame_observable::observer_ptr& o) override;\r
+       virtual void unsubscribe(const frame_observable::observer_ptr& o) override;\r
                \r
        // monitor::observable\r
 \r
index 4d66646ea451c818820aff99f505523e5f452399..bf30599ed8828a0d6e6e82bb8019e4cfa2086547 100644 (file)
@@ -350,7 +350,7 @@ spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<core
        boost::replace_all(filter_str, L"DEINTERLACE_BOB", L"YADIF=1:-1");\r
        \r
        if(format_desc.format == core::video_format::invalid)\r
-               format_desc = frame_factory->get_video_format_desc();\r
+               format_desc = frame_factory->video_format_desc();\r
                        \r
        return core::wrap_producer(spl::make_shared<decklink_producer_proxy>(frame_factory, format_desc, device_index, filter_str, length));\r
 }\r
index 02eb42c0706b55343d7898a95c902c11158c9f88..d562b729c22de95696b8f0f664dedaa2a53b37f3 100644 (file)
@@ -90,7 +90,7 @@ public:
        explicit ffmpeg_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, const std::wstring& filter, bool loop, uint32_t start, uint32_t length) \r
                : filename_(filename)\r
                , frame_factory_(frame_factory)         \r
-               , format_desc_(frame_factory->get_video_format_desc())\r
+               , format_desc_(frame_factory->video_format_desc())\r
                , input_(graph_, filename_, loop, start, length)\r
                , fps_(read_fps(*input_.context(), format_desc_.fps))\r
                , start_(start)\r
@@ -119,7 +119,7 @@ public:
 \r
                try\r
                {\r
-                       audio_decoder_.reset(new audio_decoder(input_.context(), frame_factory->get_video_format_desc()));\r
+                       audio_decoder_.reset(new audio_decoder(input_.context(), frame_factory->video_format_desc()));\r
                        CASPAR_LOG(info) << print() << L" " << audio_decoder_->print();\r
                }\r
                catch(averror_stream_not_found&)\r
index 4a1e7f583f978fcb069b1697272d3db856158a25..00d82a11f40018621c001f762546930668681fa9 100644 (file)
@@ -87,7 +87,7 @@ struct frame_muxer::impl : boost::noncopyable
        impl(double in_fps, const spl::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filter_str)\r
                : display_mode_(display_mode::invalid)\r
                , in_fps_(in_fps)\r
-               , format_desc_(frame_factory->get_video_format_desc())\r
+               , format_desc_(frame_factory->video_format_desc())\r
                , auto_transcode_(env::properties().get(L"configuration.auto-transcode", true))\r
                , auto_deinterlace_(env::properties().get(L"configuration.auto-deinterlace", true))\r
                , audio_cadence_(format_desc_.audio_cadence)\r
index f06e3084655a42edf6813978c37df3149d0c3e01..e20e6430c4c28228b7df26d2520ab32fbf5068cc 100644 (file)
@@ -276,15 +276,15 @@ spl::shared_ptr<core::write_frame> make_write_frame(const void* tag, const spl::
 \r
        if(decoded_frame->height == 480) // NTSC DV\r
        {\r
-               write->get_frame_transform().fill_translation[1] += 2.0/static_cast<double>(frame_factory->get_video_format_desc().height);\r
-               write->get_frame_transform().fill_scale[1] = 1.0 - 6.0*1.0/static_cast<double>(frame_factory->get_video_format_desc().height);\r
+               write->get_frame_transform().fill_translation[1] += 2.0/static_cast<double>(frame_factory->video_format_desc().height);\r
+               write->get_frame_transform().fill_scale[1] = 1.0 - 6.0*1.0/static_cast<double>(frame_factory->video_format_desc().height);\r
        }\r
        \r
        // Fix field-order if needed\r
-       if(get_mode(*decoded_frame) == core::field_mode::lower && frame_factory->get_video_format_desc().field_mode == core::field_mode::upper)\r
-               write->get_frame_transform().fill_translation[1] += 1.0/static_cast<double>(frame_factory->get_video_format_desc().height);\r
-       else if(get_mode(*decoded_frame) == core::field_mode::upper && frame_factory->get_video_format_desc().field_mode == core::field_mode::lower)\r
-               write->get_frame_transform().fill_translation[1] -= 1.0/static_cast<double>(frame_factory->get_video_format_desc().height);\r
+       if(get_mode(*decoded_frame) == core::field_mode::lower && frame_factory->video_format_desc().field_mode == core::field_mode::upper)\r
+               write->get_frame_transform().fill_translation[1] += 1.0/static_cast<double>(frame_factory->video_format_desc().height);\r
+       else if(get_mode(*decoded_frame) == core::field_mode::upper && frame_factory->video_format_desc().field_mode == core::field_mode::lower)\r
+               write->get_frame_transform().fill_translation[1] -= 1.0/static_cast<double>(frame_factory->video_format_desc().height);\r
 \r
        return spl::make_shared_ptr(write);\r
 }\r
index 0c515b1339a53a3121390127899ac0864680e3ba..3c73c9e771844691c76217b99288c8f59f97192a 100644 (file)
@@ -140,15 +140,15 @@ public:
        \r
 cg_proxy create_cg_proxy(const spl::shared_ptr<core::video_channel>& video_channel, int render_layer)\r
 {      \r
-       auto flash_producer = video_channel->stage()->foreground(render_layer).get();\r
+       auto flash_producer = video_channel->stage().foreground(render_layer).get();\r
 \r
        try\r
        {\r
                if(flash_producer->print().find(L"flash[") == std::string::npos) // UGLY hack\r
                {\r
                        flash_producer = flash::create_producer(video_channel->frame_factory(), boost::assign::list_of<std::wstring>());        \r
-                       video_channel->stage()->load(render_layer, flash_producer); \r
-                       video_channel->stage()->play(render_layer);\r
+                       video_channel->stage().load(render_layer, flash_producer); \r
+                       video_channel->stage().play(render_layer);\r
                }\r
        }\r
        catch(...)\r
index 524c8917f7fd1f15afeb43fcf85da36d1ceedcfe..a1ba140c04d42a4110371a1cc84c9a7915c33fea 100644 (file)
@@ -343,9 +343,9 @@ public:
        flash_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, int width, int height) \r
                : filename_(filename)           \r
                , frame_factory_(frame_factory)\r
-               , width_(width > 0 ? width : frame_factory->get_video_format_desc().width)\r
-               , height_(height > 0 ? height : frame_factory->get_video_format_desc().height)\r
-               , buffer_size_(env::properties().get(L"configuration.flash.buffer-depth", frame_factory_->get_video_format_desc().fps > 30.0 ? 4 : 2))\r
+               , width_(width > 0 ? width : frame_factory->video_format_desc().width)\r
+               , height_(height > 0 ? height : frame_factory->video_format_desc().height)\r
+               , buffer_size_(env::properties().get(L"configuration.flash.buffer-depth", frame_factory_->video_format_desc().fps > 30.0 ? 4 : 2))\r
                , last_frame_(core::draw_frame::empty())\r
                , executor_(L"flash_producer")\r
        {       \r
@@ -456,7 +456,7 @@ public:
 \r
                if(frame_buffer_.empty())\r
                {\r
-                       auto format_desc = frame_factory_->get_video_format_desc();\r
+                       auto format_desc = frame_factory_->video_format_desc();\r
                                        \r
                        tick();\r
                        auto frame = render();\r
@@ -493,7 +493,7 @@ public:
 \r
 spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
 {\r
-       auto template_host = get_template_host(frame_factory->get_video_format_desc());\r
+       auto template_host = get_template_host(frame_factory->video_format_desc());\r
        \r
        auto filename = env::template_folder() + L"\\" + template_host.filename;\r
        \r
index babb84f32fee63cfea292e94e80d1545b9d2e494..8f9869e038aa7ef2bb77405e3bb2cf077be90231 100644 (file)
@@ -66,7 +66,7 @@ struct image_scroll_producer : public core::frame_producer
        explicit image_scroll_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, int speed) \r
                : filename_(filename)\r
                , delta_(0)\r
-               , format_desc_(frame_factory->get_video_format_desc())\r
+               , format_desc_(frame_factory->video_format_desc())\r
                , speed_(speed)\r
                , last_frame_(core::draw_frame::empty())\r
        {\r
index 643836878ed63a6e4a517e884a3cd6cf20e80ee6..b821181e08b7642f2654f89ec2eba51c31d107d9 100644 (file)
@@ -99,8 +99,8 @@ public:
                \r
                frame_number_++;\r
                \r
-               bool double_speed       = std::abs(frame_factory_->get_video_format_desc().fps / 2.0 - read_frame->get_frame_rate()) < 0.01;            \r
-               bool half_speed         = std::abs(read_frame->get_frame_rate() / 2.0 - frame_factory_->get_video_format_desc().fps) < 0.01;\r
+               bool double_speed       = std::abs(frame_factory_->video_format_desc().fps / 2.0 - read_frame->get_frame_rate()) < 0.01;                \r
+               bool half_speed         = std::abs(read_frame->get_frame_rate() / 2.0 - frame_factory_->video_format_desc().fps) < 0.01;\r
 \r
                if(half_speed && frame_number_ % 2 == 0) // Skip frame\r
                        return receive(0);\r
index a99eb9b4118968d76c100ef5a92109fa76554714..a81b48648b77748856ec7364f4f3e0c646f81ba2 100644 (file)
@@ -201,7 +201,7 @@ void AMCPCommand::SendReply()
 \r
 void AMCPCommand::Clear() \r
 {\r
-       pChannel_->stage()->clear();\r
+       pChannel_->stage().clear();\r
        pClientInfo_.reset();\r
        channelIndex_ = 0;\r
        _parameters.clear();\r
@@ -236,15 +236,15 @@ bool ChannelGridCommand::DoExecute()
        params.push_back(L"Channel Grid Window");\r
        auto screen = create_consumer(params);\r
 \r
-       self->output()->add(screen);\r
+       self->output().add(screen);\r
 \r
        BOOST_FOREACH(auto channel, GetChannels())\r
        {\r
                if(channel != self)\r
                {\r
                        auto producer = reroute::create_producer(self->frame_factory(), *channel);              \r
-                       self->stage()->load(index, producer, false);\r
-                       self->stage()->play(index);\r
+                       self->stage().load(index, producer, false);\r
+                       self->stage().play(index);\r
                        index++;\r
                }\r
        }\r
@@ -268,7 +268,7 @@ bool ChannelGridCommand::DoExecute()
                                transform.clip_scale[1]                 = delta;                        \r
                                return transform;\r
                        };\r
-                       self->stage()->apply_transform(index, transform);\r
+                       self->stage().apply_transform(index, transform);\r
                }\r
        }\r
 \r
@@ -288,14 +288,14 @@ bool CallCommand::DoExecute()
                        std::wstring param;\r
                        for(auto it = std::begin(_parameters2)+1; it != std::end(_parameters2); ++it, param += L" ")\r
                                param += *it;\r
-                       result = (what == L"F" ? GetChannel()->stage()->foreground(GetLayerIndex()) : GetChannel()->stage()->background(GetLayerIndex())).get()->call(boost::trim_copy(param));\r
+                       result = (what == L"F" ? GetChannel()->stage().foreground(GetLayerIndex()) : GetChannel()->stage().background(GetLayerIndex())).get()->call(boost::trim_copy(param));\r
                }\r
                else\r
                {\r
                        std::wstring param;\r
                        for(auto it = std::begin(_parameters2); it != std::end(_parameters2); ++it, param += L" ")\r
                                param += *it;\r
-                       result = GetChannel()->stage()->foreground(GetLayerIndex()).get()->call(boost::trim_copy(param));\r
+                       result = GetChannel()->stage().foreground(GetLayerIndex()).get()->call(boost::trim_copy(param));\r
                }\r
 \r
                if(!result.timed_wait(boost::posix_time::seconds(2)))\r
@@ -424,7 +424,7 @@ bool MixerCommand::DoExecute()
                {\r
                        auto blend_str = _parameters.at(1);                                                             \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->mixer()->set_blend_mode(GetLayerIndex(), get_blend_mode(blend_str));      \r
+                       GetChannel()->mixer().set_blend_mode(GetLayerIndex(), get_blend_mode(blend_str));       \r
                }\r
                else if(_parameters[0] == L"BRIGHTNESS")\r
                {\r
@@ -492,9 +492,9 @@ bool MixerCommand::DoExecute()
                {\r
                        int layer = GetLayerIndex(std::numeric_limits<int>::max());\r
                        if(layer ==     std::numeric_limits<int>::max())\r
-                               GetChannel()->stage()->clear_transforms();\r
+                               GetChannel()->stage().clear_transforms();\r
                        else\r
-                               GetChannel()->stage()->clear_transforms(layer);\r
+                               GetChannel()->stage().clear_transforms(layer);\r
                }\r
                else if(_parameters[0] == L"COMMIT")\r
                {\r
@@ -512,7 +512,7 @@ bool MixerCommand::DoExecute()
                        defer_tranforms.insert(defer_tranforms.end(), transforms.begin(), transforms.end());\r
                }\r
                else\r
-                       GetChannel()->stage()->apply_transforms(transforms);\r
+                       GetChannel()->stage().apply_transforms(transforms);\r
        \r
                SetReplyString(TEXT("202 MIXER OK\r\n"));\r
 \r
@@ -548,13 +548,13 @@ bool SwapCommand::DoExecute()
                        int l1 = GetLayerIndex();\r
                        int l2 = boost::lexical_cast<int>(strs.at(1));\r
 \r
-                       ch1->stage()->swap_layer(l1, l2, *ch2->stage());\r
+                       ch1->stage().swap_layer(l1, l2, ch2->stage());\r
                }\r
                else\r
                {\r
                        auto ch1 = GetChannel();\r
                        auto ch2 = GetChannels().at(boost::lexical_cast<int>(_parameters[0])-1);\r
-                       ch1->stage()->swap_layers(*ch2->stage());\r
+                       ch1->stage().swap_layers(ch2->stage());\r
                }\r
                \r
                SetReplyString(TEXT("202 SWAP OK\r\n"));\r
@@ -581,7 +581,7 @@ bool AddCommand::DoExecute()
        try\r
        {\r
                auto consumer = create_consumer(_parameters);\r
-               GetChannel()->output()->add(GetLayerIndex(consumer->index()), consumer);\r
+               GetChannel()->output().add(GetLayerIndex(consumer->index()), consumer);\r
        \r
                SetReplyString(TEXT("202 ADD OK\r\n"));\r
 \r
@@ -610,7 +610,7 @@ bool RemoveCommand::DoExecute()
                if(index == std::numeric_limits<int>::min())\r
                        index = create_consumer(_parameters)->index();\r
 \r
-               GetChannel()->output()->remove(index);\r
+               GetChannel()->output().remove(index);\r
 \r
                SetReplyString(TEXT("202 REMOVE OK\r\n"));\r
 \r
@@ -637,7 +637,7 @@ bool LoadCommand::DoExecute()
        {\r
                _parameters[0] = _parameters[0];\r
                auto pFP = create_producer(GetChannel()->frame_factory(), _parameters);         \r
-               GetChannel()->stage()->load(GetLayerIndex(), pFP, true);\r
+               GetChannel()->stage().load(GetLayerIndex(), pFP, true);\r
        \r
                SetReplyString(TEXT("202 LOAD OK\r\n"));\r
 \r
@@ -748,11 +748,11 @@ bool LoadbgCommand::DoExecute()
 \r
                bool auto_play = std::find(_parameters.begin(), _parameters.end(), L"AUTO") != _parameters.end();\r
 \r
-               auto pFP2 = create_transition_producer(GetChannel()->get_video_format_desc().field_mode, pFP, transitionInfo);\r
+               auto pFP2 = create_transition_producer(GetChannel()->video_format_desc().field_mode, pFP, transitionInfo);\r
                if(auto_play)\r
-                       GetChannel()->stage()->load(GetLayerIndex(), pFP2, transitionInfo.duration); // TODO: LOOP\r
+                       GetChannel()->stage().load(GetLayerIndex(), pFP2, transitionInfo.duration); // TODO: LOOP\r
                else\r
-                       GetChannel()->stage()->load(GetLayerIndex(), pFP2); // TODO: LOOP\r
+                       GetChannel()->stage().load(GetLayerIndex(), pFP2); // TODO: LOOP\r
        \r
                SetReplyString(TEXT("202 LOADBG OK\r\n"));\r
 \r
@@ -779,7 +779,7 @@ bool PauseCommand::DoExecute()
 {\r
        try\r
        {\r
-               GetChannel()->stage()->pause(GetLayerIndex());\r
+               GetChannel()->stage().pause(GetLayerIndex());\r
                SetReplyString(TEXT("202 PAUSE OK\r\n"));\r
                return true;\r
        }\r
@@ -808,7 +808,7 @@ bool PlayCommand::DoExecute()
                                throw std::exception();\r
                }\r
 \r
-               GetChannel()->stage()->play(GetLayerIndex());\r
+               GetChannel()->stage().play(GetLayerIndex());\r
                \r
                SetReplyString(TEXT("202 PLAY OK\r\n"));\r
                return true;\r
@@ -825,7 +825,7 @@ bool StopCommand::DoExecute()
 {\r
        try\r
        {\r
-               GetChannel()->stage()->stop(GetLayerIndex());\r
+               GetChannel()->stage().stop(GetLayerIndex());\r
                SetReplyString(TEXT("202 STOP OK\r\n"));\r
                return true;\r
        }\r
@@ -841,9 +841,9 @@ bool ClearCommand::DoExecute()
 {\r
        int index = GetLayerIndex(std::numeric_limits<int>::min());\r
        if(index != std::numeric_limits<int>::min())\r
-               GetChannel()->stage()->clear(index);\r
+               GetChannel()->stage().clear(index);\r
        else\r
-               GetChannel()->stage()->clear();\r
+               GetChannel()->stage().clear();\r
                \r
        SetReplyString(TEXT("202 CLEAR OK\r\n"));\r
 \r
@@ -852,7 +852,7 @@ bool ClearCommand::DoExecute()
 \r
 bool PrintCommand::DoExecute()\r
 {\r
-       GetChannel()->output()->add(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
@@ -1100,7 +1100,7 @@ bool CGCommand::DoExecuteRemove()
 \r
 bool CGCommand::DoExecuteClear() \r
 {\r
-       GetChannel()->stage()->clear(GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER));\r
+       GetChannel()->stage().clear(GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER));\r
        SetReplyString(TEXT("202 CG OK\r\n"));\r
        return true;\r
 }\r
@@ -1346,7 +1346,7 @@ bool CinfCommand::DoExecute()
 \r
 void GenerateChannelInfo(int index, const spl::shared_ptr<core::video_channel>& pChannel, std::wstringstream& replyString)\r
 {\r
-       replyString << index+1 << TEXT(" ") << pChannel->get_video_format_desc().name << TEXT(" PLAYING") << TEXT("\r\n");\r
+       replyString << index+1 << TEXT(" ") << pChannel->video_format_desc().name << TEXT(" PLAYING") << TEXT("\r\n");\r
 }\r
 \r
 bool InfoCommand::DoExecute()\r
@@ -1454,13 +1454,13 @@ bool InfoCommand::DoExecute()
                                        if(_parameters.size() >= 2)\r
                                        {\r
                                                if(_parameters[1] == L"B")\r
-                                                       info.add_child(L"producer", channels_.at(channel)->stage()->background(layer).get()->info());\r
+                                                       info.add_child(L"producer", channels_.at(channel)->stage().background(layer).get()->info());\r
                                                else\r
-                                                       info.add_child(L"producer", channels_.at(channel)->stage()->foreground(layer).get()->info());\r
+                                                       info.add_child(L"producer", channels_.at(channel)->stage().foreground(layer).get()->info());\r
                                        }\r
                                        else\r
                                        {\r
-                                               info.add_child(L"layer", channels_.at(channel)->stage()->info(layer).get())\r
+                                               info.add_child(L"layer", channels_.at(channel)->stage().info(layer).get())\r
                                                        .add(L"index", layer);\r
                                        }\r
                                }\r
@@ -1554,7 +1554,7 @@ bool SetCommand::DoExecute()
                auto format_desc = core::video_format_desc(value);\r
                if(format_desc.format != core::video_format::invalid)\r
                {\r
-                       GetChannel()->set_video_format_desc(format_desc);\r
+                       GetChannel()->video_format_desc(format_desc);\r
                        SetReplyString(TEXT("202 SET MODE OK\r\n"));\r
                }\r
                else\r
index 23c07fcca5ab77b76be29549d7284c51d7a50417..233bf6052b9622347749369d5a4aa5ddaff133f9 100644 (file)
@@ -138,7 +138,7 @@ void MiscellaneousCommand::Setup(const std::vector<std::wstring>& parameters)
                std::wstring value = parameters[3];\r
                std::transform(value.begin(), value.end(), value.begin(), toupper);\r
 \r
-               this->pCIIStrategy_->GetChannel()->set_video_format_desc(core::video_format_desc(value));\r
+               this->pCIIStrategy_->GetChannel()->video_format_desc(core::video_format_desc(value));\r
        }\r
 }\r
 \r
@@ -169,7 +169,7 @@ void KeydataCommand::Execute()
        else if(state_ == 1)\r
                flash::create_cg_proxy(pCIIStrategy_->GetChannel()).stop(layer_, 0);\r
        else if(state_ == 2)\r
-               pCIIStrategy_->GetChannel()->stage()->clear(flash::cg_proxy::DEFAULT_LAYER);\r
+               pCIIStrategy_->GetChannel()->stage().clear(flash::cg_proxy::DEFAULT_LAYER);\r
        else if(state_ == 3)\r
                flash::create_cg_proxy(pCIIStrategy_->GetChannel()).play(layer_);\r
 }\r
index 43896b681edf74f8c88b094df5fe9eb8f981230d..b8f8ae84742efbdd01f191b4e46cc549641e2027 100644 (file)
@@ -200,8 +200,8 @@ void CIIProtocolStrategy::DisplayTemplate(const std::wstring& titleName)
 {\r
        try\r
        {\r
-               pChannel_->stage()->load(0, GetPreparedTemplate(titleName));\r
-               pChannel_->stage()->play(0);\r
+               pChannel_->stage().load(0, GetPreparedTemplate(titleName));\r
+               pChannel_->stage().play(0);\r
 \r
                CASPAR_LOG(info) << L"Displayed title " << titleName ;\r
        }\r
@@ -218,11 +218,11 @@ void CIIProtocolStrategy::DisplayMediaFile(const std::wstring& filename)
        transition.duration = 12;\r
 \r
        auto pFP = create_producer(GetChannel()->frame_factory(), filename);\r
-       auto pTransition = create_transition_producer(GetChannel()->get_video_format_desc().field_mode, pFP, transition);\r
+       auto pTransition = create_transition_producer(GetChannel()->video_format_desc().field_mode, pFP, transition);\r
 \r
        try\r
        {\r
-               pChannel_->stage()->load(0, pTransition);\r
+               pChannel_->stage().load(0, pTransition);\r
        }\r
        catch(...)\r
        {\r
@@ -231,7 +231,7 @@ void CIIProtocolStrategy::DisplayMediaFile(const std::wstring& filename)
                return;\r
        }\r
 \r
-       pChannel_->stage()->play(0);\r
+       pChannel_->stage().play(0);\r
 \r
        CASPAR_LOG(info) << L"Displayed " << filename;\r
 }\r
index 8c2e9fde80c237a84f03447965b83034d5f5ad00..7f14171deedd48a324f3f4199fca5b9a4c492ae9 100644 (file)
@@ -117,7 +117,7 @@ void CLKProtocolStrategy::Parse(const TCHAR* pData, int charCount, IO::ClientInf
 \r
                        if(currentCommand_.command_ == CLKCommand::CLKReset) \r
                        {\r
-                               pChannel_->stage()->clear(flash::cg_proxy::DEFAULT_LAYER);\r
+                               pChannel_->stage().clear(flash::cg_proxy::DEFAULT_LAYER);\r
                                bClockLoaded_ = false;\r
                                \r
                                CASPAR_LOG(info) << L"CLK: Recieved and executed reset-command";\r
index 664435433e8cc38893f6b1d51f40bc71fe84a3c6..77ca4ba401cf31aa0929ff7fad83a90a4eb150fa 100644 (file)
@@ -6,12 +6,10 @@
     <data-path>D:\casparcg\_data\</data-path>\r
     <template-path>D:\casparcg\_templates\</template-path>\r
   </paths>\r
-  <accelerator>cpu</accelerator>\r
-  <blend-modes>true</blend-modes>\r
   <log-level>trace</log-level>\r
   <channels>\r
     <channel>\r
-      <video-mode>PAL</video-mode>\r
+      <video-mode>720p5000</video-mode>\r
       <consumers>\r
         <screen>\r
           <auto-deinterlace>false</auto-deinterlace>\r
index b66295dd287a88a7a81f6da0e31a93c8969d00c7..b7964cccfd64743973268193b39dfba2b7f8266a 100644 (file)
@@ -146,15 +146,15 @@ struct server::impl : boost::noncopyable
                                {\r
                                        auto name = xml_consumer.first;\r
                                        if(name == L"screen")\r
-                                               channel->output()->add(caspar::screen::create_consumer(xml_consumer.second));                                   \r
+                                               channel->output().add(caspar::screen::create_consumer(xml_consumer.second));                                    \r
                                        else if(name == L"bluefish")                                    \r
-                                               channel->output()->add(bluefish::create_consumer(xml_consumer.second));                                 \r
+                                               channel->output().add(bluefish::create_consumer(xml_consumer.second));                                  \r
                                        else if(name == L"decklink")                                    \r
-                                               channel->output()->add(decklink::create_consumer(xml_consumer.second));                         \r
+                                               channel->output().add(decklink::create_consumer(xml_consumer.second));                          \r
                                        else if(name == L"file")                                        \r
-                                               channel->output()->add(ffmpeg::create_consumer(xml_consumer.second));                                           \r
+                                               channel->output().add(ffmpeg::create_consumer(xml_consumer.second));                                            \r
                                        else if(name == L"system-audio")\r
-                                               channel->output()->add(oal::create_consumer());         \r
+                                               channel->output().add(oal::create_consumer());          \r
                                        else if(name != L"<xmlcomment>")\r
                                                CASPAR_LOG(warning) << "Invalid consumer: " << name;    \r
                                }\r