X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cef_capture.h;h=311076eb9afd0fcaf2942e9d218086c1e9673539;hb=16e654819e2254ef045b60b7751a918558c4a13a;hp=c497179d72e127077e4abb193e34f720ed7ea141;hpb=a1fac4049d79171dc40f0cd416c1358fd4dc2d3c;p=nageru diff --git a/cef_capture.h b/cef_capture.h index c497179..311076e 100644 --- a/cef_capture.h +++ b/cef_capture.h @@ -85,9 +85,11 @@ public: void reload(); void set_max_fps(int max_fps); void execute_javascript_async(const std::string &js); + void resize(unsigned width, unsigned height); + // Callbacks from NageruCEFClient. void OnPaint(const void *buffer, int width, int height); - + bool GetViewRect(CefRect &rect); void OnLoadEnd(); // CaptureInterface. @@ -167,7 +169,13 @@ private: void post_to_cef_ui_thread(std::function &&func); CefRefPtr cef_client; - unsigned width, height; + + // Needs to be different from browser_mutex below, since GetViewRect + // can be called unpredictably from when we are already holding + // . + std::mutex resolution_mutex; + unsigned width, height; // Under . + int card_index = -1; bool has_dequeue_callbacks = false;