]> git.sesse.net Git - casparcg/commitdiff
#281
authorHelge Norberg <helge.norberg@gmail.com>
Thu, 26 Jun 2014 17:04:50 +0000 (19:04 +0200)
committerHelge Norberg <helge.norberg@gmail.com>
Thu, 26 Jun 2014 17:04:50 +0000 (19:04 +0200)
Added support for iVGA consumer to not provide channel sync even though connected. Useful for iVGA clients that downloads as fast as possible instead of in frame-rate pace, like Wirecast.
<provide-sync>false</provide-sync> has to be added inside the <newtek-ivga /> element to not provide channel sync when connected.

modules/newtek/consumer/newtek_ivga_consumer.cpp
shell/casparcg.config

index 1e5e046aad99efb1b372f1fa70364f4d1af410af..cc075c7a9373ddd563d49979e55ce25b656b5138 100644 (file)
@@ -45,8 +45,9 @@ struct newtek_ivga_consumer : public core::frame_consumer
 {
        std::shared_ptr<void>                   air_send_;
        core::video_format_desc                 format_desc_;
-       core::channel_layout                    channel_layout_;
        executor                                                executor_;
+       core::channel_layout                    channel_layout_;
+       bool                                                    provide_sync_;
        tbb::atomic<bool>                               connected_;
 
        safe_ptr<diagnostics::graph>    graph_;
@@ -55,9 +56,10 @@ struct newtek_ivga_consumer : public core::frame_consumer
 
 public:
 
-       newtek_ivga_consumer(core::channel_layout channel_layout)
+       newtek_ivga_consumer(core::channel_layout channel_layout, bool provide_sync)
                : executor_(print())
                , channel_layout_(channel_layout)
+               , provide_sync_(provide_sync)
        {
                if (!airsend::is_available())
                        BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(airsend::dll_name()) + " not available"));
@@ -163,7 +165,7 @@ public:
 
        virtual bool has_synchronization_clock() const override
        {
-               return connected_;
+               return provide_sync_ && connected_;
        }
 };     
 
@@ -175,8 +177,9 @@ safe_ptr<core::frame_consumer> create_ivga_consumer(const core::parameters& para
        const auto channel_layout = core::default_channel_layout_repository()
                .get_by_name(
                        params.get(L"CHANNEL_LAYOUT", L"STEREO"));
+       const auto provide_sync = params.get(L"PROVIDE_SYNC", true);
 
-       return make_safe<newtek_ivga_consumer>(channel_layout);
+       return make_safe<newtek_ivga_consumer>(channel_layout, provide_sync);
 }
 
 safe_ptr<core::frame_consumer> create_ivga_consumer(const boost::property_tree::wptree& ptree) 
@@ -185,8 +188,9 @@ safe_ptr<core::frame_consumer> create_ivga_consumer(const boost::property_tree::
                core::default_channel_layout_repository()
                        .get_by_name(
                                boost::to_upper_copy(ptree.get(L"channel-layout", L"STEREO")));
+       const auto provide_sync = ptree.get(L"provide-sync", true);
 
-       return make_safe<newtek_ivga_consumer>(channel_layout);
+       return make_safe<newtek_ivga_consumer>(channel_layout, provide_sync);
 }
 
 }}
\ No newline at end of file
index de4810b301eca3c59fe250122a79c7880fdedddb..eb752a811030db897a292f7f73935ee323e903a3 100644 (file)
             </screen>\r
             <newtek-ivga>\r
               <channel-layout>stereo [mono|stereo|dts|dolbye|dolbydigital|smpte|passthru]</channel-layout>\r
+              <provide-sync>true [true|false]</provide-sync>\r
             </newtek-ivga>\r
             <file>\r
                 <path></path>\r