2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>
\r
4 * This file is part of CasparCG.
\r
6 * CasparCG is free software: you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation, either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * CasparCG is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
\r
22 #include "../frame/frame_fwd.h"
\r
23 #include "../frame/gpu_frame.h"
\r
24 #include "../frame/frame_factory.h"
\r
26 #include <boost/noncopyable.hpp>
\r
30 namespace caspar { namespace core {
\r
32 class frame_producer : boost::noncopyable
\r
35 virtual ~frame_producer(){}
\r
37 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
38 /// \fn virtual gpu_frame_ptr :::render_frame() = 0;
\r
40 /// \brief Renders a frame.
\r
42 /// \note This function is run in through the tbb task_schedular and shall be *non blocking*.
\r
44 /// \return The frame.
\r
45 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
46 virtual gpu_frame_ptr render_frame() = 0;
\r
48 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
49 /// \fn virtual std::shared_ptr<frame_producer> :::get_following_producer() const
\r
51 /// \brief Gets the producer which will replace the current producer on EOF.
\r
53 /// \return The following producer, or nullptr if there is no following producer.
\r
54 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
55 virtual std::shared_ptr<frame_producer> get_following_producer() const { return nullptr; }
\r
57 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
58 /// \fn virtual void :::set_leading_producer(const std::shared_ptr<frame_producer>& producer)
\r
60 /// \brief Sets the producer which was run before the current producer.
\r
62 /// \param producer The leading producer.
\r
63 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
64 virtual void set_leading_producer(const std::shared_ptr<frame_producer>& /*producer*/) {}
\r
66 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
67 /// \fn virtual const frame_format_desc& :::get_frame_format_desc() const = 0;
\r
69 /// \brief Gets the frame format description.
\r
71 /// \return The frame format description.
\r
72 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
73 virtual const frame_format_desc& get_frame_format_desc() const = 0;
\r
75 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
76 /// \fn virtual void :::initialize(const frame_factory_ptr& factory) = 0;
\r
78 /// \brief Provides the frame factory used to create frames and initializes the producer.
\r
80 /// \param factory The frame factory.
\r
81 ////////////////////////////////////////////////////////////////////////////////////////////////////
\r
82 virtual void initialize(const frame_factory_ptr& factory) = 0;
\r
84 typedef std::shared_ptr<frame_producer> frame_producer_ptr;
\r