]> git.sesse.net Git - casparcg/commitdiff
2.1.0: Merged decklink_producer fix from trunk.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 7 Feb 2012 17:39:53 +0000 (17:39 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 7 Feb 2012 17:39:53 +0000 (17:39 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@2292 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

modules/decklink/producer/decklink_producer.cpp

index b0adec90df62e0307d65896b8989174714222af9..fa578c6f4f54254efc8ce7f3f76e9b9b09c2b204 100644 (file)
@@ -78,41 +78,45 @@ namespace caspar { namespace decklink {
                \r
 class decklink_producer : boost::noncopyable, public IDeckLinkInputCallback\r
 {      \r
-       CComPtr<IDeckLink>                                                                                      decklink_;\r
-       CComQIPtr<IDeckLinkInput>                                                                       input_;\r
-       \r
-       const std::wstring                                                                                      model_name_;\r
-       const core::video_format_desc                                                           format_desc_;\r
-       const size_t                                                                                            device_index_;\r
-\r
-       spl::shared_ptr<diagnostics::graph>                                                             graph_;\r
-       boost::timer                                                                                            tick_timer_;\r
-       boost::timer                                                                                            frame_timer_;\r
-               \r
-       tbb::atomic<int>                                                                                        flags_;\r
-       spl::shared_ptr<core::frame_factory>                                                            frame_factory_;\r
-       std::vector<int>                                                                                        audio_cadence_;\r
+       spl::shared_ptr<diagnostics::graph>             graph_;\r
+       boost::timer                                                    tick_timer_;\r
+       boost::timer                                                    frame_timer_;\r
 \r
-       tbb::concurrent_bounded_queue<spl::shared_ptr<core::draw_frame>>        frame_buffer_;\r
+       CComPtr<IDeckLink>                                              decklink_;\r
+       CComQIPtr<IDeckLinkInput>                               input_;\r
+       CComQIPtr<IDeckLinkAttributes >                 attributes_;\r
+       \r
+       const std::wstring                                              model_name_;\r
+       const size_t                                                    device_index_;\r
+       const std::wstring                                              filter_;\r
+       \r
+       core::video_format_desc                                 format_desc_;\r
+       std::vector<int>                                                audio_cadence_;\r
+       boost::circular_buffer<size_t>                  sync_buffer_;\r
+       ffmpeg::frame_muxer                                             muxer_;\r
+                       \r
+       tbb::atomic<int>                                                flags_;\r
+       spl::shared_ptr<core::frame_factory>    frame_factory_;\r
 \r
-       std::exception_ptr                                                                                      exception_;\r
-               \r
-       ffmpeg::frame_muxer                                                                                     muxer_;\r
+       tbb::concurrent_bounded_queue<\r
+               spl::shared_ptr<core::draw_frame>>      frame_buffer_;\r
 \r
-       boost::circular_buffer<size_t>                                                          sync_buffer_;\r
+       std::exception_ptr                                              exception_;             \r
 \r
 public:\r
        decklink_producer(const core::video_format_desc& format_desc, size_t device_index, const spl::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filter)\r
                : decklink_(get_device(device_index))\r
                , input_(decklink_)\r
+               , attributes_(decklink_)\r
                , model_name_(get_model_name(decklink_))\r
-               , format_desc_(format_desc)\r
                , device_index_(device_index)\r
-               , frame_factory_(frame_factory)\r
-               , audio_cadence_(frame_factory->get_video_format_desc().audio_cadence)\r
+               , filter_(filter)\r
+               , format_desc_(format_desc)\r
+               , audio_cadence_(format_desc.audio_cadence)\r
                , muxer_(format_desc.fps, frame_factory, filter)\r
                , sync_buffer_(format_desc.audio_cadence.size())\r
-       {               \r
+               , frame_factory_(frame_factory)\r
+       {       \r
                flags_ = 0;\r
                frame_buffer_.set_capacity(2);\r
                \r
@@ -259,7 +263,7 @@ public:
        \r
        std::wstring print() const\r
        {\r
-               return model_name_ + L" [" + boost::lexical_cast<std::wstring>(device_index_) + L"]";\r
+               return model_name_ + L" [" + boost::lexical_cast<std::wstring>(device_index_) + L"|" + format_desc_.name + L"]";\r
        }\r
 };\r
        \r
@@ -331,7 +335,7 @@ spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<core
 \r
        auto device_index       = get_param(L"DEVICE", params, -1);\r
        if(device_index == -1)\r
-               device_index = params.size() > 1 ? boost::lexical_cast<int>(params.at(1)) : 1;\r
+               device_index = boost::lexical_cast<int>(params.at(1));\r
 \r
        auto filter_str         = get_param(L"FILTER", params);         \r
        auto length                     = get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max());   \r