return make_safe<write_frame>(ogl_, tag, desc);\r
}\r
\r
- boost::unique_future<safe_ptr<write_frame>> create_frame2(const void* tag, const pixel_format_desc& desc)\r
+ boost::unique_future<safe_ptr<write_frame>> async_create_frame(const void* tag, const pixel_format_desc& desc)\r
{\r
return ogl_.begin_invoke([=]{return make_safe<write_frame>(ogl_, tag, desc);}, high_priority);\r
}\r
void image_mixer::end(){impl_->end();}\r
boost::unique_future<safe_ptr<host_buffer>> image_mixer::render(){return impl_->render();}\r
safe_ptr<write_frame> image_mixer::create_frame(const void* tag, const pixel_format_desc& desc){return impl_->create_frame(tag, desc);}\r
-boost::unique_future<safe_ptr<write_frame>> image_mixer::create_frame2(const void* tag, const pixel_format_desc& desc){return impl_->create_frame2(tag, desc);}\r
+boost::unique_future<safe_ptr<write_frame>> image_mixer::async_create_frame(const void* tag, const pixel_format_desc& desc){return impl_->async_create_frame(tag, desc);}\r
void image_mixer::begin_layer(blend_mode::type blend_mode){impl_->begin_layer(blend_mode);}\r
void image_mixer::end_layer(){impl_->end_layer();}\r
image_mixer& image_mixer::operator=(image_mixer&& other)\r
boost::unique_future<safe_ptr<host_buffer>> render();\r
\r
safe_ptr<write_frame> create_frame(const void* tag, const pixel_format_desc& format);\r
- boost::unique_future<safe_ptr<write_frame>> create_frame2(const void* tag, const pixel_format_desc& format);\r
+ boost::unique_future<safe_ptr<write_frame>> async_create_frame(const void* tag, const pixel_format_desc& format);\r
\r
private:\r
struct implementation;\r
return msg->transfer<safe_ptr<core::read_frame>>(std::move(frame)); \r
}\r
\r
- safe_ptr<core::write_frame> create_frame(const void* tag, const core::pixel_format_desc& desc)\r
+ boost::unique_future<safe_ptr<core::write_frame>> async_create_frame(const void* tag, const core::pixel_format_desc& desc)\r
{ \r
- return image_mixer_.create_frame(tag, desc);\r
- }\r
-\r
- boost::unique_future<safe_ptr<core::write_frame>> create_frame2(const void* tag, const core::pixel_format_desc& desc)\r
- { \r
- return image_mixer_.create_frame2(tag, desc);\r
+ return image_mixer_.async_create_frame(tag, desc);\r
}\r
\r
void set_transform(int index, const frame_transform& transform, unsigned int mix_duration, const std::wstring& tween)\r
\r
mixer::mixer(mixer::source_t& source, mixer::target_t& target, const video_format_desc& format_desc, ogl_device& ogl) : impl_(new implementation(source, target, format_desc, ogl)){}\r
core::video_format_desc mixer::get_video_format_desc() const { return impl_->format_desc_; }\r
-safe_ptr<core::write_frame> mixer::create_frame(const void* tag, const core::pixel_format_desc& desc){ return impl_->create_frame(tag, desc); } \r
-boost::unique_future<safe_ptr<write_frame>> mixer::create_frame2(const void* video_stream_tag, const pixel_format_desc& desc){ return impl_->create_frame2(video_stream_tag, desc); } \r
+boost::unique_future<safe_ptr<write_frame>> mixer::async_create_frame(const void* video_stream_tag, const pixel_format_desc& desc){ return impl_->async_create_frame(video_stream_tag, desc); } \r
void mixer::set_frame_transform(int index, const core::frame_transform& transform, unsigned int mix_duration, const std::wstring& tween){impl_->set_transform(index, transform, mix_duration, tween);}\r
void mixer::apply_frame_transform(int index, const std::function<core::frame_transform(core::frame_transform)>& transform, unsigned int mix_duration, const std::wstring& tween){impl_->apply_transform(index, transform, mix_duration, tween);}\r
void mixer::clear_transforms(){impl_->clear_transforms();}\r
typedef Concurrency::ITarget<safe_ptr<message<safe_ptr<core::read_frame>>>> target_t;\r
\r
explicit mixer(source_t& source, target_t& target, const video_format_desc& format_desc, ogl_device& ogl);\r
- \r
- safe_ptr<core::write_frame> create_frame(const void* tag, const core::pixel_format_desc& desc); \r
- boost::unique_future<safe_ptr<write_frame>> create_frame2(const void* video_stream_tag, const pixel_format_desc& desc);\r
+ \r
+ boost::unique_future<safe_ptr<write_frame>> async_create_frame(const void* video_stream_tag, const pixel_format_desc& desc);\r
\r
core::video_format_desc get_video_format_desc() const; // nothrow\r
\r
\r
struct frame_factory : boost::noncopyable\r
{\r
- virtual safe_ptr<write_frame> create_frame(const void* video_stream_tag, const pixel_format_desc& desc) = 0;\r
- virtual safe_ptr<write_frame> create_frame(const void* video_stream_tag, size_t width, size_t height, pixel_format::type pix_fmt = pixel_format::bgra)\r
- { \r
- // Create bgra frame\r
- core::pixel_format_desc desc;\r
- desc.pix_fmt = pix_fmt;\r
- desc.planes.push_back( core::pixel_format_desc::plane(width, height, 4));\r
- return create_frame(video_stream_tag, desc);\r
- }\r
- \r
- virtual boost::unique_future<safe_ptr<write_frame>> create_frame2(const void* video_stream_tag, const pixel_format_desc& desc) = 0;\r
-\r
- virtual video_format_desc get_video_format_desc() const = 0; // nothrow\r
-};\r
- \r
-class concrt_frame_factory : public frame_factory\r
-{ \r
- safe_ptr<frame_factory> factory_;\r
-public:\r
- concrt_frame_factory(const safe_ptr<frame_factory>& factory) \r
- : factory_(factory)\r
- {\r
- }\r
- \r
- virtual safe_ptr<write_frame> create_frame(const void* tag, const pixel_format_desc& desc)\r
+ safe_ptr<write_frame> create_frame(const void* tag, const pixel_format_desc& desc)\r
{\r
- auto frame = factory_->create_frame2(tag, desc);\r
+ auto frame = async_create_frame(tag, desc);\r
\r
Concurrency::wait(0);\r
\r
return frame.get();\r
}\r
\r
- virtual boost::unique_future<safe_ptr<write_frame>> create_frame2(const void* video_stream_tag, const pixel_format_desc& desc)\r
- {\r
- return factory_->create_frame2(video_stream_tag, desc);\r
+ safe_ptr<write_frame> create_frame(const void* video_stream_tag, size_t width, size_t height, pixel_format::type pix_fmt = pixel_format::bgra)\r
+ { \r
+ // Create bgra frame\r
+ core::pixel_format_desc desc;\r
+ desc.pix_fmt = pix_fmt;\r
+ desc.planes.push_back( core::pixel_format_desc::plane(width, height, 4));\r
+ return create_frame(video_stream_tag, desc);\r
}\r
\r
- virtual video_format_desc get_video_format_desc() const\r
- {\r
- return factory_->get_video_format_desc();\r
- }\r
+ virtual video_format_desc get_video_format_desc() const = 0; // nothrow\r
+private:\r
+ \r
+ virtual boost::unique_future<safe_ptr<write_frame>> async_create_frame(const void* video_stream_tag, const pixel_format_desc& desc) = 0;\r
};\r
-\r
+ \r
}}
\ No newline at end of file
, in_fps_(in_fps)\r
, format_desc_(frame_factory->get_video_format_desc())\r
, auto_transcode_(env::properties().get("configuration.producers.auto-transcode", false))\r
- , frame_factory_(make_safe<core::concrt_frame_factory>(frame_factory))\r
+ , frame_factory_(frame_factory)\r
, push_video_(std::bind(&implementation::push_video, this, std::placeholders::_1))\r
, push_audio_(std::bind(&implementation::push_audio, this, std::placeholders::_1))\r
{\r
public:\r
flash_renderer(const safe_ptr<diagnostics::graph>& graph, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, int width, int height) \r
: filename_(filename)\r
- , frame_factory_(make_safe<core::concrt_frame_factory>(frame_factory))\r
+ , frame_factory_(frame_factory)\r
, graph_(graph)\r
, ax_(nullptr)\r
, head_(core::basic_frame::empty())\r