else if (!strcmp(argv[i], "-xr"))
{
}
+ else if (!strcmp(argv[i], "-auto"))
+ {
+ module_filename = NULL;
+ }
else if (!strcmp(argv[i], "-xine"))
{
module_filename = "xine";
static Eina_Hash *_backends = NULL;
static Eina_Array *_modules = NULL;
+static const char *_backend_priority[] = {
+ "xine",
+ "gstreamer",
+ "vlc"
+};
+
EAPI Eina_Bool
_emotion_module_register(const char *name, Emotion_Module_Open open, Emotion_Module_Close close)
{
Eina_Emotion_Plugins *plugin;
- fprintf(stderr, "registering: %s\n", name);
-
plugin = malloc(sizeof (Eina_Emotion_Plugins));
if (!plugin) return EINA_FALSE;
EAPI Eina_Bool
_emotion_module_unregister(const char *name)
{
- fprintf(stderr, "unregistering: %s\n", name);
return eina_hash_del(_backends, name, NULL);
}
{
Eina_Emotion_Plugins *plugin;
Smart_Data *sd;
+ int index = 0;
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!_backends)
}
/* FIXME: Always look for a working backend. */
+ retry:
+ if (name == NULL || index > 0)
+ name = _backend_priority[index++];
+
plugin = eina_hash_find(_backends, name);
if (!plugin)
{
+ if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*)))
+ goto retry;
+
fprintf(stderr, "No backend loaded\n");
return EINA_FALSE;
}
}
}
+ if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*)))
+ goto retry;
+
fprintf (stderr, "Unable to load module %s\n", name);
return EINA_FALSE;