if(!has_synchronization_clock())\r
sync_timer_.tick(1.0/format_desc_.fps);\r
\r
- if(input_frame->image_size() != format_desc_.size)\r
+ if(input_frame->image_data().size() != format_desc_.size)\r
{\r
sync_timer_.tick(1.0/format_desc_.fps);\r
return;\r
\r
namespace caspar { namespace core {\r
\r
-class output : public target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>>\r
+class output sealed : public target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>>\r
, boost::noncopyable\r
{\r
public:\r
\r
typedef std::vector<int32_t, tbb::cache_aligned_allocator<int32_t>> audio_buffer;\r
\r
-class audio_mixer : public core::frame_visitor, boost::noncopyable\r
+class audio_mixer sealed : public core::frame_visitor, boost::noncopyable\r
{\r
public:\r
audio_mixer(const safe_ptr<diagnostics::graph>& graph);\r
}\r
};\r
\r
-class image_kernel : boost::noncopyable\r
+class image_kernel sealed : boost::noncopyable\r
{\r
public:\r
image_kernel(const safe_ptr<ogl_device>& ogl);\r
struct video_format_desc;\r
struct pixel_format_desc;\r
\r
-class image_mixer : public core::frame_visitor, boost::noncopyable\r
+class image_mixer sealed : public core::frame_visitor, boost::noncopyable\r
{\r
public:\r
image_mixer(const safe_ptr<ogl_device>& ogl);\r
\r
graph_->update_value("mix-time", mix_timer_.elapsed()*format_desc_.fps*0.5);\r
\r
- target_->send(std::make_pair(make_safe<read_frame>(ogl_, format_desc_.size, std::move(image.get()), std::move(audio)), packet.second)); \r
+ target_->send(std::make_pair(make_safe<read_frame>(ogl_, format_desc_.width, format_desc_.height, std::move(image.get()), std::move(audio)), packet.second)); \r
}\r
catch(...)\r
{\r
struct frame_transform;\r
struct pixel_format;\r
\r
-class mixer : public target<std::pair<std::map<int, safe_ptr<core::basic_frame>>, std::shared_ptr<void>>>\r
+class mixer sealed : public target<std::pair<std::map<int, safe_ptr<core::basic_frame>>, std::shared_ptr<void>>>\r
, public core::frame_factory\r
{\r
public: \r
struct read_frame::implementation : boost::noncopyable\r
{\r
safe_ptr<ogl_device> ogl_;\r
- int size_;\r
+ int width_;\r
+ int height_;\r
safe_ptr<host_buffer> image_data_;\r
tbb::mutex mutex_;\r
audio_buffer audio_data_;\r
\r
public:\r
- implementation(const safe_ptr<ogl_device>& ogl, int size, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data) \r
+ implementation(const safe_ptr<ogl_device>& ogl, int width, int height, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data) \r
: ogl_(ogl)\r
- , size_(size)\r
+ , width_(width)\r
+ , height_(height)\r
, image_data_(std::move(image_data))\r
, audio_data_(std::move(audio_data)){} \r
\r
}\r
};\r
\r
-read_frame::read_frame(const safe_ptr<ogl_device>& ogl, int size, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data) \r
- : impl_(new implementation(ogl, size, std::move(image_data), std::move(audio_data))){}\r
+read_frame::read_frame(const safe_ptr<ogl_device>& ogl, int width, int height, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data) \r
+ : impl_(new implementation(ogl, width, height, std::move(image_data), std::move(audio_data))){}\r
read_frame::read_frame(){}\r
const boost::iterator_range<const uint8_t*> read_frame::image_data()\r
{\r
return impl_ ? impl_->audio_data() : boost::iterator_range<const int32_t*>();\r
}\r
\r
-int read_frame::image_size() const{return impl_ ? impl_->size_ : 0;}\r
+int read_frame::width() const{return impl_ ? impl_->width_ : 0;}\r
+int read_frame::height() const{return impl_ ? impl_->height_ : 0;}\r
\r
//#include <tbb/scalable_allocator.h>\r
//#include <tbb/parallel_for.h>\r
class host_buffer;\r
class ogl_device;\r
\r
-class read_frame : boost::noncopyable\r
+class read_frame sealed : boost::noncopyable\r
{\r
public:\r
read_frame();\r
- read_frame(const safe_ptr<ogl_device>& ogl, int size, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data);\r
+ read_frame(const safe_ptr<ogl_device>& ogl, int width, int height, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data);\r
\r
- virtual const boost::iterator_range<const uint8_t*> image_data();\r
- virtual const boost::iterator_range<const int32_t*> audio_data();\r
+ const boost::iterator_range<const uint8_t*> image_data();\r
+ const boost::iterator_range<const int32_t*> audio_data();\r
\r
- virtual int image_size() const;\r
+ int width() const;\r
+ int height() const;\r
\r
private:\r
struct implementation;\r
struct pixel_format_desc;\r
class ogl_device; \r
\r
-class write_frame : public core::basic_frame, boost::noncopyable\r
+class write_frame sealed : public core::basic_frame, boost::noncopyable\r
{\r
public: \r
explicit write_frame(const void* tag);\r
\r
struct pixel_format_desc;\r
\r
-struct levels\r
+struct levels sealed\r
{\r
levels() \r
: min_input(0.0)\r
double max_output;\r
};\r
\r
-struct frame_transform \r
+struct frame_transform sealed\r
{\r
public:\r
\r
};\r
};\r
\r
-struct pixel_format_desc\r
+struct pixel_format_desc sealed\r
{\r
struct plane\r
{\r
struct frame_producer;\r
class basic_frame;\r
\r
-class layer : boost::noncopyable\r
+class layer sealed : boost::noncopyable\r
{\r
public:\r
layer(); // nothrow\r
struct video_format_desc;\r
struct frame_transform;\r
\r
-class stage : boost::noncopyable\r
+class stage sealed : boost::noncopyable\r
{\r
public:\r
typedef target<std::pair<std::map<int, safe_ptr<basic_frame>>, std::shared_ptr<void>>> target_t;\r
class ogl_device;\r
struct video_format_desc;\r
\r
-class video_channel : boost::noncopyable\r
+class video_channel sealed : boost::noncopyable\r
{\r
public:\r
explicit video_channel(int index, const video_format_desc& format_desc, const safe_ptr<ogl_device>& ogl);\r
}\r
};\r
\r
-struct video_format_desc\r
+struct video_format_desc sealed\r
{\r
- video_format::type format; // video output format\r
+ video_format::type format; // video output format\r
\r
int width; // output frame width\r
int height; // output frame height\r
\r
struct image_consumer : public core::frame_consumer\r
{\r
- core::video_format_desc format_desc_;\r
public:\r
\r
// frame_consumer\r
\r
- virtual void initialize(const core::video_format_desc& format_desc, int) override\r
+ virtual void initialize(const core::video_format_desc&, int) override\r
{\r
- format_desc_ = format_desc;\r
}\r
\r
virtual bool send(const safe_ptr<core::read_frame>& frame) override\r
{ \r
- auto format_desc = format_desc_;\r
- boost::thread async([format_desc, frame]\r
+ boost::thread async([frame]\r
{\r
try\r
{\r
auto filename = u8(env::data_folder()) + boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()) + ".png";\r
\r
- auto bitmap = std::shared_ptr<FIBITMAP>(FreeImage_Allocate(format_desc.width, format_desc.height, 32), FreeImage_Unload);\r
- A_memcpy(FreeImage_GetBits(bitmap.get()), frame->image_data().begin(), frame->image_size());\r
+ auto bitmap = std::shared_ptr<FIBITMAP>(FreeImage_Allocate(frame->width(), frame->height(), 32), FreeImage_Unload);\r
+ A_memcpy(FreeImage_GetBits(bitmap.get()), frame->image_data().begin(), frame->image_data().size());\r
FreeImage_FlipVertical(bitmap.get());\r
FreeImage_Save(FIF_PNG, bitmap.get(), filename.c_str(), 0);\r
}\r
class video_channel;\r
}\r
\r
-class server : boost::noncopyable\r
+class server sealed : boost::noncopyable\r
{\r
public:\r
server();\r