X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fconsumer%2Fport.cpp;h=ecc19836d07c7fb92e3e9052b2155eed2efc4794;hb=9e4b08cde6c6de9e83a3fff42d90affc3cd8e5bc;hp=db3c68fa890b9ee28303eb68c4b6565ec73abf4b;hpb=b59ec2b89fbc8a2fbccaaa42d623db97a241a54b;p=casparcg diff --git a/core/consumer/port.cpp b/core/consumer/port.cpp index db3c68fa8..ecc19836d 100644 --- a/core/consumer/port.cpp +++ b/core/consumer/port.cpp @@ -14,7 +14,7 @@ struct port::impl { int index_; spl::shared_ptr monitor_subject_ = spl::make_shared("/port/" + boost::lexical_cast(index_)); - std::shared_ptr consumer_; + spl::shared_ptr consumer_; int channel_index_; public: impl(int index, int channel_index, spl::shared_ptr consumer) @@ -24,12 +24,12 @@ public: { consumer_->monitor_output().attach_parent(monitor_subject_); } - + void change_channel_format(const core::video_format_desc& format_desc, const audio_channel_layout& channel_layout) { consumer_->initialize(format_desc, channel_layout, channel_index_); } - + std::future send(const_frame frame) { *monitor_subject_ << monitor::message("/type") % consumer_->name(); @@ -64,13 +64,18 @@ public: { return consumer_->presentation_frame_age_millis(); } + + spl::shared_ptr consumer() const + { + return consumer_; + } }; port::port(int index, int channel_index, spl::shared_ptr 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;} -std::future port::send(const_frame frame){return impl_->send(std::move(frame));} +std::future port::send(const_frame frame){return impl_->send(std::move(frame));} monitor::subject& port::monitor_output() {return *impl_->monitor_subject_;} void port::change_channel_format(const core::video_format_desc& format_desc, const audio_channel_layout& channel_layout){impl_->change_channel_format(format_desc, channel_layout);} int port::buffer_depth() const{return impl_->buffer_depth();} @@ -78,4 +83,5 @@ std::wstring port::print() const{ return impl_->print();} bool port::has_synchronization_clock() const{return impl_->has_synchronization_clock();} boost::property_tree::wptree port::info() const{return impl_->info();} int64_t port::presentation_frame_age_millis() const{ return impl_->presentation_frame_age_millis(); } -}} \ No newline at end of file +spl::shared_ptr port::consumer() const { return impl_->consumer(); } +}}