return L"color";\r
}\r
\r
+ virtual spl::shared_ptr<draw_frame> last_frame() const override\r
+ {\r
+ return frame_;\r
+ }\r
+\r
boost::property_tree::wptree info() const override\r
{\r
boost::property_tree::wptree info;\r
g_factories.push_back(factory);\r
}\r
\r
-spl::shared_ptr<class draw_frame> frame_producer::last_frame() const\r
-{\r
- BOOST_THROW_EXCEPTION(not_implemented());\r
-}\r
-\r
boost::unique_future<std::wstring> frame_producer::call(const std::wstring&) \r
{\r
BOOST_THROW_EXCEPTION(not_supported());\r
class producer_proxy : public frame_producer\r
{ \r
std::shared_ptr<frame_producer> producer_;\r
- spl::shared_ptr<draw_frame> last_frame_;\r
public:\r
producer_proxy(spl::shared_ptr<frame_producer>&& producer) \r
: producer_(std::move(producer))\r
}); \r
}\r
\r
- virtual spl::shared_ptr<draw_frame> receive(int hints) override \r
- {\r
- auto frame = producer_->receive(hints);\r
- \r
- if(frame != draw_frame::late())\r
- last_frame_ = frame;\r
-\r
- return std::move(frame);\r
- }\r
- virtual spl::shared_ptr<draw_frame> last_frame() const override \r
- {\r
- return draw_frame::still(last_frame_);\r
- }\r
-\r
+ virtual spl::shared_ptr<draw_frame> receive(int flags) override {return producer_->receive(flags);}\r
+ virtual spl::shared_ptr<draw_frame> last_frame() const override {return producer_->last_frame();}\r
virtual std::wstring print() const override {return producer_->print();}\r
virtual std::wstring name() const override {return producer_->name();}\r
virtual boost::property_tree::wptree info() const override {return producer_->info();}\r
virtual uint32_t nb_frames() const {return std::numeric_limits<uint32_t>::max();}\r
\r
virtual spl::shared_ptr<class draw_frame> receive(int flags) = 0;\r
- virtual spl::shared_ptr<class draw_frame> last_frame() const;\r
+ virtual spl::shared_ptr<class draw_frame> last_frame() const = 0;\r
\r
static const spl::shared_ptr<frame_producer>& empty(); // nothrow\r
\r
spl::shared_ptr<frame_producer> key_producer_;\r
spl::shared_ptr<draw_frame> fill_;\r
spl::shared_ptr<draw_frame> key_;\r
- \r
+ spl::shared_ptr<draw_frame> last_frame_;\r
+ \r
explicit separated_producer(const spl::shared_ptr<frame_producer>& fill, const spl::shared_ptr<frame_producer>& key) \r
: fill_producer_(fill)\r
, key_producer_(key)\r
, fill_(core::draw_frame::late())\r
, key_(core::draw_frame::late())\r
+ , last_frame_(core::draw_frame::empty())\r
{\r
}\r
\r
\r
fill_ = draw_frame::late();\r
key_ = draw_frame::late();\r
+ \r
+ if(frame != core::draw_frame::late())\r
+ last_frame_ = frame;\r
\r
return frame;\r
}\r
- \r
+\r
+ virtual spl::shared_ptr<draw_frame> last_frame() const override\r
+ {\r
+ return draw_frame::still(last_frame_);\r
+ }\r
+ \r
virtual uint32_t nb_frames() const override\r
{\r
return std::min(fill_producer_->nb_frames(), key_producer_->nb_frames());\r
int current_frame_;\r
\r
const transition_info info_;\r
+\r
+ spl::shared_ptr<draw_frame> last_frame_;\r
\r
spl::shared_ptr<frame_producer> dest_producer_;\r
spl::shared_ptr<frame_producer> source_producer_;\r
: mode_(mode)\r
, current_frame_(0)\r
, info_(info)\r
+ , last_frame_(draw_frame::empty())\r
, dest_producer_(dest)\r
, source_producer_(frame_producer::empty())\r
{\r
\r
return compose(dest, source);\r
}\r
+\r
+ virtual spl::shared_ptr<draw_frame> last_frame() const override\r
+ {\r
+ return dest_producer_->last_frame();\r
+ }\r
\r
virtual uint32_t nb_frames() const override\r
{\r
{ \r
std::unique_ptr<decklink_producer> producer_;\r
const uint32_t length_;\r
+ spl::shared_ptr<core::draw_frame> last_frame_;\r
executor executor_;\r
public:\r
explicit decklink_producer_proxy(const spl::shared_ptr<core::frame_factory>& frame_factory, const core::video_format_desc& format_desc, size_t device_index, const std::wstring& filter_str, uint32_t length)\r
: executor_(L"decklink_producer[" + boost::lexical_cast<std::wstring>(device_index) + L"]")\r
, length_(length)\r
+ , last_frame_(core::draw_frame::empty())\r
{\r
executor_.invoke([=]\r
{\r
\r
virtual spl::shared_ptr<core::draw_frame> receive(int flags) override\r
{\r
- return producer_->get_frame(flags);\r
+ auto frame = producer_->get_frame(flags);\r
+\r
+ if(frame != core::draw_frame::late())\r
+ last_frame_ = frame;\r
+\r
+ return frame;\r
+ }\r
+\r
+ virtual spl::shared_ptr<core::draw_frame> last_frame() const override\r
+ {\r
+ return core::draw_frame::still(last_frame_);\r
}\r
\r
virtual uint32_t nb_frames() const override\r
const uint32_t length_;\r
\r
int64_t frame_number_;\r
+\r
+ spl::shared_ptr<core::draw_frame> last_frame_;\r
\r
public:\r
explicit ffmpeg_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, const std::wstring& filter, bool loop, uint32_t start, uint32_t length) \r
, start_(start)\r
, length_(length)\r
, frame_number_(0)\r
+ , last_frame_(core::draw_frame::empty())\r
{\r
graph_->set_color("frame-time", diagnostics::color(0.1f, 1.0f, 0.1f));\r
graph_->set_color("underflow", diagnostics::color(0.6f, 0.3f, 0.9f)); \r
++frame_number_;\r
\r
graph_->set_text(print());\r
+ \r
+ if(frame != core::draw_frame::late())\r
+ last_frame_ = spl::make_shared_ptr(frame);\r
\r
return spl::make_shared_ptr(frame);\r
}\r
+\r
+ virtual spl::shared_ptr<core::draw_frame> last_frame() const override\r
+ {\r
+ return core::draw_frame::still(last_frame_);\r
+ }\r
\r
virtual uint32_t nb_frames() const override\r
{\r
\r
std::unique_ptr<flash_renderer> renderer_;\r
\r
+ spl::shared_ptr<core::draw_frame> last_frame_;\r
+\r
executor executor_; \r
public:\r
flash_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, int width, int height) \r
, width_(width > 0 ? width : frame_factory->video_format_desc().width)\r
, height_(height > 0 ? height : frame_factory->video_format_desc().height)\r
, buffer_size_(env::properties().get(L"configuration.flash.buffer-depth", frame_factory_->video_format_desc().fps > 30.0 ? 4 : 2))\r
+ , last_frame_(core::draw_frame::empty())\r
, executor_(L"flash_producer")\r
{ \r
sync_ = true;\r
\r
if(output_buffer_.try_pop(frame)) \r
executor_.begin_invoke(std::bind(&flash_producer::next, this)); \r
- else\r
- graph_->set_tag("late-frame");\r
- \r
+ else \r
+ graph_->set_tag("late-frame"); \r
+\r
+ if(frame != core::draw_frame::late())\r
+ last_frame_ = frame;\r
+ \r
return frame;\r
}\r
+\r
+ virtual spl::shared_ptr<core::draw_frame> last_frame() const override\r
+ {\r
+ return core::draw_frame::still(last_frame_);\r
+ }\r
\r
virtual boost::unique_future<std::wstring> call(const std::wstring& param) override\r
{ \r
{\r
return frame_;\r
}\r
+\r
+ virtual spl::shared_ptr<core::draw_frame> last_frame() const override\r
+ {\r
+ return frame_;\r
+ }\r
\r
virtual std::wstring print() const override\r
{\r
\r
std::array<double, 2> start_offset_;\r
\r
+ spl::shared_ptr<core::draw_frame> last_frame_;\r
+\r
explicit image_scroll_producer(const spl::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, int speed) \r
: filename_(filename)\r
, delta_(0)\r
, format_desc_(frame_factory->video_format_desc())\r
, speed_(speed)\r
+ , last_frame_(core::draw_frame::empty())\r
{\r
start_offset_.assign(0.0);\r
\r
}\r
}\r
\r
- return spl::make_shared<core::draw_frame>(frames_);\r
+ return last_frame_ = spl::make_shared<core::draw_frame>(frames_);\r
+ }\r
+\r
+ virtual spl::shared_ptr<core::draw_frame> last_frame() const override\r
+ {\r
+ return core::draw_frame::still(last_frame_);\r
}\r
\r
virtual std::wstring print() const override\r
std::queue<spl::shared_ptr<core::draw_frame>> frame_buffer_;\r
uint64_t frame_number_;\r
\r
+ spl::shared_ptr<core::draw_frame> last_frame_;\r
+\r
public:\r
explicit reroute_producer(const spl::shared_ptr<core::frame_factory>& frame_factory) \r
: frame_factory_(frame_factory)\r
, frame_number_(0)\r
+ , last_frame_(core::draw_frame::empty())\r
{\r
graph_->set_color("late-frame", diagnostics::color(0.6f, 0.3f, 0.3f));\r
graph_->set_color("dropped-frame", diagnostics::color(0.3f, 0.6f, 0.3f));\r
{\r
auto frame = frame_buffer_.front();\r
frame_buffer_.pop();\r
- return frame;\r
+ return last_frame_ = frame;\r
}\r
\r
std::shared_ptr<const core::data_frame> read_frame;\r
\r
return receive(0);\r
} \r
+\r
+ virtual spl::shared_ptr<core::draw_frame> last_frame() const override\r
+ {\r
+ return core::draw_frame::still(last_frame_);\r
+ }\r
\r
virtual std::wstring print() const override\r
{\r