<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
<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
+++ /dev/null
-/*\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
+++ /dev/null
-/*\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
#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
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
#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
\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
#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
(&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