5 #include <movit/ycbcr_input.h>
13 #include "ref_counted_frame.h"
25 class NonBouncingYCbCrInput : public movit::YCbCrInput {
27 NonBouncingYCbCrInput(const movit::ImageFormat &image_format,
28 const movit::YCbCrFormat &ycbcr_format,
29 unsigned width, unsigned height,
30 movit::YCbCrInputSplitting ycbcr_input_splitting = movit::YCBCR_INPUT_PLANAR)
31 : movit::YCbCrInput(image_format, ycbcr_format, width, height, ycbcr_input_splitting) {}
33 bool override_disable_bounce() const override { return true; }
38 Theme(const std::string &filename, const std::vector<std::string> &search_dirs, movit::ResourcePool *resource_pool, unsigned num_cards);
42 movit::EffectChain *chain;
43 std::function<void()> setup_chain;
45 // May have duplicates.
46 std::vector<RefCountedFrame> input_frames;
49 Chain get_chain(unsigned num, float t, unsigned width, unsigned height, InputState input_state);
51 int get_num_channels() const { return num_channels; }
52 int map_signal(int signal_num);
53 void set_signal_mapping(int signal_num, int card_num);
54 std::string get_channel_name(unsigned channel);
55 int get_channel_signal(unsigned channel);
56 bool get_supports_set_wb(unsigned channel);
57 void set_wb(unsigned channel, double r, double g, double b);
58 std::string get_channel_color(unsigned channel);
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;
79 std::map<int, int> signal_to_card_mapping; // Protected by <map_m>.
81 friend class LiveInputWrapper;
84 class LiveInputWrapper {
86 LiveInputWrapper(Theme *theme, movit::EffectChain *chain, bool override_bounce, bool deinterlace);
88 void connect_signal(int signal_num);
89 movit::Effect *get_effect() const
92 return deinterlace_effect;
99 Theme *theme; // Not owned by us.
100 std::vector<movit::YCbCrInput *> inputs; // Multiple ones if deinterlacing. Owned by the chain.
101 movit::Effect *deinterlace_effect = nullptr; // Owned by the chain.
105 #endif // !defined(_THEME_H)