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_visitor.h"
\r
24 #include <core/video_format.h>
\r
26 #include <common/memory/safe_ptr.h>
\r
28 #include <boost/range/iterator_range.hpp>
\r
32 namespace caspar { namespace core {
\r
34 struct frame_transform;
\r
38 basic_frame(std::vector<safe_ptr<basic_frame>>&& frames);
\r
41 basic_frame(const safe_ptr<basic_frame>& frame);
\r
42 basic_frame(safe_ptr<basic_frame>&& frame);
\r
43 basic_frame(const std::vector<safe_ptr<basic_frame>>& frames);
\r
44 basic_frame(const basic_frame& other);
\r
45 basic_frame(basic_frame&& other);
\r
47 basic_frame& operator=(const basic_frame& other);
\r
48 basic_frame& operator=(basic_frame&& other);
\r
50 void swap(basic_frame& other);
\r
52 const frame_transform& get_frame_transform() const;
\r
53 frame_transform& get_frame_transform();
\r
55 static safe_ptr<basic_frame> interlace(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2, field_mode::type mode);
\r
56 static safe_ptr<basic_frame> combine(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2);
\r
57 static safe_ptr<basic_frame> fill_and_key(const safe_ptr<basic_frame>& fill, const safe_ptr<basic_frame>& key);
\r
59 static const safe_ptr<basic_frame>& eof()
\r
61 static safe_ptr<basic_frame> frame = make_safe<basic_frame>();
\r
65 static const safe_ptr<basic_frame>& empty()
\r
67 static safe_ptr<basic_frame> frame = make_safe<basic_frame>();
\r
71 static const safe_ptr<basic_frame>& late()
\r
73 static safe_ptr<basic_frame> frame = make_safe<basic_frame>();
\r
77 virtual void accept(frame_visitor& visitor);
\r
79 virtual std::wstring print() const;
\r
81 struct implementation;
\r
82 safe_ptr<implementation> impl_;
\r
85 safe_ptr<basic_frame> disable_audio(const safe_ptr<basic_frame>& frame);
\r
87 inline bool is_concrete_frame(const safe_ptr<basic_frame>& frame)
\r
89 return frame != basic_frame::empty() && frame != basic_frame::eof() && frame != basic_frame::late();
\r
92 inline bool is_concrete_frame(const std::shared_ptr<basic_frame>& frame)
\r
94 return frame != nullptr && frame.get() != basic_frame::empty().get() && frame.get() != basic_frame::eof().get() && frame.get() != basic_frame::late().get();
\r