]> git.sesse.net Git - nageru/blobdiff - nageru/theme.h
Allow dynamic frame sizes for FFmpeg inputs.
[nageru] / nageru / theme.h
index 7fe0e8585a2b0993a359d362d6db95b08951d5ba..2c6021e4e103be0fddbebeb4145c24ddca37f3b4 100644 (file)
@@ -24,6 +24,7 @@ class Scene;
 class CEFCapture;
 class FFmpegCapture;
 class LiveInputWrapper;
+class QSurface;
 struct InputState;
 
 namespace movit {
@@ -89,7 +90,7 @@ struct InputStateInfo {
 
 class Theme {
 public:
-       Theme(const std::string &filename, const std::vector<std::string> &search_dirs, movit::ResourcePool *resource_pool);
+       Theme(const std::string &filename, const std::vector<std::string> &search_dirs, movit::ResourcePool *resource_pool, QSurface *surface);
        ~Theme();
 
        struct Chain {
@@ -244,6 +245,11 @@ private:
        std::map<unsigned, int> channel_signals;  // Set using Nageru.set_channel_signal(). Protected by <m>.
        std::map<unsigned, bool> channel_supports_wb;  // Set using Nageru.set_supports_wb(). Protected by <m>.
 
+       // Used to construct OpenGL contexts for VideoInputs. Needs to be available
+       // during the entire lifetime of Theme, since they may be created basically
+       // at any time.
+       const QSurface *surface;
+
        friend class LiveInputWrapper;
        friend class Scene;
        friend int ThemeMenu_set(lua_State *L);
@@ -251,6 +257,7 @@ private:
        friend int Nageru_set_num_channels(lua_State *L);
        friend int Nageru_set_channel_signal(lua_State *L);
        friend int Nageru_set_supports_wb(lua_State *L);
+       friend int VideoInput_new(lua_State* L);
 };
 
 // LiveInputWrapper is a facade on top of an YCbCrInput, exposed to