CHECK_MODULE_AND_SET( FREETYPE_BITMAP_SUPPORT freetype2>=${FREETYPE_BITMAP_SUPPORT_VERSION} freetype_bitmap_support)
CHECK_MODULE_AND_SET( FONTCONFIG fontconfig fontconfig_available )
CHECK_MODULE_AND_SET( PNG libpng [] )
+CHECK_MODULE_AND_SET( WEBP libwebp webp_available )
+CHECK_MODULE_AND_SET( WEBP_DEMUX libwebpdemux [] )
CHECK_MODULE_AND_SET( LIBEXIF libexif [] )
CHECK_MODULE_AND_SET( LIBDRM libdrm [] )
CHECK_MODULE_AND_SET( LIBCURL libcurl [] )
ADD_DEFINITIONS( -DDALI_ELDBUS_AVAILABLE )
ENDIF()
+IF( webp_available )
+ SET(DALI_WEBP_AVAILABLE 1)
+ ADD_DEFINITIONS( -DDALI_WEBP_AVAILABLE )
+ENDIF()
+
ADD_DEFINITIONS( -DPLATFORM_TIZEN )
IF( enable_debug )
${FONTCONFIG_CFLAGS}
${CAIRO_CFLAGS}
${PNG_CFLAGS}
+ ${WEBP_CFLAGS}
+ ${WEBP_DEMUX_CFLAGS}
${DLOG_CFLAGS}
${VCONF_CFLAGS}
${EXIF_CFLAGS}
${FONTCONFIG_LDFLAGS}
${CAIRO_LDFLAGS}
${PNG_LDFLAGS}
+ ${WEBP_LDFLAGS}
+ ${WEBP_DEMUX_LDFLAGS}
${DLOG_LDFLAGS}
${VCONF_LDFLAGS}
${EXIF_LDFLAGS}
-lgif
-lturbojpeg
-ljpeg
- -lwebp
- -lwebpdemux
)
# Android includes pthread with android lib
#include <dali/internal/imaging/common/webp-loading.h>
// EXTERNAL INCLUDES
+#ifdef DALI_WEBP_AVAILABLE
#include <webp/decode.h>
#include <webp/demux.h>
+
+#if WEBP_DEMUX_ABI_VERSION > 0x0101
+#define DALI_WEBP_ENABLED 1
+#endif
+
+#endif
#include <dali/integration-api/debug.h>
#include <dali/public-api/images/pixel-data.h>
: mUrl( url ),
mLoadingFrame( 0 )
{
-#if WEBP_DEMUX_ABI_VERSION > 0x0101
+#ifdef DALI_WEBP_ENABLED
if( ReadWebPInformation( isLocalResource ) )
{
WebPAnimDecoderOptions webPAnimDecoderOptions;
bool ReadWebPInformation( bool isLocalResource )
{
-#if WEBP_DEMUX_ABI_VERSION > 0x0101
+#ifdef DALI_WEBP_ENABLED
WebPDataInit( &mWebPData );
if( isLocalResource )
{
~Impl()
{
-#if WEBP_DEMUX_ABI_VERSION > 0x0101
+#ifdef DALI_WEBP_ENABLED
if( &mWebPData != NULL )
{
free( (void*)mWebPData.bytes );
std::vector<uint32_t> mTimeStamp;
uint32_t mLoadingFrame;
-#if WEBP_DEMUX_ABI_VERSION > 0x0101
+#ifdef DALI_WEBP_ENABLED
WebPData mWebPData;
WebPAnimDecoder* mWebPAnimDecoder;
WebPAnimInfo mWebPAnimInfo;
AnimatedImageLoadingPtr WebPLoading::New( const std::string &url, bool isLocalResource )
{
-#if WEBP_DEMUX_ABI_VERSION <= 0x0101
- DALI_LOG_ERROR( "The system do not support Animated WebP format.\n" );
+#ifndef DALI_WEBP_ENABLED
+ DALI_LOG_ERROR( "The system does not support Animated WebP format.\n" );
#endif
return AnimatedImageLoadingPtr( new WebPLoading( url, isLocalResource ) );
}
bool WebPLoading::LoadNextNFrames( uint32_t frameStartIndex, int count, std::vector<Dali::PixelData> &pixelData )
{
-#if WEBP_DEMUX_ABI_VERSION > 0x0101
+#ifdef DALI_WEBP_ENABLED
if( frameStartIndex >= mImpl->mWebPAnimInfo.frame_count )
{
return false;
ImageDimensions WebPLoading::GetImageSize() const
{
-#if WEBP_DEMUX_ABI_VERSION > 0x0101
+#ifdef DALI_WEBP_ENABLED
return ImageDimensions( mImpl->mWebPAnimInfo.canvas_width, mImpl->mWebPAnimInfo.canvas_height );
#else
return ImageDimensions();
uint32_t WebPLoading::GetImageCount() const
{
-#if WEBP_DEMUX_ABI_VERSION > 0x0101
+#ifdef DALI_WEBP_ENABLED
return mImpl->mWebPAnimInfo.frame_count;
#else
return 0u;
} // namespace Internal
-} // namespace Dali
\ No newline at end of file
+} // namespace Dali
BuildRequires: gawk
BuildRequires: cmake
BuildRequires: giflib-devel
-BuildRequires: pkgconfig(libwebp)
-BuildRequires: pkgconfig(libwebpdecoder)
-BuildRequires: pkgconfig(libwebpdemux)
-BuildRequires: pkgconfig(libwebpmux)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: libjpeg-turbo-devel
BuildRequires: pkgconfig(vconf)
BuildRequires: wayland-devel
BuildRequires: wayland-extension-client-devel
+# WebP support only from Tizen 6 onwards
+%if 0%{?tizen_version_major} >= 6
+BuildRequires: pkgconfig(libwebp)
+BuildRequires: pkgconfig(libwebpdecoder)
+BuildRequires: pkgconfig(libwebpdemux)
+BuildRequires: pkgconfig(libwebpmux)
+%endif
+
# We use ecore mainloop
%if 0%{?tizen_version_major} >= 5
BuildRequires: pkgconfig(ecore-wl2)