\r
virtual bool send(const safe_ptr<core::read_frame>& frame)\r
{ \r
- if(counter_ < core::consumer_buffer_depth())\r
- ++counter_;\r
- else if(counter_ == core::consumer_buffer_depth())\r
+ if(counter_++ < core::consumer_buffer_depth())\r
+ return true;\r
+\r
+ boost::thread async([=]\r
{\r
- boost::thread async([=]\r
+ try\r
{\r
- try\r
- {\r
- auto filename = narrow(env::data_folder()) + boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()) + ".png";\r
-\r
- auto bitmap = std::shared_ptr<FIBITMAP>(FreeImage_Allocate(format_desc_.width, format_desc_.height, 32), FreeImage_Unload);\r
- memcpy(FreeImage_GetBits(bitmap.get()), frame->image_data().begin(), frame->image_size());\r
- FreeImage_FlipVertical(bitmap.get());\r
- FreeImage_Save(FIF_PNG, bitmap.get(), filename.c_str(), 0);\r
- }\r
- catch(...)\r
- {\r
- CASPAR_LOG_CURRENT_EXCEPTION();\r
- }\r
- });\r
- async.detach();\r
-\r
- return false;\r
- }\r
-\r
- return true;\r
- }\r
+ auto filename = narrow(env::data_folder()) + boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()) + ".png";\r
+\r
+ auto bitmap = std::shared_ptr<FIBITMAP>(FreeImage_Allocate(format_desc_.width, format_desc_.height, 32), FreeImage_Unload);\r
+ memcpy(FreeImage_GetBits(bitmap.get()), frame->image_data().begin(), frame->image_size());\r
+ FreeImage_FlipVertical(bitmap.get());\r
+ FreeImage_Save(FIF_PNG, bitmap.get(), filename.c_str(), 0);\r
+ }\r
+ catch(...)\r
+ {\r
+ CASPAR_LOG_CURRENT_EXCEPTION();\r
+ }\r
+ });\r
+ async.detach();\r
\r
- virtual size_t buffer_depth() const{return 3;}\r
+ return false;\r
+ }\r
\r
virtual std::wstring print() const\r
{\r