X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fconsumer%2Foutput.h;h=85a925632ad778ca4d0c4becdb1ffd45a70ed103;hb=8b76b9692cdf7305754e28a9cfcaf6782582fe08;hp=2fdc33aef1af36ace82bf8ca5d52e901a5dbe193;hpb=126f680b450e8d8cfe71b1b410df05bf584a2403;p=casparcg diff --git a/core/consumer/output.h b/core/consumer/output.h index 2fdc33aef..85a925632 100644 --- a/core/consumer/output.h +++ b/core/consumer/output.h @@ -1,61 +1,73 @@ -/* -* Copyright (c) 2011 Sveriges Television AB -* -* This file is part of CasparCG (www.casparcg.com). -* -* CasparCG is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* CasparCG is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with CasparCG. If not, see . -* -* Author: Robert Nagy, ronag89@gmail.com -*/ - -#pragma once - -#include -#include -#include - -#include -#include - -FORWARD1(boost, template class unique_future) -FORWARD2(caspar, diagnostics, class graph); - -namespace caspar { namespace core { - -class output sealed : public target, std::shared_ptr>> - , boost::noncopyable -{ -public: - explicit output(const safe_ptr& graph, const struct video_format_desc& format_desc, int channel_index); - - // target - - virtual void send(const std::pair, std::shared_ptr>& frame) override; - - // output - - void add(const safe_ptr& consumer); - void add(int index, const safe_ptr& consumer); - void remove(const safe_ptr& consumer); - void remove(int index); - - void set_video_format_desc(const struct video_format_desc& format_desc); - - boost::unique_future info() const; -private: - struct impl; - safe_ptr impl_; -}; - +/* +* Copyright (c) 2011 Sveriges Television AB +* +* This file is part of CasparCG (www.casparcg.com). +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +* Author: Robert Nagy, ronag89@gmail.com +*/ + +#pragma once + +#include "../monitor/monitor.h" +#include "../fwd.h" + +#include +#include +#include + +#include + +#include + +FORWARD2(caspar, diagnostics, class graph); + +namespace caspar { namespace core { + +class output final +{ + output(const output&); + output& operator=(const output&); +public: + + // Static Members + + // Constructors + + explicit output(spl::shared_ptr graph, const video_format_desc& format_desc, const core::audio_channel_layout& channel_layout, int channel_index); + + // Methods + + // Returns when submitted to consumers, but the future indicates when the consumers are ready for a new frame. + std::future operator()(const_frame frame, const video_format_desc& format_desc, const core::audio_channel_layout& channel_layout); + + void add(const spl::shared_ptr& consumer); + void add(int index, const spl::shared_ptr& consumer); + void remove(const spl::shared_ptr& consumer); + void remove(int index); + + monitor::subject& monitor_output(); + + // Properties + + std::future info() const; + std::future delay_info() const; + +private: + struct impl; + spl::shared_ptr impl_; +}; + }} \ No newline at end of file