7 #include <movit/effect_chain.h>
8 #include <movit/deinterlace_effect.h>
9 #include <movit/ycbcr_input.h>
20 #include "input_state.h"
21 #include "ref_counted_frame.h"
29 class NonBouncingYCbCrInput : public movit::YCbCrInput {
31 NonBouncingYCbCrInput(const movit::ImageFormat &image_format,
32 const movit::YCbCrFormat &ycbcr_format,
33 unsigned width, unsigned height,
34 movit::YCbCrInputSplitting ycbcr_input_splitting = movit::YCBCR_INPUT_PLANAR)
35 : movit::YCbCrInput(image_format, ycbcr_format, width, height, ycbcr_input_splitting) {}
37 bool override_disable_bounce() const override { return true; }
42 Theme(const char *filename, movit::ResourcePool *resource_pool, unsigned num_cards);
45 movit::EffectChain *chain;
46 std::function<void()> setup_chain;
48 // May have duplicates.
49 std::vector<RefCountedFrame> input_frames;
52 Chain get_chain(unsigned num, float t, unsigned width, unsigned height, InputState input_state);
54 int get_num_channels() const { return num_channels; }
55 int map_signal(int signal_num);
56 std::string get_channel_name(unsigned channel);
57 bool get_supports_set_wb(unsigned channel);
58 void set_wb(unsigned channel, double r, double g, double b);
60 std::vector<std::string> get_transition_names(float t);
62 void connect_signal(movit::YCbCrInput *input, int signal_num);
63 void transition_clicked(int transition_num, float t);
64 void channel_clicked(int preview_num);
66 movit::ResourcePool *get_resource_pool() const { return resource_pool; }
69 void register_class(const char *class_name, const luaL_Reg *funcs);
72 lua_State *L; // Protected by <m>.
73 const InputState *input_state; // Protected by <m>. Only set temporarily, during chain setup.
74 movit::ResourcePool *resource_pool;
77 std::set<int> signals_warned_about;
79 friend class LiveInputWrapper;
82 class LiveInputWrapper {
84 LiveInputWrapper(Theme *theme, movit::EffectChain *chain, bool override_bounce, bool deinterlace);
86 void connect_signal(int signal_num);
87 movit::Effect *get_effect() const
90 return deinterlace_effect;
97 Theme *theme; // Not owned by us.
98 std::vector<movit::YCbCrInput *> inputs; // Multiple ones if deinterlacing. Owned by the chain.
99 movit::Effect *deinterlace_effect = nullptr; // Owned by the chain.
103 #endif // !defined(_THEME_H)