const configuration config_;\r
com_context<decklink_consumer> context_;\r
core::video_format_desc format_desc_;\r
- size_t fail_count_;\r
public:\r
\r
decklink_consumer_proxy(const configuration& config)\r
: config_(config)\r
, context_(L"decklink_consumer[" + boost::lexical_cast<std::wstring>(config.device_index) + L"]")\r
- , fail_count_(0)\r
{\r
}\r
\r
\r
virtual bool send(const safe_ptr<core::read_frame>& frame)\r
{\r
- if(!context_)\r
- context_.reset([&]{return new decklink_consumer(config_, format_desc_);});\r
-\r
- try\r
- {\r
- context_->send(frame);\r
- fail_count_ = 0;\r
- }\r
- catch(...)\r
- {\r
- context_.reset();\r
-\r
- if(fail_count_++ > 3)\r
- return false; // Outside didn't handle exception properly, just give up.\r
- \r
- throw;\r
- }\r
-\r
+ context_->send(frame);\r
return true;\r
}\r
\r