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 cache_aligned_vector<int32_t> audio_buffer;
25 class mutable_frame final
27 mutable_frame(const mutable_frame&);
28 mutable_frame& operator=(const mutable_frame&);
35 explicit mutable_frame(std::vector<array<std::uint8_t>> image_buffers,
36 audio_buffer audio_buffer,
38 const pixel_format_desc& desc);
43 mutable_frame(mutable_frame&& other);
44 mutable_frame& operator=(mutable_frame&& other);
46 void swap(mutable_frame& other);
50 const core::pixel_format_desc& pixel_format_desc() const;
52 const array<std::uint8_t>& image_data(std::size_t index = 0) const;
53 const core::audio_buffer& audio_data() const;
55 array<std::uint8_t>& image_data(std::size_t index = 0);
56 core::audio_buffer& audio_data();
58 std::size_t width() const;
59 std::size_t height() const;
61 const void* stream_tag() const;
62 const void* data_tag() const;
64 const core::frame_geometry& geometry() const;
65 void set_geometry(const frame_geometry& g);
67 caspar::timer since_created() const;
71 spl::unique_ptr<impl> impl_;
74 class const_frame final
80 static const const_frame& empty();
84 explicit const_frame(const void* tag = nullptr);
85 explicit const_frame(std::shared_future<array<const std::uint8_t>> image,
86 audio_buffer audio_buffer,
88 const pixel_format_desc& desc);
89 const_frame(mutable_frame&& other);
94 const_frame(const_frame&& other);
95 const_frame& operator=(const_frame&& other);
96 const_frame(const const_frame&);
97 const_frame& operator=(const const_frame& other);
101 const core::pixel_format_desc& pixel_format_desc() const;
103 array<const std::uint8_t> image_data(int index = 0) const;
104 const core::audio_buffer& audio_data() const;
106 std::size_t width() const;
107 std::size_t height() const;
108 std::size_t size() const;
110 const void* stream_tag() const;
111 const void* data_tag() const;
113 const core::frame_geometry& geometry() const;
114 void set_geometry(const frame_geometry& g);
115 int64_t get_age_millis() const;
117 bool operator==(const const_frame& other);
118 bool operator!=(const const_frame& other);
119 bool operator<(const const_frame& other);
120 bool operator>(const const_frame& other);
124 spl::shared_ptr<impl> impl_;