#include "exception.h"\r
#include "memory.h"\r
\r
-#include "../../../common/concurrency/executor.h"\r
+#include "../../processor/read_frame.h"\r
+\r
+#include <common/concurrency/executor.h>\r
\r
#include <boost/optional/optional.hpp>\r
\r
#include "DeckLinkAPI_h.h"\r
\r
#include "../../format/video_format.h"\r
+#include "../../processor/read_frame.h"\r
\r
#include <common/concurrency/executor.h>\r
#include <common/exception/exceptions.h>\r
*/\r
#pragma once\r
\r
-#include "../format/video_format.h"\r
-#include "../processor/read_frame.h"\r
+#include <common/utility/safe_ptr.h>\r
\r
#include <boost/noncopyable.hpp>\r
\r
-#include <memory>\r
-\r
namespace caspar { namespace core {\r
\r
+class read_frame;\r
+\r
struct frame_consumer : boost::noncopyable\r
{\r
enum sync_mode\r
virtual sync_mode synchronize() = 0;\r
virtual size_t buffer_depth() const = 0;\r
};\r
-typedef std::shared_ptr<frame_consumer> frame_consumer_ptr;\r
-typedef std::shared_ptr<const frame_consumer> frame_consumer_const_ptr;\r
-\r
-typedef std::unique_ptr<frame_consumer> frame_consumer_uptr;\r
-typedef std::unique_ptr<const frame_consumer> frame_consumer_const_uptr;\r
\r
}}
\ No newline at end of file
\r
#include <boost/noncopyable.hpp>\r
\r
-#include <tbb/concurrent_queue.h>\r
-\r
-#include <boost/thread/future.hpp>\r
-\r
namespace caspar { namespace core {\r
\r
-class frame_processor_device;\r
class draw_frame;\r
+struct video_format_desc;\r
\r
class frame_consumer_device : boost::noncopyable\r
{\r
\r
#include "oal_consumer.h"\r
\r
-#include "../../processor/write_frame.h"\r
#include "../../format/video_format.h"\r
\r
+#include "../../processor/read_frame.h"\r
+\r
#include <SFML/Audio.hpp>\r
\r
#include <boost/circular_buffer.hpp>\r
*/\r
#pragma once\r
\r
+#include "../../format/video_format.h"\r
#include "../../consumer/frame_consumer.h"\r
\r
namespace caspar { namespace core { namespace oal {\r
-\r
+ \r
class consumer : public frame_consumer\r
{\r
public: \r
#include "ogl_consumer.h"\r
\r
#include "../../format/video_format.h"\r
+#include "../../processor/read_frame.h"\r
\r
#include <common/gl/utility.h>\r
#include <common/concurrency/executor.h>\r
+#include <common/utility/safe_ptr.h>\r
\r
#include <boost/thread.hpp>\r
\r
#pragma once\r
\r
#include "../../consumer/frame_consumer.h"\r
+#include "../../format/video_format.h"\r
\r
namespace caspar { namespace core { namespace ogl {\r
\r
<ClInclude Include="producer\ffmpeg\video\video_decoder.h" />\r
<ClInclude Include="producer\flash\axflash.h" />\r
<ClInclude Include="producer\flash\cg_producer.h" />\r
- <ClInclude Include="producer\flash\ct_producer.h" />\r
<ClInclude Include="producer\flash\FlashAxContainer.h" />\r
<ClInclude Include="producer\flash\flash_producer.h" />\r
<ClInclude Include="producer\flash\TimerHelper.h" />\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\flash\ct_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\flash\Flash9e_i.c">\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../stdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<ClInclude Include="producer\flash\cg_producer.h">\r
<Filter>Source\channel\producer\flash</Filter>\r
</ClInclude>\r
- <ClInclude Include="producer\flash\ct_producer.h">\r
- <Filter>Source\channel\producer\flash</Filter>\r
- </ClInclude>\r
<ClInclude Include="producer\flash\flash_producer.h">\r
<Filter>Source\channel\producer\flash</Filter>\r
</ClInclude>\r
<ClCompile Include="producer\flash\cg_producer.cpp">\r
<Filter>Source\channel\producer\flash</Filter>\r
</ClCompile>\r
- <ClCompile Include="producer\flash\ct_producer.cpp">\r
- <Filter>Source\channel\producer\flash</Filter>\r
- </ClCompile>\r
<ClCompile Include="producer\flash\flash_producer.cpp">\r
<Filter>Source\channel\producer\flash</Filter>\r
</ClCompile>\r
tbb::queuing_mutex::scoped_lock lock(seek_mutex_);\r
if(av_seek_frame(format_context_.get(), -1, seek_target*AV_TIME_BASE, 0) < 0)\r
return false;\r
- \r
- video_packet_buffer_.clear();\r
- audio_packet_buffer_.clear();\r
- // TODO: Not sure its enough to just flush in input class\r
- if(video_codec_context_)\r
- avcodec_flush_buffers(video_codec_context_.get());\r
- if(audio_codex_context_)\r
- avcodec_flush_buffers(audio_codex_context_.get());\r
+\r
return true;\r
}\r
\r
}\r
}\r
\r
+safe_ptr<frame_producer> create_ct_producer(const std::vector<std::wstring>& params) \r
+{\r
+ std::wstring filename = params[0] + L".ct";\r
+ if(!boost::filesystem::exists(filename))\r
+ return frame_producer::empty();\r
+\r
+ auto producer = make_safe<cg_producer>();\r
+ producer->add(0, filename, 1);\r
+\r
+ return producer;\r
+}\r
+\r
cg_producer::cg_producer() : impl_(new implementation()){}\r
cg_producer::cg_producer(cg_producer&& other) : impl_(std::move(other.impl_)){}\r
safe_ptr<draw_frame> cg_producer::receive(){return impl_->receive();}\r
\r
safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<channel>& channel, int layer_index = cg_producer::DEFAULT_LAYER);\r
\r
+safe_ptr<frame_producer> create_ct_producer(const std::vector<std::wstring>& params);\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
- \r
-#include "../../stdafx.h"\r
-\r
-#include "ct_producer.h"\r
-\r
-#include "cg_producer.h"\r
-\r
-namespace caspar { namespace core { namespace flash {\r
-\r
-struct ct_producer : public cg_producer\r
-{\r
- ct_producer(ct_producer&& other) : initialized_(std::move(other.initialized_)), filename_(std::move(other.filename_)){}\r
- ct_producer(const std::wstring& filename) : filename_(filename), initialized_(false){}\r
-\r
- virtual safe_ptr<draw_frame> receive()\r
- {\r
- if(!initialized_)\r
- {\r
- cg_producer::add(0, filename_, 1);\r
- initialized_ = true;\r
- }\r
- return cg_producer::receive();\r
- }\r
-\r
- virtual std::wstring print() const\r
- {\r
- return L"ct[" + filename_ + L"]";\r
- }\r
-\r
- bool initialized_;\r
- std::wstring filename_;\r
-};\r
- \r
-safe_ptr<frame_producer> create_ct_producer(const std::vector<std::wstring>& params) \r
-{\r
- std::wstring filename = params[0] + L".ct";\r
- return boost::filesystem::exists(filename) ? make_safe<ct_producer>(filename) : frame_producer::empty();\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 <common/utility/safe_ptr.h>\r
-\r
-#include <string>\r
-\r
-namespace caspar { namespace core { namespace flash{\r
- \r
-safe_ptr<frame_producer> create_ct_producer(const std::vector<std::wstring>& params);\r
-\r
-}}}
\ No newline at end of file
if(ax_->IsReadyToRender() && ax_->InvalidRectangle())\r
{\r
std::fill_n(bmp_data_, format_desc_.size, 0); \r
- //ax_->DrawControl((HDC)hdc_.get());\r
+ ax_->DrawControl((HDC)hdc_.get());\r
\r
auto frame = frame_processor_->create_frame();\r
std::copy_n(bmp_data_, format_desc_.size, frame->image_data().begin());\r
{ \r
if(!boost::filesystem::exists(filename))\r
BOOST_THROW_EXCEPTION(file_not_found() << boost::errinfo_file_name(narrow(filename)));\r
-\r
- executor_.start();\r
}\r
\r
~implementation() \r
\r
void param(const std::wstring& param) \r
{ \r
- if(!factory_)\r
- BOOST_THROW_EXCEPTION(invalid_operation() << msg_info(narrow(print()) + "Uninitialized."));\r
-\r
- executor_.invoke([&]\r
+ executor_.begin_invoke([=]\r
{\r
+ if(!factory_)\r
+ BOOST_THROW_EXCEPTION(invalid_operation() << msg_info(narrow(print()) + "Uninitialized."));\r
if(!renderer_)\r
{\r
renderer_.reset(factory_());\r
virtual void initialize(const safe_ptr<frame_processor_device>& frame_processor)\r
{\r
factory_ = [=]{return new flash_renderer(frame_processor, filename_);};\r
+ executor_.start();\r
}\r
\r
std::wstring print() const{ return L"flash[" + boost::filesystem::wpath(filename_).filename() + L"]"; }\r
\r
namespace caspar { namespace core { namespace flash {\r
\r
-///=================================================================================================\r
-/// <summary> Flash Producer. </summary>\r
-///=================================================================================================\r
class flash_producer : public frame_producer\r
{\r
public:\r
private: \r
struct implementation;\r
std::shared_ptr<implementation> impl_;\r
-\r
};\r
\r
}}}
\ No newline at end of file
\r
#include "image_loader.h"\r
\r
-#include "../../../common/exception/Exceptions.h"\r
-\r
-#include "../../processor/write_frame.h"\r
+#include <common/exception/Exceptions.h>\r
\r
#if defined(_MSC_VER)\r
#pragma warning (disable : 4714) // marked as __forceinline not inlined\r
\r
namespace caspar { namespace core { namespace image{\r
\r
-#include <boost/thread/once.hpp>\r
-\r
struct FreeImage_initializer\r
{\r
FreeImage_initializer(){FreeImage_Initialise(true);}\r
BOOST_THROW_EXCEPTION(invalid_argument() << msg_info("Unsupported image format."));\r
\r
auto bitmap = std::shared_ptr<FIBITMAP>(FreeImage_Load(fif, filename.c_str(), 0), FreeImage_Unload);\r
- //FREE_IMAGE_TYPE ImageType = FreeImage_GetImageType(bitmap.get());\r
\r
if(FreeImage_GetBPP(bitmap.get()) != 32)\r
{\r
\r
#include "../producer/color/color_producer.h"\r
#include "../producer/ffmpeg/ffmpeg_producer.h"\r
-#include "../producer/flash/ct_producer.h"\r
+#include "../producer/flash/cg_producer.h"\r
#include "../producer/image/image_producer.h"\r
//#include "../producer/image/image_scroll_producer.h"\r
\r