../jpeg/include
)
-SET(dependents "dlog glib-2.0 gmodule-2.0")
+SET(dependents "dlog glib-2.0")
INCLUDE(FindPkgConfig)
pkg_check_modules(${fw_name} REQUIRED ${dependents})
aux_source_directory(. SOURCES)
ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
-TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS} mmutil_common)
+TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS} mmutil_common -ldl)
SET_TARGET_PROPERTIES(${fw_name}
PROPERTIES
VERSION ${VERSION}
*
*/
-#include <gmodule.h>
#include <limits.h>
+#include <dlfcn.h>
+#include <glib.h>
#include "mm_util_private.h"
#include "mm_util_imgp.h"
#include "mm_util_imgp_internal.h"
return ret;
}
-static void __mm_util_imgp_finalize(GModule *module, imgp_info_s *_imgp_info_s)
+static void __mm_util_imgp_finalize(void *module, imgp_info_s *_imgp_info_s)
{
if (module)
- g_module_close(module);
+ dlclose(module);
g_free(_imgp_info_s);
}
}
}
-static IMGPInfoFunc __mm_util_initialize(GModule **module)
+static IMGPInfoFunc __mm_util_initialize(void **module)
{
- GModule *_module = NULL;
+ void *_module = NULL;
IMGPInfoFunc _func = NULL;
- _module = g_module_open(PATH_GSTCS_LIB, G_MODULE_BIND_LAZY);
+ _module = dlopen(PATH_GSTCS_LIB, RTLD_LAZY);
mm_util_retvm_if(!module, NULL, "%s module open failed", PATH_GSTCS_LIB);
- mm_util_debug("module: %p, g_module_name: %s", _module, g_module_name(_module));
-
- g_module_symbol(_module, IMGP_FUNC_NAME, (gpointer *)&_func);
-
+ _func = dlsym(_module, IMGP_FUNC_NAME);
if (!_func) {
- mm_util_error("invalid function");
- g_module_close(_module);
+ mm_util_error("dlsym failed: %s", dlerror());
+ dlclose(_module);
return NULL;
}
{
int ret = MM_UTIL_ERROR_NONE;
IMGPInfoFunc _mm_util_imgp_func = NULL;
- GModule *_module = NULL;
+ void *_module = NULL;
unsigned char *output_buffer = NULL;
mm_image_info_s *_src = (mm_image_info_s *)src;
mm_util_image_h _convert_image = NULL;
{
int ret = MM_UTIL_ERROR_NONE;
IMGPInfoFunc _mm_util_imgp_func = NULL;
- GModule *_module = NULL;
+ void *_module = NULL;
unsigned char *output_buffer = NULL;
mm_image_info_s *_src = (mm_image_info_s *)src;
mm_util_image_h _resize_image = NULL;
{
int ret = MM_UTIL_ERROR_NONE;
IMGPInfoFunc _mm_util_imgp_func = NULL;
- GModule *_module = NULL;
+ void *_module = NULL;
unsigned char *output_buffer = NULL;
unsigned int uint_w = 0;
unsigned int uint_h = 0;