]> git.sesse.net Git - casparcg/blobdiff - core/consumer/port.cpp
set svn:eol-style native on .h and .cpp files
[casparcg] / core / consumer / port.cpp
index 39cd2721225244b43e484ae7eaab971631e744ec..ca2b063dd0a90bacd1fad794b82d433ef005459c 100644 (file)
@@ -1,69 +1,69 @@
-#include "../StdAfx.h"\r
-\r
-#include "port.h"\r
-\r
-#include "frame_consumer.h"\r
-#include "../frame/frame.h"\r
-\r
-namespace caspar { namespace core {\r
-\r
-struct port::impl\r
-{\r
-       monitor::basic_subject                          event_subject_;\r
-       std::shared_ptr<frame_consumer>         consumer_;\r
-       int                                                                     index_;\r
-       int                                                                     channel_index_;\r
-public:\r
-       impl(int index, int channel_index, spl::shared_ptr<frame_consumer> consumer)\r
-               : event_subject_(monitor::path("port") % index)\r
-               , consumer_(std::move(consumer))\r
-               , index_(index)\r
-               , channel_index_(channel_index)\r
-       {\r
-               consumer_->subscribe(event_subject_);\r
-       }\r
-       \r
-       void video_format_desc(const struct video_format_desc& format_desc)\r
-       {\r
-               consumer_->initialize(format_desc, channel_index_);\r
-       }\r
-               \r
-       bool send(const_frame frame)\r
-       {\r
-               event_subject_ << monitor::event("type") % consumer_->name();\r
-               return consumer_->send(std::move(frame));\r
-       }\r
-       \r
-       int index() const\r
-       {\r
-               return index_;\r
-       }\r
-\r
-       int buffer_depth() const\r
-       {\r
-               return consumer_->buffer_depth();\r
-       }\r
-\r
-       bool has_synchronization_clock() const\r
-       {\r
-               return consumer_->has_synchronization_clock();\r
-       }\r
-\r
-       boost::property_tree::wptree info() const\r
-       {\r
-               return consumer_->info();\r
-       }\r
-};\r
-\r
-port::port(int index, int channel_index, spl::shared_ptr<frame_consumer> consumer) : impl_(new impl(index, channel_index, std::move(consumer))){}\r
-port::port(port&& other) : impl_(std::move(other.impl_)){}\r
-port::~port(){}\r
-port& port::operator=(port&& other){impl_ = std::move(other.impl_); return *this;}\r
-bool port::send(const_frame frame){return impl_->send(std::move(frame));}      \r
-void port::subscribe(const monitor::observable::observer_ptr& o){impl_->event_subject_.subscribe(o);}\r
-void port::unsubscribe(const monitor::observable::observer_ptr& o){impl_->event_subject_.unsubscribe(o);}\r
-void port::video_format_desc(const struct video_format_desc& format_desc){impl_->video_format_desc(format_desc);}\r
-int port::buffer_depth() const{return impl_->buffer_depth();}\r
-bool port::has_synchronization_clock() const{return impl_->has_synchronization_clock();}\r
-boost::property_tree::wptree port::info() const{return impl_->info();}\r
+#include "../StdAfx.h"
+
+#include "port.h"
+
+#include "frame_consumer.h"
+#include "../frame/frame.h"
+
+namespace caspar { namespace core {
+
+struct port::impl
+{
+       monitor::basic_subject                          event_subject_;
+       std::shared_ptr<frame_consumer>         consumer_;
+       int                                                                     index_;
+       int                                                                     channel_index_;
+public:
+       impl(int index, int channel_index, spl::shared_ptr<frame_consumer> consumer)
+               : event_subject_(monitor::path("port") % index)
+               , consumer_(std::move(consumer))
+               , index_(index)
+               , channel_index_(channel_index)
+       {
+               consumer_->subscribe(event_subject_);
+       }
+       
+       void video_format_desc(const struct video_format_desc& format_desc)
+       {
+               consumer_->initialize(format_desc, channel_index_);
+       }
+               
+       bool send(const_frame frame)
+       {
+               event_subject_ << monitor::event("type") % consumer_->name();
+               return consumer_->send(std::move(frame));
+       }
+       
+       int index() const
+       {
+               return index_;
+       }
+
+       int buffer_depth() const
+       {
+               return consumer_->buffer_depth();
+       }
+
+       bool has_synchronization_clock() const
+       {
+               return consumer_->has_synchronization_clock();
+       }
+
+       boost::property_tree::wptree info() const
+       {
+               return consumer_->info();
+       }
+};
+
+port::port(int index, int channel_index, spl::shared_ptr<frame_consumer> consumer) : impl_(new impl(index, channel_index, std::move(consumer))){}
+port::port(port&& other) : impl_(std::move(other.impl_)){}
+port::~port(){}
+port& port::operator=(port&& other){impl_ = std::move(other.impl_); return *this;}
+bool port::send(const_frame frame){return impl_->send(std::move(frame));}      
+void port::subscribe(const monitor::observable::observer_ptr& o){impl_->event_subject_.subscribe(o);}
+void port::unsubscribe(const monitor::observable::observer_ptr& o){impl_->event_subject_.unsubscribe(o);}
+void port::video_format_desc(const struct video_format_desc& format_desc){impl_->video_format_desc(format_desc);}
+int port::buffer_depth() const{return impl_->buffer_depth();}
+bool port::has_synchronization_clock() const{return impl_->has_synchronization_clock();}
+boost::property_tree::wptree port::info() const{return impl_->info();}
 }}
\ No newline at end of file