]> git.sesse.net Git - casparcg/blob - accelerator/ogl/util/data_frame.h
2.1.0: -cii: Merged changes from trunk.
[casparcg] / accelerator / ogl / util / data_frame.h
1 /*\r
2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 * This file is part of CasparCG (www.casparcg.com).\r
5 *\r
6 * CasparCG is free software: you can redistribute it and/or modify\r
7 * it under the terms of the GNU General Public License as published by\r
8 * the Free Software Foundation, either version 3 of the License, or\r
9 * (at your option) any later version.\r
10 *\r
11 * CasparCG is distributed in the hope that it will be useful,\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14 * GNU General Public License for more details.\r
15 *\r
16 * You should have received a copy of the GNU General Public License\r
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
18 *\r
19 * Author: Robert Nagy, ronag89@gmail.com\r
20 */\r
21 \r
22 #pragma once\r
23 \r
24 #include <common/spl/memory.h>\r
25 #include <common/forward.h>\r
26 \r
27 #include <core/frame/data_frame.h>\r
28 #include <core/frame/pixel_format.h>\r
29 #include <core/video_format.h>\r
30 #include <core/mixer/audio/audio_mixer.h>\r
31 \r
32 #include <stdint.h>\r
33 #include <vector>\r
34 \r
35 FORWARD1(boost, template <typename> class iterator_range);\r
36 FORWARD2(caspar, core, class frame_visitor);\r
37 FORWARD2(caspar, core, struct pixel_format_desc);\r
38 \r
39 namespace caspar { namespace accelerator { namespace ogl {\r
40         \r
41 class data_frame sealed : public core::data_frame\r
42 {\r
43         data_frame(const data_frame&);\r
44         data_frame& operator=(const data_frame);\r
45 public: \r
46         explicit data_frame(const void* tag);\r
47         explicit data_frame(const spl::shared_ptr<class device>& ogl, const void* tag, const core::pixel_format_desc& desc, double frame_rate, core::field_mode field_mode);\r
48 \r
49         data_frame(data_frame&& other);\r
50         data_frame& operator=(data_frame&& other);\r
51 \r
52         void swap(data_frame& other);\r
53                         \r
54         // data_frame\r
55                 \r
56         virtual const core::pixel_format_desc& pixel_format_desc() const override;\r
57 \r
58         virtual const boost::iterator_range<const uint8_t*> image_data(int index) const override;\r
59         virtual const core::audio_buffer& audio_data() const override;\r
60 \r
61         virtual const boost::iterator_range<uint8_t*> image_data(int index) override;\r
62         virtual core::audio_buffer& audio_data() override;\r
63         \r
64         virtual double frame_rate() const override;\r
65         virtual core::field_mode field_mode() const override;\r
66 \r
67         virtual int width() const override;\r
68         virtual int height() const override;\r
69                                                                 \r
70         virtual const void* tag() const override;\r
71                         \r
72         // data_frames\r
73 \r
74         std::vector<spl::shared_ptr<class host_buffer>> buffers() const;\r
75 private:\r
76         struct impl;\r
77         spl::shared_ptr<impl> impl_;\r
78 };\r
79 \r
80 }}}