Fix some issues 18/191418/3
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 17 Oct 2018 02:54:35 +0000 (11:54 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Fri, 19 Oct 2018 02:35:53 +0000 (11:35 +0900)
- Remove DALI_ADAPTOR_API from unnecessary function
- Fix error handling code

Change-Id: If9ffbf36257b19d1f1ad0f695bc87cce6443f978

dali/devel-api/adaptor-framework/image-loading.cpp
dali/devel-api/adaptor-framework/image-loading.h
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/imaging/common/image-loader.cpp
dali/internal/imaging/common/image-loader.h
dali/internal/video/common/video-player-impl.cpp

index 60dabc1..af05256 100644 (file)
@@ -33,8 +33,6 @@ namespace
 // limit maximum image down load size to 50 MB
 const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE  = 50 * 1024 * 1024 ;
 
-static unsigned int gMaxTextureSize = 4096;
-
 }
 
 Devel::PixelBuffer LoadImageFromFile( const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
@@ -114,14 +112,9 @@ Devel::PixelBuffer DownloadImageSynchronously( const std::string& url, ImageDime
   return Dali::Devel::PixelBuffer();
 }
 
-void SetMaxTextureSize( unsigned int size )
-{
-  gMaxTextureSize = size;
-}
-
 unsigned int GetMaxTextureSize()
 {
-  return gMaxTextureSize;
+  return TizenPlatform::ImageLoader::GetMaxTextureSize();
 }
 
 } // namespace Dali
index 3c19be0..a7995ba 100755 (executable)
@@ -90,13 +90,6 @@ DALI_ADAPTOR_API Devel::PixelBuffer DownloadImageSynchronously(
   bool orientationCorrection = true );
 
 /**
- * @brief Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE.
- *
- * @param [in] size The maximum texture size to set
- */
-DALI_ADAPTOR_API void SetMaxTextureSize( unsigned int size );
-
-/**
  * @brief get the maximum texture size.
  *
  * @return The maximum texture size
index 149064e..33dce23 100755 (executable)
 #include <dali/internal/window-system/common/window-render-surface.h>
 
 #include <dali/internal/system/common/logging.h>
-#include <dali/devel-api/adaptor-framework/image-loading.h>
 
 #include <dali/internal/system/common/locale-utils.h>
 #include <dali/internal/imaging/common/image-loader-plugin-proxy.h>
+#include <dali/internal/imaging/common/image-loader.h>
 
 
 using Dali::TextAbstraction::FontClient;
@@ -272,7 +272,7 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
   // Set max texture size
   if( mEnvironmentOptions->GetMaxTextureSize() > 0 )
   {
-    Dali::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() );
+    Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() );
   }
 
   SetupSystemInformation();
index 09c1d00..b83878e 100755 (executable)
@@ -45,6 +45,7 @@ namespace
 Integration::Log::Filter* gLogFilter = Debug::Filter::New( Debug::Concise, false, "LOG_IMAGE_LOADING" );
 #endif
 
+static unsigned int gMaxTextureSize = 4096;
 
 /**
  * Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE
@@ -414,6 +415,16 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer
   return ImageDimensions( width, height );
 }
 
+void SetMaxTextureSize( unsigned int size )
+{
+  gMaxTextureSize = size;
+}
+
+unsigned int GetMaxTextureSize()
+{
+  return gMaxTextureSize;
+}
+
 } // ImageLoader
 } // TizenPlatform
 } // Dali
index bedd3fa..64e10c5 100644 (file)
@@ -81,6 +81,20 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer
                           SamplingMode::Type samplingMode,
                           bool orientationCorrection );
 
+/**
+ * @brief Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE.
+ *
+ * @param [in] size The maximum texture size to set
+ */
+void SetMaxTextureSize( unsigned int size );
+
+/**
+ * @brief Get the maximum texture size.
+ *
+ * @return The maximum texture size
+ */
+unsigned int GetMaxTextureSize();
+
 } // ImageLoader
 } // TizenPlatform
 } // Dali
index e62f7df..05f371e 100755 (executable)
@@ -95,7 +95,9 @@ void VideoPlayer::Initialize()
   }
 
   mCreateVideoPlayerPtr = reinterpret_cast< CreateVideoPlayerFunction >( dlsym( mHandle, "CreateVideoPlayerPlugin" ) );
-  if( mCreateVideoPlayerPtr == NULL )
+
+  error = dlerror();
+  if( mCreateVideoPlayerPtr == NULL || error != NULL )
   {
     DALI_LOG_ERROR( "Can't load symbol CreateVideoPlayerPlugin(), error: %s\n", error );
     return;
@@ -110,12 +112,13 @@ void VideoPlayer::Initialize()
   }
 
   mDestroyVideoPlayerPtr = reinterpret_cast< DestroyVideoPlayerFunction >( dlsym( mHandle, "DestroyVideoPlayerPlugin" ) );
-  if( mDestroyVideoPlayerPtr == NULL )
+
+  error = dlerror();
+  if( mDestroyVideoPlayerPtr == NULL || error != NULL )
   {
     DALI_LOG_ERROR( "Can't load symbol DestroyVideoPlayerPlugin(), error: %s\n", error );
     return;
   }
-
 }
 
 void VideoPlayer::SetUrl( const std::string& url )