#include #include #pragma once class TextureRgba { public: TextureRgba(flutter::TextureRegistrar* texture_registrar); ~TextureRgba(); void MarkVideoFrameAvailable(const std::vector& buffer, size_t width, size_t height); int64_t texture_id() const { return texture_id_; }; const FlutterDesktopPixelBuffer* buffer(); private: FlutterDesktopPixelBuffer flutter_pixel_buffer_{}; flutter::TextureRegistrar* texture_registrar_ = nullptr; std::unique_ptr texture_ = nullptr; int64_t texture_id_; mutable std::mutex mutex_; std::vector buffer_tmp_; };