bump: 0.0.3
This commit is contained in:
parent
1684b7655c
commit
6a24ae2a85
4 changed files with 7 additions and 6 deletions
|
|
@ -190,7 +190,7 @@ packages:
|
||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.0.2"
|
version: "0.0.3"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
name: texture_rgba_renderer
|
name: texture_rgba_renderer
|
||||||
description: A texture helper which brings a high level api to handle RGBA data.
|
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
|
homepage: https://github.com/Kingtous/flutter_texture_rgba_renderer
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,10 @@ TextureRgba::~TextureRgba()
|
||||||
void TextureRgba::MarkVideoFrameAvailable(const std::vector<uint8_t>& buffer, size_t width, size_t height)
|
void TextureRgba::MarkVideoFrameAvailable(const std::vector<uint8_t>& buffer, size_t width, size_t height)
|
||||||
{
|
{
|
||||||
const std::lock_guard<std::mutex> lock(mutex_);
|
const std::lock_guard<std::mutex> lock(mutex_);
|
||||||
buffer_tmp_.resize(buffer.size());
|
// FIXME: maybe without copy, it's easily crash with corrupt memory access.
|
||||||
std::copy(buffer.begin(), buffer.end(), buffer_tmp_.begin());
|
// buffer_tmp_.resize(buffer.size());
|
||||||
flutter_pixel_buffer_.buffer = &buffer_tmp_[0];
|
// std::copy(buffer.begin(), buffer.end(), buffer_tmp_.begin());
|
||||||
|
flutter_pixel_buffer_.buffer = &buffer[0];
|
||||||
flutter_pixel_buffer_.width = width;
|
flutter_pixel_buffer_.width = width;
|
||||||
flutter_pixel_buffer_.height = height;
|
flutter_pixel_buffer_.height = height;
|
||||||
texture_registrar_->MarkTextureFrameAvailable(texture_id_);
|
texture_registrar_->MarkTextureFrameAvailable(texture_id_);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,6 @@ private:
|
||||||
std::unique_ptr<flutter::TextureVariant> texture_ = nullptr;
|
std::unique_ptr<flutter::TextureVariant> texture_ = nullptr;
|
||||||
int64_t texture_id_;
|
int64_t texture_id_;
|
||||||
mutable std::mutex mutex_;
|
mutable std::mutex mutex_;
|
||||||
std::vector<uint8_t> buffer_tmp_;
|
// std::vector<uint8_t> buffer_tmp_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue