3 #include "../video_format.h"
\r
5 #include <common/spl/memory.h>
\r
6 #include <common/forward.h>
\r
8 #include <boost/range.hpp>
\r
9 #include <boost/any.hpp>
\r
11 #include <tbb/cache_aligned_allocator.h>
\r
16 FORWARD1(boost, template<typename> class shared_future);
\r
18 namespace caspar { namespace core {
\r
21 class mutable_array;
\r
23 typedef std::vector<int32_t, tbb::cache_aligned_allocator<int32_t>> audio_buffer;
\r
25 class mutable_frame sealed
\r
27 mutable_frame(const mutable_frame&);
\r
28 mutable_frame& operator=(const mutable_frame&);
\r
35 explicit mutable_frame(std::vector<mutable_array> image_buffers,
\r
36 audio_buffer audio_buffer,
\r
38 const struct pixel_format_desc& desc,
\r
40 core::field_mode field_mode);
\r
45 mutable_frame(mutable_frame&& other);
\r
46 mutable_frame& operator=(mutable_frame&& other);
\r
48 void swap(mutable_frame& other);
\r
52 const struct pixel_format_desc& pixel_format_desc() const;
\r
54 const mutable_array& image_data(std::size_t index = 0) const;
\r
55 const core::audio_buffer& audio_data() const;
\r
57 mutable_array& image_data(std::size_t index = 0);
\r
58 core::audio_buffer& audio_data();
\r
60 double frame_rate() const;
\r
61 core::field_mode field_mode() const;
\r
63 std::size_t width() const;
\r
64 std::size_t height() const;
\r
66 const void* tag() const;
\r
70 spl::unique_ptr<impl> impl_;
\r
73 class const_frame sealed
\r
79 static const const_frame& empty();
\r
83 explicit const_frame(const void* tag = nullptr);
\r
84 explicit const_frame(boost::shared_future<const_array> image,
\r
85 audio_buffer audio_buffer,
\r
87 const struct pixel_format_desc& desc,
\r
89 core::field_mode field_mode);
\r
90 const_frame(mutable_frame&& other);
\r
95 const_frame(const_frame&& other);
\r
96 const_frame& operator=(const_frame&& other);
\r
97 const_frame(const const_frame&);
\r
98 const_frame& operator=(const const_frame& other);
\r
102 const struct pixel_format_desc& pixel_format_desc() const;
\r
104 const_array image_data(int index = 0) const;
\r
105 const core::audio_buffer& audio_data() const;
\r
107 double frame_rate() const;
\r
108 core::field_mode field_mode() const;
\r
110 std::size_t width() const;
\r
111 std::size_t height() const;
\r
112 std::size_t size() const;
\r
114 const void* tag() const;
\r
116 bool operator==(const const_frame& other);
\r
117 bool operator!=(const const_frame& other);
\r
121 spl::shared_ptr<impl> impl_;
\r