]> git.sesse.net Git - casparcg/blob - core/producer/frame/basic_frame.h
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / core / producer / frame / basic_frame.h
1 #pragma once\r
2 \r
3 #include "frame_visitor.h"\r
4 #include "../../video_format.h"\r
5 \r
6 #include <common/memory/safe_ptr.h>\r
7 \r
8 #include <boost/noncopyable.hpp>\r
9 #include <boost/range/iterator_range.hpp>\r
10 \r
11 #include <memory>\r
12 #include <array>\r
13 #include <vector>\r
14 \r
15 namespace caspar { namespace core {\r
16 \r
17 class image_transform;\r
18 class audio_transform;\r
19                 \r
20 class basic_frame\r
21 {\r
22 public:\r
23         basic_frame();  \r
24         basic_frame(const safe_ptr<basic_frame>& frame);\r
25         basic_frame(safe_ptr<basic_frame>&& frame);\r
26         basic_frame(const std::vector<safe_ptr<basic_frame>>& frames);\r
27         basic_frame(std::vector<safe_ptr<basic_frame>>&& frame);\r
28         basic_frame(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2);\r
29         basic_frame(safe_ptr<basic_frame>&& frame1, safe_ptr<basic_frame>&& frame2);\r
30 \r
31         void swap(basic_frame& other);\r
32         \r
33         basic_frame(const basic_frame& other);\r
34         basic_frame(basic_frame&& other);\r
35 \r
36         basic_frame& operator=(const basic_frame& other);\r
37         basic_frame& operator=(basic_frame&& other);\r
38         \r
39         const image_transform& get_image_transform() const;\r
40         image_transform& get_image_transform();\r
41 \r
42         const audio_transform& get_audio_transform() const;\r
43         audio_transform& get_audio_transform();\r
44                 \r
45         static safe_ptr<basic_frame> interlace(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2, video_mode::type mode);\r
46                 \r
47         static const safe_ptr<basic_frame>& eof()\r
48         {\r
49                 struct eof_frame : public basic_frame{};\r
50                 static safe_ptr<basic_frame> frame = make_safe<eof_frame>();\r
51                 return frame;\r
52         }\r
53 \r
54         static const safe_ptr<basic_frame>& empty()\r
55         {\r
56                 struct empty_frame : public basic_frame{};\r
57                 static safe_ptr<basic_frame> frame = make_safe<empty_frame>();\r
58                 return frame;\r
59         }\r
60         \r
61         virtual void accept(frame_visitor& visitor);\r
62 \r
63         void set_layer_index(int index);\r
64         int get_layer_index() const;\r
65 private:\r
66         struct implementation;\r
67         std::shared_ptr<implementation> impl_;\r
68 };\r
69 \r
70 }}