#include <common/memory/memclr.h>\r
#include <common/utility/timer.h>\r
\r
+#include <core/consumer/frame_consumer.h>\r
+\r
#include <tbb/concurrent_queue.h>\r
\r
#include <boost/timer.hpp>\r
unsigned int vid_fmt_;\r
\r
std::array<blue_dma_buffer_ptr, 4> reserved_frames_; \r
- tbb::concurrent_bounded_queue<std::shared_ptr<const core::read_frame>> frame_buffer_;\r
+ tbb::concurrent_bounded_queue<std::shared_ptr<core::read_frame>> frame_buffer_;\r
\r
int preroll_count_;\r
\r
, embedded_audio_(embedded_audio)\r
, executor_(print())\r
{\r
- executor_.set_capacity(CONSUMER_BUFFER_DEPTH);\r
+ executor_.set_capacity(core::consumer_buffer_depth());\r
\r
graph_ = diagnostics::create_graph(narrow(print()));\r
graph_->add_guide("tick-time", 0.5);\r
- graph_->set_color("tick-time", diagnostics::color(0.1f, 0.7f, 0.8f));\r
+ graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f)); \r
graph_->add_guide("frame-time", 0.5f); \r
graph_->set_color("frame-time", diagnostics::color(1.0f, 0.0f, 0.0f));\r
graph_->set_color("sync-time", diagnostics::color(0.5f, 1.0f, 0.2f));\r
\r
~bluefish_consumer()\r
{\r
- //try\r
- //{\r
- // executor_.invoke([&]\r
- // {\r
- // disable_video_output();\r
- // blue_->device_detach(); \r
- // });\r
- //}\r
- //catch(...)\r
- //{\r
- // CASPAR_LOG_CURRENT_EXCEPTION();\r
- //}\r
+ try\r
+ {\r
+ executor_.invoke([&]\r
+ {\r
+ disable_video_output();\r
+ blue_->device_detach(); \r
+ });\r
+ }\r
+ catch(...)\r
+ {\r
+ CASPAR_LOG_CURRENT_EXCEPTION();\r
+ }\r
\r
CASPAR_LOG(info) << print() << L" Shutting down."; \r
}\r
CASPAR_LOG(error)<< print() << TEXT(" Failed to disable video output."); \r
}\r
\r
- void send(const safe_ptr<const core::read_frame>& frame)\r
+ void send(const safe_ptr<core::read_frame>& frame)\r
{ \r
if(preroll_count_ < executor_.capacity())\r
{\r
schedule_next_video(frame); \r
}\r
\r
- void schedule_next_video(const safe_ptr<const core::read_frame>& frame)\r
+ void schedule_next_video(const safe_ptr<core::read_frame>& frame)\r
{\r
static std::vector<int16_t> silence(MAX_HANC_BUFFER_SIZE, 0);\r
\r
consumer_.reset(new bluefish_consumer(format_desc, device_index_, embedded_audio_));\r
}\r
\r
- virtual void send(const safe_ptr<const core::read_frame>& frame)\r
+ virtual bool send(const safe_ptr<core::read_frame>& frame)\r
{\r
consumer_->send(frame);\r
+ return true;\r
}\r
\r
virtual const core::video_format_desc& get_video_format_desc() const\r