]> git.sesse.net Git - mlt/blob - src/modules/opengl/mlt_movit_input.h
Convert on CPU if we are asked to finalize an empty Movit chain.
[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 <framework/mlt_types.h>
24
25 #include <movit/flat_input.h>
26 #include <movit/ycbcr_input.h>
27 #include <movit/effect_chain.h>
28
29 class MltInput
30 {
31 public:
32         MltInput( mlt_image_format format );
33         ~MltInput();
34
35         void useFlatInput(movit::MovitPixelFormat pix_fmt, unsigned width, unsigned height);
36         void useYCbCrInput(const movit::ImageFormat& image_format, const movit::YCbCrFormat& ycbcr_format, unsigned width, unsigned height);
37         void set_pixel_data(const unsigned char* data);
38         void invalidate_pixel_data();
39         movit::Input *get_input() { return input; }
40
41         // The original pixel format that was used to create this MltInput,
42         // in case we change our mind later and want to convert on the CPU instead.
43         mlt_image_format get_format() const { return m_format; }
44
45 private:
46         mlt_image_format m_format;
47         unsigned m_width, m_height;
48         // Note: Owned by the EffectChain, so should not be deleted by us.
49         movit::Input *input;
50         bool isRGB;
51         movit::YCbCrFormat m_ycbcr_format;
52 };
53
54 #endif // MLT_MOVIT_INPUT_H