bump: 0.0.3
This commit is contained in:
parent
1684b7655c
commit
6a24ae2a85
4 changed files with 7 additions and 6 deletions
|
|
@ -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_);
|
||||
|
|
|
|||
|
|
@ -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_;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue