#include <cstring>
#include <memory>
+#include <dali/devel-api/threading/mutex.h>
#include <dali/integration-api/debug.h>
#include <dali/internal/imaging/common/file-download.h>
#include <dali/internal/system/common/file-reader.h>
public:
Impl(const std::string& url, bool isLocalResource)
: mUrl(url),
- mLoadSucceeded(true)
+ mLoadSucceeded(true),
+ mMutex()
{
loaderInfo.gifAccessor = nullptr;
int error;
LoaderInfo loaderInfo;
ImageProperties imageProperties;
bool mLoadSucceeded;
+ Mutex mMutex;
};
AnimatedImageLoadingPtr GifLoading::New(const std::string& url, bool isLocalResource)
{
int error;
bool ret = false;
+
+ Mutex::ScopedLock lock(mImpl->mMutex);
if(!mImpl->mLoadSucceeded)
{
return false;
return pixelBuffer;
}
+ Mutex::ScopedLock lock(mImpl->mMutex);
DALI_LOG_INFO(gGifLoadingLogFilter, Debug::Concise, "LoadFrame( frameIndex:%d )\n", frameIndex);
pixelBuffer = Dali::Devel::PixelBuffer::New(mImpl->imageProperties.w, mImpl->imageProperties.h, Dali::Pixel::RGBA8888);
#include <dali/integration-api/debug.h>
#include <dali/public-api/images/pixel-data.h>
+#include <dali/devel-api/threading/mutex.h>
#include <dali/internal/imaging/common/file-download.h>
#include <dali/internal/system/common/file-reader.h>
#include <fcntl.h>
public:
Impl(const std::string& url, bool isLocalResource)
: mUrl(url),
- mLoadSucceeded(true)
+ mLoadSucceeded(true),
+ mMutex()
{
#ifdef DALI_WEBP_ENABLED
if(ReadWebPInformation(isLocalResource))
std::vector<uint32_t> mTimeStamp;
uint32_t mLoadingFrame{0};
bool mLoadSucceeded;
+ Mutex mMutex;
#ifdef DALI_WEBP_ENABLED
WebPData mWebPData{0};
bool WebPLoading::LoadNextNFrames(uint32_t frameStartIndex, int count, std::vector<Dali::PixelData>& pixelData)
{
#ifdef DALI_WEBP_ENABLED
+ Mutex::ScopedLock lock(mImpl->mMutex);
if(frameStartIndex >= mImpl->mWebPAnimInfo.frame_count || !mImpl->mLoadSucceeded)
{
return false;
Dali::Devel::PixelBuffer pixelBuffer;
#ifdef DALI_WEBP_ENABLED
+ Mutex::ScopedLock lock(mImpl->mMutex);
if(frameIndex >= mImpl->mWebPAnimInfo.frame_count || !mImpl->mLoadSucceeded)
{
return pixelBuffer;