]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2: - CLK: Fixed file-extension bug.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 18 May 2011 13:30:27 +0000 (13:30 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 18 May 2011 13:30:27 +0000 (13:30 +0000)
         - CII: ixed file-extension bug.
         - mixer: Refactoring.

git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@774 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

core/mixer/gpu/device_buffer.cpp
core/mixer/image/image_mixer.cpp
core/mixer/read_frame.h
core/mixer/write_frame.cpp
core/mixer/write_frame.h
core/producer/frame/basic_frame.cpp
core/producer/frame/basic_frame.h
protocol/cii/CIICommandsImpl.cpp
protocol/clk/CLKProtocolStrategy.cpp

index a036371933038062a6494b5d59d75893996be1cb..2dc0f9fc353a3fb6c8cde5a409e930829d035951 100644 (file)
@@ -86,6 +86,7 @@ public:
        \r
        void write(host_buffer& target)\r
        {\r
+               attach(0);\r
                GL(glBindTexture(GL_TEXTURE_2D, id_));\r
                target.unmap();\r
                target.bind();\r
index 5a624d6ebb37335709c74bbd0a3eda3b87b19960..b5e30936fc0061e0681e6d42227aa5de3c2d5bcc 100644 (file)
@@ -163,7 +163,6 @@ public:
                                local_key_ = false;\r
 \r
                                std::swap(local_key_buffer_, layer_key_buffer_);\r
-                               layer_key_buffer_->bind(4);\r
                        }\r
 \r
                        // Move waiting items to queue.\r
@@ -173,7 +172,6 @@ public:
                        // Start transfer from device to host.\r
 \r
                        read_buffer_ = ogl_device::create_host_buffer(format_desc_.size, host_buffer::read_only);\r
-                       draw_buffer_->attach();\r
                        draw_buffer_->write(*read_buffer_);\r
 \r
                        std::swap(draw_buffer_, write_buffer_);\r
@@ -213,7 +211,10 @@ public:
                                local_key_buffer_->bind(3);\r
                                draw_buffer_->attach(); \r
                                local_key_ = false;\r
-                       }                       \r
+                       }               \r
+\r
+                       if(layer_key_)\r
+                               layer_key_buffer_->bind(4);\r
                }       \r
 \r
                // Draw\r
index dee959dd8ca9b617620869d008c823ba93416417..73fc15045c3c60b22d2f2dc3d7f52da777e2f593 100644 (file)
@@ -33,6 +33,7 @@ namespace caspar { namespace core {
        \r
 class read_frame : boost::noncopyable\r
 {\r
+       read_frame(){}\r
 public:\r
        read_frame(safe_ptr<const host_buffer>&& image_data, std::vector<short>&& audio_data);\r
 \r
@@ -49,10 +50,6 @@ public:
                static safe_ptr<const empty> frame;\r
                return frame;\r
        }\r
-\r
-protected:\r
-       read_frame(){}\r
-\r
 private:\r
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
index 37b09a5d00dfd9927efb7cd13e92bd6dbeaf5457..1c95860172c66b940ce37f471061aa71f81c5a26 100644 (file)
@@ -81,5 +81,5 @@ const boost::iterator_range<const short*> write_frame::audio_data() const
 }\r
 int write_frame::tag() const {return impl_->tag_;}\r
 const core::pixel_format_desc& write_frame::get_pixel_format_desc() const{return impl_->desc_;}\r
-std::vector<safe_ptr<host_buffer>>& write_frame::get_plane_buffers(){return impl_->buffers_;}\r
+const std::vector<safe_ptr<host_buffer>>& write_frame::get_plane_buffers() const{return impl_->buffers_;}\r
 }}
\ No newline at end of file
index 5412a0c65bb54055c3e0ea68e68b3c34d73d3881..a41b362180a10936c8e9f01e8f98e8da27170862 100644 (file)
@@ -51,11 +51,11 @@ public:
        virtual int tag() const;\r
        \r
 private:\r
-       const core::pixel_format_desc& get_pixel_format_desc() const;\r
-       std::vector<safe_ptr<host_buffer>>& get_plane_buffers();\r
-\r
        friend class image_mixer;\r
 \r
+       const core::pixel_format_desc& get_pixel_format_desc() const;\r
+       const std::vector<safe_ptr<host_buffer>>& get_plane_buffers() const;\r
+\r
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
 };\r
index 619fc4cf096d42cfa18d0e7615d6538eae0a6b3a..98e464b6913806b66b113f42dafbb4f881975699 100644 (file)
@@ -42,6 +42,10 @@ public:
                : frames_(frames) {}\r
        implementation(std::vector<safe_ptr<basic_frame>>&& frames) \r
                : frames_(std::move(frames)){}\r
+       implementation(safe_ptr<basic_frame>&& frame) \r
+               { frames_.push_back(std::move(frame));}\r
+       implementation(const safe_ptr<basic_frame>& frame) \r
+               { frames_.push_back(frame);}\r
        \r
        void accept(const basic_frame& self, frame_visitor& visitor)\r
        {\r
@@ -53,20 +57,10 @@ public:
 };\r
        \r
 basic_frame::basic_frame() : impl_(new implementation(std::vector<safe_ptr<basic_frame>>())){}\r
-basic_frame::basic_frame(std::vector<safe_ptr<basic_frame>>&& frames) : impl_(new implementation(std::move(frames))){}\r
 basic_frame::basic_frame(const basic_frame& other) : impl_(new implementation(*other.impl_)){}\r
-basic_frame::basic_frame(const safe_ptr<basic_frame>& frame)\r
-{\r
-       std::vector<safe_ptr<basic_frame>> frames;\r
-       frames.push_back(frame);\r
-       impl_.reset(new implementation(std::move(frames)));\r
-}\r
-basic_frame::basic_frame(safe_ptr<basic_frame>&& frame)\r
-{\r
-       std::vector<safe_ptr<basic_frame>> frames;\r
-       frames.push_back(std::move(frame));\r
-       impl_.reset(new implementation(std::move(frames)));\r
-}\r
+basic_frame::basic_frame(std::vector<safe_ptr<basic_frame>>&& frames) : impl_(new implementation(frames)){}\r
+basic_frame::basic_frame(const safe_ptr<basic_frame>& frame) : impl_(new implementation(frame)){}\r
+basic_frame::basic_frame(safe_ptr<basic_frame>&& frame)  : impl_(new implementation(std::move(frame))){}\r
 void basic_frame::swap(basic_frame& other){impl_.swap(other.impl_);}\r
 basic_frame& basic_frame::operator=(const basic_frame& other)\r
 {\r
index db3da0c9a0f9bbfddd4a708aa1921565c68a027e..f9a19ff99f0435019b5a6b8b07cbfc7df218be5e 100644 (file)
 #pragma once\r
 \r
 #include "frame_visitor.h"\r
-#include "../../video_format.h"\r
+\r
+#include <core/video_format.h>\r
 \r
 #include <common/memory/safe_ptr.h>\r
 \r
-#include <boost/noncopyable.hpp>\r
 #include <boost/range/iterator_range.hpp>\r
 \r
-#include <array>\r
-#include <memory>\r
-#include <vector>\r
-\r
 namespace caspar { namespace core {\r
 \r
 class image_transform;\r
@@ -83,7 +79,7 @@ public:
        virtual void accept(frame_visitor& visitor);\r
 private:\r
        struct implementation;\r
-       std::shared_ptr<implementation> impl_;\r
+       safe_ptr<implementation> impl_;\r
 };\r
 \r
 inline bool is_concrete_frame(const safe_ptr<basic_frame>& frame)\r
index 67ec6e973937b243615b396dd0dcbc994180eae4..bcf3b1e0e62b9dff1c5538382109743c7f258798 100644 (file)
@@ -98,6 +98,7 @@ void MiscellaneousCommand::Setup(const std::vector<std::wstring>& parameters)
        {\r
                filename_ = parameters[5];\r
                filename_ = filename_.substr(0, filename_.find_last_of(TEXT('.')));\r
+               filename_.append(L".ft");\r
                state_ = 0;\r
                return;\r
        }\r
@@ -183,10 +184,12 @@ void KeydataCommand::Setup(const std::vector<std::wstring>& parameters) {
 \r
        if(parameters[1].at(0) == 27)   //NEPTUNE:      Y\<27>\X                        Stop layer X.\r
                state_ = 1;\r
-       else if(static_cast<unsigned char>(parameters[1].at(0)) == 254) //NEPTUNE:      Y\<254>                 Clear Canvas. \r
+       else if(static_cast<unsigned char>(parameters[1].at(1)) == 190) //NEPTUNE:      Y\<254>                 Clear Canvas. \r
                state_ = 2;\r
-       else if(static_cast<unsigned char>(parameters[1].at(0)) == 213) //NEPTUNE:      Y\<213><243>\X  Play layer X. \r
-               state_ = 3;\r
+       else if(static_cast<unsigned char>(parameters[1].at(1)) == 149) //NEPTUNE:      Y\<213><243>\X  Play layer X. \r
+               state_ = 3;                                                                                                     //UPDATE 2011-05-09: These char-codes are aparently not valid after converting to wide-chars\r
+                                                                                                                                       //the correct sequence is <195><149><195><179> \r
+               \r
 }\r
 \r
 }}}
\ No newline at end of file
index 1c9ad903b3519010c8201ecd47469a8c9c779fd0..5f22d38d162d9b9ddddafa06cf835dffb72b37bc 100644 (file)
@@ -124,7 +124,7 @@ void CLKProtocolStrategy::Parse(const TCHAR* pData, int charCount, IO::ClientInf
                        {\r
                                if(!bClockLoaded_) \r
                                {\r
-                                       get_default_cg_producer(pChannel_)->add(0, TEXT("hawrysklocka/clock"), true, TEXT(""), currentCommand_.GetData());\r
+                                       get_default_cg_producer(pChannel_)->add(0, TEXT("hawrysklocka/clock.ft"), true, TEXT(""), currentCommand_.GetData());\r
                                        bClockLoaded_ = true;\r
                                }\r
                                else \r