From 6a24ae2a8593fc6733eb925d812bce76d231f57c Mon Sep 17 00:00:00 2001 From: Kingtous Date: Fri, 17 Feb 2023 11:54:26 +0800 Subject: [PATCH] bump: 0.0.3 --- example/pubspec.lock | 2 +- pubspec.yaml | 2 +- windows/texture_rgba.cpp | 7 ++++--- windows/texture_rgba.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 2c0e0ab..3fce584 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -190,7 +190,7 @@ packages: path: ".." relative: true source: path - version: "0.0.2" + version: "0.0.3" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4fc89e4..b48b02a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: diff --git a/windows/texture_rgba.cpp b/windows/texture_rgba.cpp index 6122448..a58111b 100644 --- a/windows/texture_rgba.cpp +++ b/windows/texture_rgba.cpp @@ -19,9 +19,10 @@ TextureRgba::~TextureRgba() void TextureRgba::MarkVideoFrameAvailable(const std::vector& buffer, size_t width, size_t height) { const std::lock_guard 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_); diff --git a/windows/texture_rgba.h b/windows/texture_rgba.h index a235514..6b9fbdc 100644 --- a/windows/texture_rgba.h +++ b/windows/texture_rgba.h @@ -20,6 +20,6 @@ private: std::unique_ptr texture_ = nullptr; int64_t texture_id_; mutable std::mutex mutex_; - std::vector buffer_tmp_; + // std::vector buffer_tmp_; };