#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)
return false;
}
+ Mutex::ScopedLock lock(mImpl->mMutex);
+ if(!mImpl->mLoadSucceeded)
+ {
+ return false;
+ }
+
const int bufferSize = mImpl->imageProperties.w * mImpl->imageProperties.h * sizeof(uint32_t);
DALI_LOG_INFO(gGifLoadingLogFilter, Debug::Concise, "LoadNextNFrames( frameStartIndex:%d, count:%d )\n", frameStartIndex, count);
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);