]> git.sesse.net Git - mlt/blob - src/modules/opengl/mlt_movit_input.h
Use the new ResourcePool Movit functionality.
[mlt] / src / modules / opengl / mlt_movit_input.h
1 /*
2  * mlt_movit_input.h
3  * Copyright (C) 2013 Dan Dennedy <dan@dennedy.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef MLT_MOVIT_INPUT_H
21 #define MLT_MOVIT_INPUT_H
22
23 #include <movit/flat_input.h>
24 #include <movit/ycbcr_input.h>
25 #include <movit/effect_chain.h>
26
27 class MltInput : public Input
28 {
29 public:
30         MltInput(unsigned width, unsigned height);
31         ~MltInput();
32
33         // Effect overrides
34         std::string effect_type_id() const { return "MltInput"; }
35         Effect::AlphaHandling alpha_handling() const;
36         std::string output_fragment_shader();
37         void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num);
38         void inform_added(EffectChain *chain) { m_chain = chain; }
39
40         // Input ovverrides
41         void finalize();
42         bool can_output_linear_gamma() const;
43         unsigned get_width() const { return m_width; }
44         unsigned get_height() const { return m_height; }
45         Colorspace get_color_space() const;
46         GammaCurve get_gamma_curve() const;
47
48         // Custom methods
49         void useFlatInput(MovitPixelFormat pix_fmt, unsigned width, unsigned height);
50         void useYCbCrInput(const ImageFormat& image_format, const YCbCrFormat& ycbcr_format, unsigned width, unsigned height);
51         void set_pixel_data(const unsigned char* data);
52
53 private:
54         unsigned m_width, m_height;
55         int output_linear_gamma, needs_mipmaps;
56         Input *input;
57         bool isRGB;
58         YCbCrFormat m_ycbcr_format;
59         EffectChain *m_chain;
60 };
61
62 #endif // MLT_MOVIT_INPUT_H