X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cef_capture.h;h=29dededf7b60ad8696dfaec10c71c7f7e84844f4;hb=ffd68fbfb90242069af957f2a28908f0559f8348;hp=0d9bd525b03d6bb330ea614499cbb52fdf74f3e2;hpb=06608bb52fa8788a7a6498198143fc38fa83df44;p=nageru diff --git a/cef_capture.h b/cef_capture.h index 0d9bd52..29deded 100644 --- a/cef_capture.h +++ b/cef_capture.h @@ -35,8 +35,8 @@ class CEFCapture; class NageruCEFClient : public CefClient, public CefRenderHandler, public CefLoadHandler { public: - NageruCEFClient(int width, int height, CEFCapture *parent) - : width(width), height(height), parent(parent) {} + NageruCEFClient(CEFCapture *parent) + : parent(parent) {} CefRefPtr GetRenderHandler() override { @@ -52,14 +52,13 @@ public: void OnPaint(CefRefPtr browser, PaintElementType type, const RectList &dirtyRects, const void *buffer, int width, int height) override; - bool GetViewRect(CefRefPtr browser, CefRect &rect); + bool GetViewRect(CefRefPtr browser, CefRect &rect) override; // CefLoadHandler. void OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) override; private: - int width, height; CEFCapture *parent; IMPLEMENT_REFCOUNTING(NageruCEFClient); @@ -86,6 +85,7 @@ public: void set_max_fps(int max_fps); void execute_javascript_async(const std::string &js); void resize(unsigned width, unsigned height); + void request_new_frame(); // Callbacks from NageruCEFClient. void OnPaint(const void *buffer, int width, int height); @@ -148,7 +148,7 @@ public: assert(pixel_format == bmusb::PixelFormat_8BitBGRA); } - bmusb::PixelFormat get_current_pixel_format() const + bmusb::PixelFormat get_current_pixel_format() const override { return bmusb::PixelFormat_8BitBGRA; }