#include <dali/public-api/images/pixel-data.h>
#include <dali/internal/imaging/common/file-download.h>
#include <dali/internal/system/common/file-reader.h>
+#include <dali/devel-api/threading/mutex.h>
#define IMG_TOO_BIG( w, h ) \
( ( static_cast<unsigned long long>(w) * static_cast<unsigned long long>(h) ) >= \
{
public:
Impl( const std::string& url, bool isLocalResource )
- : mUrl( url )
+ : mUrl( url ),
+ mMutex()
{
loaderInfo.gif = nullptr;
int error;
std::string mUrl;
LoaderInfo loaderInfo;
ImageProperties imageProperties;
+ Mutex mMutex;
};
AnimatedImageLoadingPtr GifLoading::New( const std::string &url, bool isLocalResource )
int error;
bool ret = false;
+ Mutex::ScopedLock lock( mImpl->mMutex );
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 );
int error;
Dali::Devel::PixelBuffer 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 <cstring>
#include <dali/internal/imaging/common/file-download.h>
#include <dali/internal/system/common/file-reader.h>
+#include <dali/devel-api/threading/mutex.h>
typedef unsigned char WebPByteType;
{
public:
Impl( const std::string& url, bool isLocalResource )
- : mUrl( url )
+ : mUrl( url ),
+ mMutex()
{
#ifdef DALI_WEBP_ENABLED
if( ReadWebPInformation( isLocalResource ) )
std::string mUrl;
std::vector<uint32_t> mTimeStamp;
uint32_t mLoadingFrame{0};
+ 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 )
{
return false;
{
Dali::Devel::PixelBuffer pixelBuffer;
#ifdef DALI_WEBP_ENABLED
+ Mutex::ScopedLock lock( mImpl->mMutex );
if( frameIndex >= mImpl->mWebPAnimInfo.frame_count )
{
return pixelBuffer;