]> git.sesse.net Git - casparcg/blob - core/mixer/frame/write_frame.h
f6a8605e19d173652280781099f053b1194c82b3
[casparcg] / core / mixer / frame / write_frame.h
1 #pragma once\r
2 \r
3 #include "../fwd.h"\r
4 \r
5 #include "draw_frame.h"\r
6 \r
7 #include "../gpu/host_buffer.h"\r
8 \r
9 #include "../../video_format.h"\r
10 \r
11 #include <boost/noncopyable.hpp>\r
12 #include <boost/range/iterator_range.hpp>\r
13 \r
14 #include <memory>\r
15 #include <vector>\r
16 \r
17 namespace caspar { namespace core {\r
18         \r
19 struct pixel_format_desc;\r
20 \r
21 class write_frame : public draw_frame, boost::noncopyable\r
22 {\r
23 public: \r
24         explicit write_frame(const pixel_format_desc& desc, std::vector<safe_ptr<host_buffer>> buffers);\r
25         write_frame(write_frame&& other);\r
26         write_frame& operator=(write_frame&& other);\r
27         \r
28         void swap(write_frame& other);\r
29                 \r
30         boost::iterator_range<unsigned char*> image_data(size_t index = 0);     \r
31         std::vector<short>& audio_data();\r
32 \r
33         virtual void process_image(image_mixer& mixer);\r
34         virtual void process_audio(audio_mixer& mixer);\r
35         \r
36 private:\r
37         struct implementation;\r
38         std::shared_ptr<implementation> impl_;\r
39 };\r
40 typedef std::shared_ptr<write_frame> write_frame_impl_ptr;\r
41 \r
42 \r
43 }}