X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fvideo_channel.h;h=4c256b0dca24861fd28e9c6b147be78d0d3bc4df;hb=3c7a4be67bcd574bc1b4dd3c80cd986d5ca82861;hp=915766e824467e38de5b05e515a52b9ab24fcd8a;hpb=c156bdd4a87429d670f2f9a6ace3cc021782cd9a;p=casparcg diff --git a/core/video_channel.h b/core/video_channel.h index 915766e82..4c256b0dc 100644 --- a/core/video_channel.h +++ b/core/video_channel.h @@ -1,80 +1,84 @@ -/* -* 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 "monitor/monitor.h" - -#include - -FORWARD3(caspar, core, ogl, class accelerator); -FORWARD2(caspar, core, class stage); -FORWARD2(caspar, core, class mixer); -FORWARD2(caspar, core, class output); -FORWARD2(caspar, core, struct image_mixer); -FORWARD2(caspar, core, struct video_format_desc); -FORWARD2(caspar, core, struct frame_factory); - -namespace caspar { namespace core { - -typedef reactive::observable> frame_observable; - -class video_channel sealed : public frame_observable - , public monitor::observable -{ - video_channel(const video_channel&); - video_channel& operator=(const video_channel&); -public: - explicit video_channel(int index, const video_format_desc& format_desc, spl::unique_ptr image_mixer); - - const core::stage& stage() const; - core::stage& stage(); - const core::mixer& mixer() const; - core::mixer& mixer(); - const core::output& output() const; - core::output& output(); - - core::video_format_desc video_format_desc() const; - void video_format_desc(const core::video_format_desc& format_desc); - - spl::shared_ptr frame_factory(); - - boost::property_tree::wptree info() const; - - // observable> - - virtual void subscribe(const frame_observable::observer_ptr& o) override; - virtual void unsubscribe(const frame_observable::observer_ptr& o) override; - - // monitor::observable - - virtual void subscribe(const monitor::observable::observer_ptr& o) override; - virtual void unsubscribe(const monitor::observable::observer_ptr& o) override; -private: - struct impl; - spl::shared_ptr impl_; -}; - -}} \ No newline at end of file +/* +* 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 "fwd.h" + +#include "monitor/monitor.h" + +#include + +#include + +namespace caspar { namespace core { + +class video_channel final +{ + video_channel(const video_channel&); + video_channel& operator=(const video_channel&); +public: + + // Static Members + + // Constructors + + explicit video_channel( + int index, + const video_format_desc& format_desc, + const audio_channel_layout& channel_layout, + std::unique_ptr image_mixer); + ~video_channel(); + + // Methods + + monitor::subject& monitor_output(); + + // Properties + + const core::stage& stage() const; + core::stage& stage(); + const core::mixer& mixer() const; + core::mixer& mixer(); + const core::output& output() const; + core::output& output(); + + core::video_format_desc video_format_desc() const; + void video_format_desc(const core::video_format_desc& format_desc); + core::audio_channel_layout audio_channel_layout() const; + void audio_channel_layout(const core::audio_channel_layout& channel_layout); + + std::shared_ptr add_tick_listener(std::function listener); + + spl::shared_ptr frame_factory(); + + boost::property_tree::wptree info() const; + boost::property_tree::wptree delay_info() const; + int index() const; +private: + struct impl; + spl::unique_ptr impl_; +}; + +}}