X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cef_capture.h;h=be5402fda9deb31c0a94cfe756b056250c999fe4;hb=f1ce3c5618f769b1388b39c637877d242c8ddeed;hp=dc74b30d527c4c28d6d54cb2ec1431ed77039fde;hpb=b68d8a25951faf5b967b7a35fa0a363b4b68fbc0;p=nageru diff --git a/cef_capture.h b/cef_capture.h index dc74b30..be5402f 100644 --- a/cef_capture.h +++ b/cef_capture.h @@ -69,6 +69,10 @@ public: return card_index; } + void set_url(const std::string &url); + void reload(); + void set_max_fps(int max_fps); + void OnPaint(const void *buffer, int width, int height); // CaptureInterface. @@ -145,6 +149,8 @@ public: uint32_t get_current_audio_input() const override { return 0; } private: + void post_to_cef_ui_thread(std::function &&func); + CefRefPtr cef_client; unsigned width, height; int card_index = -1; @@ -158,6 +164,13 @@ private: bmusb::frame_callback_t frame_callback = nullptr; std::string description, start_url; + std::atomic max_fps{60}; + + std::mutex browser_mutex; + CefRefPtr browser; // Under . + + // Tasks waiting for to get ready. Under . + std::vector> deferred_tasks; int timecode = 0; };