bump: 0.0.3

This commit is contained in:
Kingtous 2023-02-17 11:54:26 +08:00
parent 1684b7655c
commit 6a24ae2a85
4 changed files with 7 additions and 6 deletions

View file

@ -190,7 +190,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.2"
version: "0.0.3"
vector_math:
dependency: transitive
description:

View file

@ -1,6 +1,6 @@
name: texture_rgba_renderer
description: A texture helper which brings a high level api to handle RGBA data.
version: 0.0.2
version: 0.0.3
homepage: https://github.com/Kingtous/flutter_texture_rgba_renderer
environment:

View file

@ -19,9 +19,10 @@ TextureRgba::~TextureRgba()
void TextureRgba::MarkVideoFrameAvailable(const std::vector<uint8_t>& buffer, size_t width, size_t height)
{
const std::lock_guard<std::mutex> lock(mutex_);
buffer_tmp_.resize(buffer.size());
std::copy(buffer.begin(), buffer.end(), buffer_tmp_.begin());
flutter_pixel_buffer_.buffer = &buffer_tmp_[0];
// FIXME: maybe without copy, it's easily crash with corrupt memory access.
// buffer_tmp_.resize(buffer.size());
// std::copy(buffer.begin(), buffer.end(), buffer_tmp_.begin());
flutter_pixel_buffer_.buffer = &buffer[0];
flutter_pixel_buffer_.width = width;
flutter_pixel_buffer_.height = height;
texture_registrar_->MarkTextureFrameAvailable(texture_id_);

View file

@ -20,6 +20,6 @@ private:
std::unique_ptr<flutter::TextureVariant> texture_ = nullptr;
int64_t texture_id_;
mutable std::mutex mutex_;
std::vector<uint8_t> buffer_tmp_;
// std::vector<uint8_t> buffer_tmp_;
};