#include "../util/util.h"\r
#include "../util/memory.h"\r
\r
-#include <mixer/frame/read_frame.h>\r
+#include <core/consumer/frame/read_frame.h>\r
\r
#include <common/concurrency/executor.h>\r
#include <common/diagnostics/graph.h>\r
+#include <common/memory/memcpy.h>\r
#include <common/utility/timer.h>\r
\r
#include <tbb/concurrent_queue.h>\r
\r
+#include <boost/timer.hpp>\r
+\r
#include <BlueVelvet4.h>\r
#include <BlueHancUtils.h>\r
\r
\r
struct bluefish_consumer::implementation : boost::noncopyable\r
{\r
- printer parent_printer_;\r
std::wstring model_name_;\r
const unsigned int device_index_;\r
\r
std::shared_ptr<diagnostics::graph> graph_;\r
- timer perf_timer_;\r
+ boost::timer perf_timer_;\r
\r
boost::unique_future<void> active_;\r
\r
CASPAR_LOG(info) << print() << L" Shutting down."; \r
}\r
\r
- void initialize(const core::video_format_desc& format_desc, const printer& parent_printer)\r
+ void initialize(const core::video_format_desc& format_desc)\r
{ \r
format_desc_ = format_desc;\r
- parent_printer_ = parent_printer;\r
\r
blue_.reset(BlueVelvetFactory4());\r
\r
{\r
try\r
{\r
- std::copy_n(frame->image_data().begin(), frame->image_data().size(), reserved_frames_.front()->image_data());\r
-\r
- unsigned long n_field = 0;\r
- blue_->wait_output_video_synch(UPD_FMT_FRAME, n_field);\r
+ fast_memcpy(reserved_frames_.front()->image_data(), frame->image_data().begin(), frame->image_data().size());\r
\r
if(embed_audio_)\r
{ \r
CASPAR_LOG(warning) << print() << TEXT(" render_buffer_update failed.");\r
}\r
\r
+ unsigned long n_field = 0;\r
+ blue_->wait_output_video_synch(UPD_FMT_FRAME, n_field);\r
+\r
std::rotate(reserved_frames_.begin(), reserved_frames_.begin() + 1, reserved_frames_.end());\r
graph_->update_value("tick-time", static_cast<float>(perf_timer_.elapsed()/format_desc_.interval*0.5));\r
- perf_timer_.reset();\r
+ perf_timer_.restart();\r
}\r
catch(...)\r
{\r
\r
std::wstring print() const\r
{\r
- return (parent_printer_ ? parent_printer_() + L"/" : L"") + model_name_ + L" [" + boost::lexical_cast<std::wstring>(device_index_) + L"]";\r
+ return model_name_ + L" [" + boost::lexical_cast<std::wstring>(device_index_) + L"]";\r
}\r
};\r
\r
-bluefish_consumer::bluefish_consumer(bluefish_consumer&& other) : impl_(std::move(other.impl_)){}\r
bluefish_consumer::bluefish_consumer(unsigned int device_index, bool embed_audio) : impl_(new implementation(device_index, embed_audio)){} \r
-void bluefish_consumer::initialize(const core::video_format_desc& format_desc, const printer& parent_printer){impl_->initialize(format_desc, parent_printer);}\r
+bluefish_consumer::bluefish_consumer(bluefish_consumer&& other) : impl_(std::move(other.impl_)){}\r
+void bluefish_consumer::initialize(const core::video_format_desc& format_desc)\r
+{\r
+ // TODO: Ugly\r
+ impl_.reset(new implementation(impl_->device_index_, impl_->embed_audio_));\r
+ impl_->initialize(format_desc);\r
+}\r
void bluefish_consumer::send(const safe_ptr<const core::read_frame>& frame){impl_->send(frame);}\r
size_t bluefish_consumer::buffer_depth() const{return impl_->buffer_depth();}\r
std::wstring bluefish_consumer::print() const {return impl_->print();} \r