]> git.sesse.net Git - nageru/blobdiff - cef_capture.h
When dropping CEF frames, ask for invalidation only a bit later.
[nageru] / cef_capture.h
index 311076eb9afd0fcaf2942e9d218086c1e9673539..0d9bd525b03d6bb330ea614499cbb52fdf74f3e2 100644 (file)
@@ -166,7 +166,7 @@ public:
        uint32_t get_current_audio_input() const override { return 0; }
 
 private:
-       void post_to_cef_ui_thread(std::function<void()> &&func);
+       void post_to_cef_ui_thread(std::function<void()> &&func, int64_t delay_ms = 0);
 
        CefRefPtr<NageruCEFClient> cef_client;
 
@@ -189,7 +189,9 @@ private:
        std::string description, start_url;
        std::atomic<int> max_fps{60};
 
-       std::mutex browser_mutex;
+       // Needs to be recursive because the lambda in OnPaint could cause
+       // OnPaint itself to be called.
+       std::recursive_mutex browser_mutex;
        CefRefPtr<CefBrowser> browser;  // Under <browser_mutex>.
 
        // Tasks waiting for <browser> to get ready. Under <browser_mutex>.