struct port::impl
{
- spl::shared_ptr<monitor::subject> monitor_subject_;
- std::shared_ptr<frame_consumer> consumer_;
int index_;
+ spl::shared_ptr<monitor::subject> monitor_subject_ = spl::make_shared<monitor::subject>("/port/" + boost::lexical_cast<std::string>(index_));
+ spl::shared_ptr<frame_consumer> consumer_;
int channel_index_;
public:
impl(int index, int channel_index, spl::shared_ptr<frame_consumer> consumer)
- : monitor_subject_(spl::make_shared<monitor::subject>(
- "/port" + boost::lexical_cast<std::string>(index)))
+ : index_(index)
, consumer_(std::move(consumer))
- , index_(index)
, channel_index_(channel_index)
{
consumer_->monitor_output().attach_parent(monitor_subject_);
}
-
- void video_format_desc(const struct video_format_desc& format_desc)
+
+ void change_channel_format(const core::video_format_desc& format_desc, const audio_channel_layout& channel_layout)
{
- consumer_->initialize(format_desc, channel_index_);
+ consumer_->initialize(format_desc, channel_layout, channel_index_);
}
-
+
std::future<bool> send(const_frame frame)
{
*monitor_subject_ << monitor::message("/type") % consumer_->name();
{
return consumer_->info();
}
+
+ int64_t presentation_frame_age_millis() const
+ {
+ return consumer_->presentation_frame_age_millis();
+ }
+
+ spl::shared_ptr<const frame_consumer> consumer() const
+ {
+ return consumer_;
+ }
};
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;}
-std::future<bool> port::send(const_frame frame){return impl_->send(std::move(frame));}
+std::future<bool> port::send(const_frame frame){return impl_->send(std::move(frame));}
monitor::subject& port::monitor_output() {return *impl_->monitor_subject_;}
-void port::video_format_desc(const struct video_format_desc& format_desc){impl_->video_format_desc(format_desc);}
+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();}
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();}
-}}
\ No newline at end of file
+int64_t port::presentation_frame_age_millis() const{ return impl_->presentation_frame_age_millis(); }
+spl::shared_ptr<const frame_consumer> port::consumer() const { return impl_->consumer(); }
+}}