3 #undef BOOST_PARAMETER_MAX_ARITY
4 #define BOOST_PARAMETER_MAX_ARITY 7
8 #include <common/memory.h>
9 #include <common/forward.h>
10 #include <common/array.h>
11 #include <common/future_fwd.h>
12 #include <common/cache_aligned_vector.h>
13 #include <common/timer.h>
18 FORWARD1(boost, template<typename> class shared_future);
20 namespace caspar { namespace core {
22 typedef caspar::array<const int32_t> audio_buffer;
23 typedef cache_aligned_vector<int32_t> mutable_audio_buffer;
26 class mutable_frame final
28 mutable_frame(const mutable_frame&);
29 mutable_frame& operator=(const mutable_frame&);
36 explicit mutable_frame(std::vector<array<std::uint8_t>> image_buffers,
37 mutable_audio_buffer audio_data,
39 const pixel_format_desc& desc,
40 const audio_channel_layout& channel_layout);
45 mutable_frame(mutable_frame&& other);
46 mutable_frame& operator=(mutable_frame&& other);
48 void swap(mutable_frame& other);
52 const core::pixel_format_desc& pixel_format_desc() const;
53 const core::audio_channel_layout& audio_channel_layout() const;
55 const array<std::uint8_t>& image_data(std::size_t index = 0) const;
56 const core::mutable_audio_buffer& audio_data() const;
58 array<std::uint8_t>& image_data(std::size_t index = 0);
59 core::mutable_audio_buffer& audio_data();
61 std::size_t width() const;
62 std::size_t height() const;
64 const void* stream_tag() const;
66 const core::frame_geometry& geometry() const;
67 void set_geometry(const frame_geometry& g);
69 caspar::timer since_created() const;
73 spl::unique_ptr<impl> impl_;
76 class const_frame final
82 static const const_frame& empty();
86 explicit const_frame(const void* tag = nullptr);
87 explicit const_frame(std::shared_future<array<const std::uint8_t>> image,
88 audio_buffer audio_data,
90 const pixel_format_desc& desc,
91 const audio_channel_layout& channel_layout);
92 const_frame(mutable_frame&& other);
97 const_frame(const_frame&& other);
98 const_frame& operator=(const_frame&& other);
99 const_frame(const const_frame&);
100 const_frame& operator=(const const_frame& other);
104 const core::pixel_format_desc& pixel_format_desc() const;
105 const core::audio_channel_layout& audio_channel_layout() const;
107 array<const std::uint8_t> image_data(int index = 0) const;
108 const core::audio_buffer& audio_data() const;
110 std::size_t width() const;
111 std::size_t height() const;
112 std::size_t size() const;
114 const void* stream_tag() const;
116 const core::frame_geometry& geometry() const;
117 void set_geometry(const frame_geometry& g);
118 int64_t get_age_millis() const;
120 bool operator==(const const_frame& other);
121 bool operator!=(const const_frame& other);
122 bool operator<(const const_frame& other);
123 bool operator>(const const_frame& other);
127 spl::shared_ptr<impl> impl_;