explicit color_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& color) \r
: color_str_(color)\r
, frame_(create_color_frame(this, frame_factory, color))\r
- {}\r
+ {\r
+ CASPAR_LOG(info) << print() << L" Initialized";\r
+ }\r
\r
// frame_producer\r
\r
if(color2.length() != 9 || color2[0] != '#')\r
return core::frame_producer::empty();\r
\r
- return core::wrap_producer(spl::make_shared<color_producer>(frame_factory, color2));\r
+ return spl::make_shared<color_producer>(frame_factory, color2);\r
}\r
\r
draw_frame create_color_frame(void* tag, const spl::shared_ptr<frame_factory>& frame_factory, const std::wstring& color)\r
return producer;\r
} \r
\r
-class producer_proxy : public frame_producer\r
+class destroy_producer_proxy : public frame_producer\r
{ \r
std::shared_ptr<frame_producer> producer_;\r
public:\r
- producer_proxy(spl::shared_ptr<frame_producer>&& producer) \r
+ destroy_producer_proxy(spl::shared_ptr<frame_producer>&& producer) \r
: producer_(std::move(producer))\r
{\r
- CASPAR_LOG(info) << producer_->print() << L" Initialized.";\r
}\r
\r
- virtual ~producer_proxy()\r
+ virtual ~destroy_producer_proxy()\r
{ \r
static tbb::atomic<int> counter = tbb::atomic<int>();\r
\r
+ if(producer_ == core::frame_producer::empty())\r
+ return;\r
+\r
++counter;\r
CASPAR_VERIFY(counter < 32);\r
\r
}\r
catch(...){}\r
\r
- CASPAR_LOG(trace) << str << L" Uninitializing.";\r
pointer_guard.reset();\r
- CASPAR_LOG(info) << str << L" Uninitialized.";\r
+ CASPAR_LOG(info) << str << L" Destroyed.";\r
\r
--counter;\r
}); \r
virtual void unsubscribe(const monitor::observable::observer_ptr& o) {return producer_->unsubscribe(o);}\r
};\r
\r
-spl::shared_ptr<core::frame_producer> wrap_producer(spl::shared_ptr<core::frame_producer> producer)\r
+spl::shared_ptr<core::frame_producer> create_destroy_proxy(spl::shared_ptr<core::frame_producer> producer)\r
{\r
- return spl::make_shared<producer_proxy>(std::move(producer));\r
+ return spl::make_shared<destroy_producer_proxy>(std::move(producer));\r
}\r
\r
spl::shared_ptr<core::frame_producer> do_create_producer(const spl::shared_ptr<frame_factory>& my_frame_factory, const std::vector<std::wstring>& params)\r
spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<frame_factory>&, const std::vector<std::wstring>& params);\r
spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<frame_factory>&, const std::wstring& params);\r
\r
-spl::shared_ptr<core::frame_producer> wrap_producer(spl::shared_ptr<core::frame_producer> producer);\r
+spl::shared_ptr<core::frame_producer> create_destroy_proxy(spl::shared_ptr<core::frame_producer> producer);\r
\r
}}\r
, key_(core::draw_frame::late())\r
, last_frame_(core::draw_frame::empty())\r
{\r
+ CASPAR_LOG(info) << print() << L" Initialized";\r
}\r
\r
// frame_producer\r
\r
spl::shared_ptr<frame_producer> create_separated_producer(const spl::shared_ptr<frame_producer>& fill, const spl::shared_ptr<frame_producer>& key)\r
{\r
- return core::wrap_producer(spl::make_shared<separated_producer>(fill, key));\r
+ return spl::make_shared<separated_producer>(fill, key);\r
}\r
\r
}}\r
{\r
executor_.begin_invoke([=]\r
{\r
- get_layer(index).load(producer, auto_play_delta);\r
+ get_layer(index).load(create_destroy_proxy(producer), auto_play_delta); \r
}, task_priority::high_priority);\r
}\r
\r
, source_producer_(frame_producer::empty())\r
{\r
dest->subscribe(event_subject_);\r
+\r
+ CASPAR_LOG(info) << print() << L" Initialized";\r
}\r
\r
// frame_producer\r
\r
virtual void leading_producer(const spl::shared_ptr<frame_producer>& producer) override\r
{\r
- source_producer_ = producer;\r
+ source_producer_ = create_destroy_proxy(producer);\r
}\r
\r
virtual draw_frame receive(int flags) override\r
if(current_frame_ >= info_.duration)\r
return dest_producer_->receive(flags);\r
\r
- ++current_frame_;\r
-\r
event_subject_ << monitor::event("transition/frame") % current_frame_ % info_.duration\r
<< monitor::event("transition/type") % [&]() -> std::string\r
{\r
if(source == core::draw_frame::late())\r
source = source_producer_->last_frame();\r
}); \r
+ \r
+ ++current_frame_;\r
+\r
+ if(current_frame_ >= info_.duration)\r
+ source_producer_ = core::frame_producer::empty();\r
\r
return compose(dest, source);\r
}\r
\r
spl::shared_ptr<frame_producer> create_transition_producer(const field_mode& mode, const spl::shared_ptr<frame_producer>& destination, const transition_info& info)\r
{\r
- return core::wrap_producer(spl::make_shared<transition_producer>(mode, destination, info));\r
+ return spl::make_shared<transition_producer>(mode, destination, info);\r
}\r
\r
}}\r
BOOST_THROW_EXCEPTION(caspar_exception() \r
<< msg_info(print() + L" Failed to start input stream.")\r
<< boost::errinfo_api_function("StartStreams"));\r
+\r
+ CASPAR_LOG(info) << print() << L" Initialized";\r
}\r
\r
~decklink_producer()\r
if(format_desc.format == core::video_format::invalid)\r
format_desc = frame_factory->video_format_desc();\r
\r
- return core::wrap_producer(spl::make_shared<decklink_producer_proxy>(frame_factory, format_desc, device_index, filter_str, length));\r
+ return spl::make_shared<decklink_producer_proxy>(frame_factory, format_desc, device_index, filter_str, length);\r
}\r
\r
}}
\ No newline at end of file
BOOST_THROW_EXCEPTION(averror_stream_not_found() << msg_info("No streams found"));\r
\r
muxer_.reset(new frame_muxer(fps_, frame_factory, filter));\r
+\r
+ CASPAR_LOG(info) << print() << L" Initialized";\r
}\r
\r
// frame_producer\r
boost::replace_all(filter_str, L"DEINTERLACE", L"YADIF=0:-1");\r
boost::replace_all(filter_str, L"DEINTERLACE_BOB", L"YADIF=1:-1");\r
\r
- return core::wrap_producer(spl::make_shared<ffmpeg_producer>(frame_factory, filename, filter_str, loop, start, length));\r
+ return spl::make_shared<ffmpeg_producer>(frame_factory, filename, filter_str, loop, start, length);\r
}\r
\r
}}
\ No newline at end of file
auto producer = flash_producer;\r
cg_proxy(producer).add(0, filename, 1);\r
\r
- return core::wrap_producer(producer);\r
+ return producer;\r
}\r
\r
cg_proxy::cg_proxy(const spl::shared_ptr<core::frame_producer>& frame_producer) : impl_(new impl(frame_producer)){}\r
graph_->set_color("late-frame", diagnostics::color(0.6f, 0.3f, 0.9f));\r
graph_->set_text(print());\r
diagnostics::register_graph(graph_);\r
+\r
+ CASPAR_LOG(info) << print() << L" Initialized";\r
}\r
\r
~flash_producer()\r
if(!boost::filesystem::exists(filename))\r
BOOST_THROW_EXCEPTION(file_not_found() << boost::errinfo_file_name(u8(filename))); \r
\r
- return core::wrap_producer(spl::make_shared<flash_producer>(frame_factory, filename, template_host.width, template_host.height));\r
+ return spl::make_shared<flash_producer>(frame_factory, filename, template_host.width, template_host.height);\r
}\r
\r
std::wstring find_template(const std::wstring& template_name)\r
\r
std::copy_n(FreeImage_GetBits(bitmap.get()), frame->image_data(0).size(), frame->image_data(0).begin());\r
frame_ = core::draw_frame(std::move(frame));\r
+\r
+ CASPAR_LOG(info) << print() << L" Initialized";\r
}\r
\r
// frame_producer\r
if(ext == extensions.end())\r
return core::frame_producer::empty();\r
\r
- return core::wrap_producer(spl::make_shared<image_producer>(frame_factory, filename + *ext));\r
+ return spl::make_shared<image_producer>(frame_factory, filename + *ext);\r
}\r
\r
\r
if(speed == 0)\r
return core::frame_producer::empty();\r
\r
- return core::wrap_producer(spl::make_shared<image_scroll_producer>(frame_factory, filename + L"." + *ext, speed));\r
+ return spl::make_shared<image_scroll_producer>(frame_factory, filename + L"." + *ext, speed);\r
}\r
\r
}}
\ No newline at end of file
<template-path>D:\casparcg\_templates\</template-path>\r
</paths>\r
<log-level>trace</log-level>\r
- <accelerator>cpu</accelerator>\r
+ <accelerator>gpu</accelerator>\r
<flash>\r
<buffer-depth>4</buffer-depth>\r
</flash>\r