]> 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>
Sun, 23 Jan 2011 13:43:26 +0000 (13:43 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sun, 23 Jan 2011 13:43:26 +0000 (13:43 +0000)
core/core.vcxproj
core/core.vcxproj.filters
core/producer/screen/screen_producer.cpp [deleted file]
core/producer/screen/screen_producer.h [deleted file]
mixer/gpu/device_buffer.cpp
mixer/gpu/host_buffer.cpp
protocol/media.cpp

index 377e0868172408284288236379005c71a66d9b54..600dcdf76a69708c7edadbcb484a95b863336c46 100644 (file)
     <ClInclude Include="producer\image\image_producer.h" />\r
     <ClInclude Include="producer\image\image_scroll_producer.h" />\r
     <ClInclude Include="producer\layer.h" />\r
-    <ClInclude Include="producer\screen\screen_producer.h" />\r
     <ClInclude Include="producer\silverlight\silverlight_producer.h" />\r
     <ClInclude Include="producer\silverlight\XcpControlHost.h" />\r
     <ClInclude Include="producer\silverlight\xcpctrl.h" />\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
       <PreprocessToFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PreprocessToFile>\r
     </ClCompile>\r
-    <ClCompile Include="producer\screen\screen_producer.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
     <ClCompile Include="producer\silverlight\silverlight_producer.cpp">\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../StdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../StdAfx.h</PrecompiledHeaderFile>\r
index ca017582b5dcc75506048f6202d838a6ebe43c9b..80d30fe7ed694f12f7c127972555c5fb13748627 100644 (file)
@@ -64,9 +64,6 @@
     <Filter Include="Source\consumer\ffmpeg">\r
       <UniqueIdentifier>{b651856c-ff7e-4f90-be8a-32aba6094dbd}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\producer\screen">\r
-      <UniqueIdentifier>{eefc7a28-4013-458d-a91f-c822749984e8}</UniqueIdentifier>\r
-    </Filter>\r
     <Filter Include="Source\producer\silverlight">\r
       <UniqueIdentifier>{72cb7c9e-3b8c-4a45-8ee5-26f3dd091928}</UniqueIdentifier>\r
     </Filter>\r
     <ClInclude Include="producer\layer.h">\r
       <Filter>Source\producer</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="producer\screen\screen_producer.h">\r
-      <Filter>Source\producer\screen</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="producer\silverlight\silverlight_producer.h">\r
       <Filter>Source\producer\silverlight</Filter>\r
     </ClInclude>\r
     <ClCompile Include="producer\layer.cpp">\r
       <Filter>Source\producer</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="producer\screen\screen_producer.cpp">\r
-      <Filter>Source\producer\screen</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="producer\silverlight\silverlight_producer.cpp">\r
       <Filter>Source\producer\silverlight</Filter>\r
     </ClCompile>\r
diff --git a/core/producer/screen/screen_producer.cpp b/core/producer/screen/screen_producer.cpp
deleted file mode 100644 (file)
index b439bb0..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-*  This file is part of CasparCG.\r
-*\r
-*    CasparCG is free software: you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation, either version 3 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    CasparCG is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
\r
-#include "../../stdafx.h"\r
-\r
-#include "screen_producer.h"\r
-\r
-#include <common/concurrency/executor.h>\r
-\r
-#include <mixer/frame/draw_frame.h>\r
-\r
-#include <boost/algorithm/string.hpp>\r
-\r
-#include <tbb/concurrent_queue.h>\r
-\r
-namespace caspar { namespace core {\r
-       \r
-class screen_producer : public frame_producer\r
-{\r
-       std::shared_ptr<frame_factory> frame_factory_;\r
-       \r
-       tbb::concurrent_bounded_queue<safe_ptr<draw_frame>> frame_buffer_;\r
-       safe_ptr<draw_frame> head_;\r
-       executor executor_;\r
-\r
-       HDC screen_;\r
-       HDC mem_;\r
-       HBITMAP bmp_;\r
-       unsigned char* bmp_data_;\r
-       int x_;\r
-       int y_;\r
-       size_t width_;\r
-       size_t height_;\r
-\r
-public:\r
-\r
-       explicit screen_producer(int x, int y, size_t width, size_t height)\r
-               : head_(draw_frame::empty())\r
-               , x_(x)\r
-               , y_(y)\r
-               , width_(width)\r
-               , height_(height)\r
-       {                                       \r
-               frame_buffer_.push(draw_frame::empty());\r
-               executor_.start();\r
-\r
-               screen_ = ::CreateDC(L"DISPLAY", 0, 0, 0);\r
-               mem_ = ::CreateCompatibleDC(screen_);\r
-                               \r
-               BITMAPINFO info;\r
-               memset(&info, 0, sizeof(BITMAPINFO));\r
-               info.bmiHeader.biBitCount = 32;\r
-               info.bmiHeader.biCompression = BI_RGB;\r
-               info.bmiHeader.biHeight = -static_cast<int>(height_);\r
-               info.bmiHeader.biPlanes = 1;\r
-               info.bmiHeader.biSize = sizeof(BITMAPINFO);\r
-               info.bmiHeader.biWidth = width_;\r
-\r
-               bmp_ = ::CreateDIBSection(screen_, &info, DIB_RGB_COLORS, reinterpret_cast<void**>(&bmp_data_), 0, 0);\r
-               SelectObject(mem_, bmp_);\r
-       }\r
-\r
-       ~screen_producer()\r
-       {\r
-               ::DeleteObject(bmp_);\r
-               ::DeleteDC(mem_);\r
-               ::DeleteDC(screen_);\r
-       }\r
-\r
-       virtual void initialize(const safe_ptr<frame_factory>& frame_factory)\r
-       {\r
-               frame_factory_ = frame_factory;\r
-       }\r
-       \r
-       virtual safe_ptr<draw_frame> receive() \r
-       {\r
-               if(frame_buffer_.try_pop(head_))\r
-               {\r
-                       executor_.begin_invoke([=]\r
-                       {                               \r
-                               auto frame = frame_factory_->create_frame(width_, height_);\r
-\r
-                               ::BitBlt(mem_, 0, 0, width_, height_, screen_, x_, y_, SRCCOPY | CAPTUREBLT);   \r
-       \r
-                               std::copy_n(bmp_data_, width_*height_*4, frame->image_data().begin());\r
-                               for(size_t i = 0; i< height_*width_; ++i)               \r
-                                       frame->image_data().begin()[i*4+3] = 255;\r
-                               \r
-                               frame_buffer_.push(frame);\r
-                       });\r
-               }\r
-\r
-               return head_; \r
-       }\r
-       \r
-       virtual std::wstring print() const { return + L"screen[]"; }\r
-};\r
-\r
-safe_ptr<frame_producer> create_screen_producer(const std::vector<std::wstring>& params)\r
-{\r
-       if(params.size() < 5 || !boost::iequals(params[0], "screen"))\r
-               return frame_producer::empty();\r
-\r
-       int x = 0;\r
-       int y = 0;\r
-       size_t width = 0;\r
-       size_t height = 0;\r
-       \r
-       try{x = boost::lexical_cast<int>(params[1]);}\r
-       catch(boost::bad_lexical_cast&){return frame_producer::empty();}\r
-       try{y = boost::lexical_cast<int>(params[2]);}\r
-       catch(boost::bad_lexical_cast&){return frame_producer::empty();}\r
-       try{width = boost::lexical_cast<size_t>(params[3]);}\r
-       catch(boost::bad_lexical_cast&){return frame_producer::empty();}\r
-       try{height = boost::lexical_cast<size_t>(params[4]);}\r
-       catch(boost::bad_lexical_cast&){return frame_producer::empty();}\r
-\r
-       return make_safe<screen_producer>(x, y, width, height);\r
-}\r
-\r
-}}
\ No newline at end of file
diff --git a/core/producer/screen/screen_producer.h b/core/producer/screen/screen_producer.h
deleted file mode 100644 (file)
index 772de12..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-*  This file is part of CasparCG.\r
-*\r
-*    CasparCG is free software: you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation, either version 3 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    CasparCG is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#pragma once\r
-\r
-#include "../frame_producer.h"\r
-\r
-#include <string>\r
-#include <vector>\r
-\r
-namespace caspar { namespace core {\r
-       \r
-safe_ptr<frame_producer> create_screen_producer(const std::vector<std::wstring>& params);\r
-\r
-}}\r
index ca999e8004dd5135baac7681eb3ea1de3e958132..7b7fd6fdc2d2a0eb41c8ebaae7ffaab211c05af2 100644 (file)
@@ -3,7 +3,6 @@
 #include "device_buffer.h"\r
 \r
 #include <common/gl/gl_check.h>\r
-\r
 namespace caspar { namespace core {\r
        \r
 GLenum FORMAT[] = {0, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_BGR, GL_BGRA};\r
@@ -30,7 +29,8 @@ public:
                GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));\r
                GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));\r
                GL(glTexImage2D(GL_TEXTURE_2D, 0, INTERNAL_FORMAT[stride_], width_, height_, 0, FORMAT[stride_], GL_UNSIGNED_BYTE, NULL));\r
-               GL(glBindTexture(GL_TEXTURE_2D, 0));    \r
+               GL(glBindTexture(GL_TEXTURE_2D, 0));\r
+               CASPAR_LOG(trace) << "[device_buffer] allocated size:" << width*height*stride;  \r
        }       \r
 \r
        ~implementation()\r
index 6496b6b8a0ddd396bfbcb1dc2cac99b0bd1f06d4..414bf5cef995a4ad0573bf89cbc3e4f6d648c7b1 100644 (file)
@@ -5,7 +5,7 @@
 #include <common/gl/gl_check.h>\r
 \r
 namespace caspar { namespace core {\r
-                                                                                                                                                                                                                                                                                                                       \r
+                                                                                                                                                                                                                                                                                                                               \r
 struct host_buffer::implementation : boost::noncopyable\r
 {      \r
        GLuint pbo_;\r
@@ -31,7 +31,8 @@ public:
 \r
                if(!pbo_)\r
                        BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to allocate buffer."));\r
-               CASPAR_LOG(trace) << "[host_buffer] Allocated.";\r
+\r
+               CASPAR_LOG(trace) << "[host_buffer] allocated size:" << size_ << " usage: " << (usage == write_only ? "write_only" : "read_only");\r
        }       \r
 \r
        ~implementation()\r
index 359635b50a33e8f635594872963ee686688b1b8e..d1b7c8b9149e86217c7ee99c7b6e80c486954c46 100644 (file)
@@ -7,7 +7,6 @@
 #include <core/producer/flash/cg_producer.h>\r
 #include <core/producer/image/image_producer.h>\r
 #include <core/producer/decklink/decklink_producer.h>\r
-#include <core/producer/screen/screen_producer.h>\r
 #include <core/producer/silverlight/silverlight_producer.h>\r
 \r
 #include <core/consumer/bluefish/bluefish_consumer.h>\r
@@ -39,7 +38,6 @@ safe_ptr<core::frame_producer> create_producer(const std::vector<std::wstring>&
                (&core::image::create_image_producer)\r
                (&core::create_decklink_producer)\r
                (&core::create_color_producer)\r
-               (&core::create_screen_producer)\r
                (&core::create_silverlight_producer);\r
 \r
        if(params.empty())\r