]> git.sesse.net Git - nageru/blobdiff - cef_capture.h
Implement HTMLInput::set_url().
[nageru] / cef_capture.h
index dc74b30d527c4c28d6d54cb2ec1431ed77039fde..8dc053dddf9bfc1e37ecb0e62dd8954b1a3ac617 100644 (file)
@@ -69,6 +69,8 @@ public:
                return card_index;
        }
 
+       void set_url(const std::string &url);
+
        void OnPaint(const void *buffer, int width, int height);
 
        // CaptureInterface.
@@ -145,6 +147,8 @@ public:
        uint32_t get_current_audio_input() const override { return 0; }
 
 private:
+       void post_to_cef_ui_thread(std::function<void()> &&func);
+
        CefRefPtr<NageruCEFClient> cef_client;
        unsigned width, height;
        int card_index = -1;
@@ -159,6 +163,12 @@ private:
 
        std::string description, start_url;
 
+       std::mutex browser_mutex;
+       CefRefPtr<CefBrowser> browser;  // Under <browser_mutex>.
+
+       // Tasks waiting for <browser> to get ready. Under <browser_mutex>.
+       std::vector<std::function<void()>> deferred_tasks;
+
        int timecode = 0;
 };