forked from enlightenment/efl
* Use ecore_plugin instead of dlfcn
* the modules names are now "xine" and "gstreamer" (it's useless to add the extension, as ecore_plugin do not need it). I'll fix eclair, etk_extra and ewl. * look for the modules in path that is pointed by the env variable EMOTION_MODULES_DIR first. * fix a leak in the gstreamer module * remove some trailing spaces SVN revision: 32261
This commit is contained in:
parent
5f684ac512
commit
4649e92bb8
|
@ -169,9 +169,6 @@ fi
|
|||
AM_CONDITIONAL([BUILD_XINE_MODULE], [test "$HAVE_XINE" = yes])
|
||||
AM_CONDITIONAL([BUILD_GSTREAMER_MODULE], [test "$HAVE_GSTREAMER" = yes])
|
||||
|
||||
AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
|
||||
AC_SUBST(dlopen_libs)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
emotion.pc
|
||||
|
@ -213,4 +210,3 @@ echo " binaries.......: $bindir"
|
|||
echo " libraries......: $libdir"
|
||||
echo " headers........: $includedir"
|
||||
echo
|
||||
|
||||
|
|
|
@ -821,7 +821,7 @@ main(int argc, char **argv)
|
|||
if (main_start(argc, argv) < 1) return -1;
|
||||
bg_setup();
|
||||
|
||||
module_filename = "emotion_decoder_xine.so";
|
||||
module_filename = "xine";
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
|
@ -848,11 +848,11 @@ main(int argc, char **argv)
|
|||
}
|
||||
else if (!strcmp(argv[i], "-xine"))
|
||||
{
|
||||
module_filename = "emotion_decoder_xine.so";
|
||||
module_filename = "xine";
|
||||
}
|
||||
else if (!strcmp(argv[i], "-gstreamer"))
|
||||
{
|
||||
module_filename = "emotion_decoder_gstreamer.so";
|
||||
module_filename = "gstreamer";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -15,6 +15,6 @@ libemotion_la_SOURCES = \
|
|||
emotion_smart.c \
|
||||
emotion_private.h
|
||||
|
||||
libemotion_la_LIBADD = @EVAS_LIBS@ @ECORE_LIBS@ @dlopen_libs@
|
||||
libemotion_la_LIBADD = @EVAS_LIBS@ @ECORE_LIBS@
|
||||
libemotion_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
libemotion_la_LDFLAGS = -version-info 0:1:0
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include <Evas.h>
|
||||
#include <Ecore.h>
|
||||
#include <Ecore_Job.h>
|
||||
#include <Ecore_Data.h>
|
||||
#include <Ecore_Str.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
@ -120,7 +122,8 @@ struct _Emotion_Video_Module
|
|||
int (*eject) (void *ef);
|
||||
const char * (*meta_get) (void *ef, int meta);
|
||||
|
||||
void *handle;
|
||||
Ecore_Plugin *plugin;
|
||||
int group_id;
|
||||
};
|
||||
|
||||
EAPI void *_emotion_video_get(Evas_Object *obj);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "Emotion.h"
|
||||
#include "emotion_private.h"
|
||||
#include <dlfcn.h>
|
||||
|
||||
#define E_SMART_OBJ_GET(smart, o, type) \
|
||||
{ \
|
||||
|
@ -90,56 +89,62 @@ static Evas_Smart *smart = NULL;
|
|||
static unsigned char
|
||||
_emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module **mod, void **video)
|
||||
{
|
||||
void *handle;
|
||||
char buf[4096];
|
||||
Ecore_Plugin *plugin;
|
||||
int group_id;
|
||||
char *tmp = NULL;
|
||||
Smart_Data *sd;
|
||||
|
||||
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
|
||||
snprintf(buf, sizeof(buf), "%s%s", PACKAGE_LIB_DIR"/emotion/",
|
||||
name);
|
||||
handle = dlopen(buf, RTLD_LAZY);
|
||||
if (handle)
|
||||
group_id = ecore_path_group_new("emotion_module");
|
||||
tmp = getenv("EMOTION_MODULES_DIR");
|
||||
if (tmp)
|
||||
ecore_path_group_add(group_id, tmp);
|
||||
ecore_path_group_add(group_id, PACKAGE_LIB_DIR"/emotion/");
|
||||
plugin = ecore_plugin_load(group_id, name, NULL);
|
||||
if (plugin)
|
||||
{
|
||||
unsigned char (*func_module_open)(Evas_Object *, Emotion_Video_Module **, void **, Emotion_Module_Options *);
|
||||
|
||||
func_module_open = dlsym(handle, "module_open");
|
||||
func_module_open = ecore_plugin_symbol_get(plugin, "module_open");
|
||||
if (func_module_open)
|
||||
{
|
||||
if (func_module_open(obj, mod, video, &(sd->module_options)))
|
||||
{
|
||||
if (*mod)
|
||||
{
|
||||
(*mod)->handle = handle;
|
||||
(*mod)->plugin = plugin;
|
||||
(*mod)->group_id = group_id;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
dlclose(handle);
|
||||
ecore_plugin_unload(plugin);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *err;
|
||||
err = dlerror();
|
||||
printf ("No module. Error: %s\n", err);
|
||||
}
|
||||
printf ("Unable to load module %s\n", name);
|
||||
|
||||
ecore_path_group_del(group_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_emotion_module_close(Emotion_Video_Module *mod, void *video)
|
||||
{
|
||||
void *handle;
|
||||
Ecore_Plugin *plugin;
|
||||
void (*module_close) (Emotion_Video_Module *module, void *);
|
||||
|
||||
handle = mod->handle;
|
||||
module_close = dlsym(handle, "module_close");
|
||||
plugin = mod->plugin;
|
||||
module_close = ecore_plugin_symbol_get(mod->plugin, "module_close");
|
||||
if ((module_close) && (video)) module_close(mod, video);
|
||||
/* FIXME: we can't go dlclosing here as a thread still may be running from
|
||||
* the module - this in theory will leak- but it shouldnt be too bad and
|
||||
* mean that once a module is dlopened() it cant be closed - its refcount
|
||||
* will just keep going up
|
||||
*/
|
||||
// dlclose(handle);
|
||||
/*
|
||||
ecore_plugin_unload(plugin);
|
||||
ecore_path_group_del(group_id);
|
||||
*/
|
||||
}
|
||||
|
||||
/*******************************/
|
||||
|
@ -1181,6 +1186,7 @@ static void
|
|||
_smart_del(Evas_Object * obj)
|
||||
{
|
||||
Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if (sd->video) sd->module->file_close(sd->video);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
if BUILD_XINE_MODULE
|
||||
XINE_LIB_NAME=emotion_decoder_xine.la
|
||||
XINE_LIB_NAME = xine.la
|
||||
endif
|
||||
|
||||
if BUILD_GSTREAMER_MODULE
|
||||
GSTREAMER_LIB_NAME = emotion_decoder_gstreamer.la
|
||||
GSTREAMER_LIB_NAME = gstreamer.la
|
||||
endif
|
||||
|
||||
#AUTOMAKE_OPTIONS = 1.4 foreign
|
||||
|
@ -22,24 +22,24 @@ pkgdir = $(libdir)/emotion
|
|||
pkg_LTLIBRARIES = $(XINE_LIB_NAME) $(GSTREAMER_LIB_NAME)
|
||||
|
||||
if BUILD_XINE_MODULE
|
||||
emotion_decoder_xine_la_SOURCES = \
|
||||
xine_la_SOURCES = \
|
||||
emotion_xine.c \
|
||||
emotion_xine.h \
|
||||
emotion_xine_vo_out.c
|
||||
emotion_decoder_xine_la_LIBADD = @EVAS_LIBS@ @ECORE_LIBS@ @XINE_LIBS@ $(top_builddir)/src/lib/libemotion.la -lpthread
|
||||
emotion_decoder_xine_la_LDFLAGS = -module -avoid-version \
|
||||
xine_la_LIBADD = @EVAS_LIBS@ @ECORE_LIBS@ @XINE_LIBS@ $(top_builddir)/src/lib/libemotion.la -lpthread
|
||||
xine_la_LDFLAGS = -module -avoid-version \
|
||||
-L$(top_builddir)/src/lib -L$(top_builddir)/src/lib/.libs
|
||||
emotion_decoder_xine_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
xine_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
endif
|
||||
|
||||
if BUILD_GSTREAMER_MODULE
|
||||
emotion_decoder_gstreamer_la_SOURCES = \
|
||||
gstreamer_la_SOURCES = \
|
||||
emotion_gstreamer.c \
|
||||
emotion_gstreamer.h \
|
||||
emotion_gstreamer_pipeline.c \
|
||||
emotion_gstreamer_pipeline.h
|
||||
emotion_decoder_gstreamer_la_LIBADD = @EVAS_LIBS@ @ECORE_LIBS@ @GST_LIBS@ $(top_builddir)/src/lib/libemotion.la
|
||||
emotion_decoder_gstreamer_la_LDFLAGS = -module -avoid-version \
|
||||
gstreamer_la_LIBADD = @EVAS_LIBS@ @ECORE_LIBS@ @GST_LIBS@ $(top_builddir)/src/lib/libemotion.la
|
||||
gstreamer_la_LDFLAGS = -module -avoid-version \
|
||||
-L$(top_builddir)/src/lib -L$(top_builddir)/src/lib/.libs
|
||||
emotion_decoder_gstreamer_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
gstreamer_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
endif
|
||||
|
|
|
@ -328,6 +328,7 @@ em_shutdown(void *video)
|
|||
ecore_list_destroy (ev->audio_sinks);
|
||||
|
||||
/* FIXME: and the evas object ? */
|
||||
if (ev->obj_data) free(ev->obj_data);
|
||||
|
||||
ecore_main_fd_handler_del(ev->fd_ev_handler);
|
||||
close(ev->fd_ev_write);
|
||||
|
|
Loading…
Reference in New Issue