summaryrefslogtreecommitdiff
path: root/src/modules/ethumb
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-12 05:21:36 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-12 05:21:36 +0000
commita4e4c3041ee4eafee168f51348d2399cede29ff6 (patch)
treeca2f1ec94f9c4733b25250d0365c7cd7e620357c /src/modules/ethumb
parent8e9303e1a422bcf12eb8a406cd3f808b8a9695f0 (diff)
downloadefl-a4e4c3041ee4eafee168f51348d2399cede29ff6.tar.gz
ethumb: improve plugin handling.
be more like emotion, delay plugin load and change the api to register/unregister, more future-proof. SVN revision: 82681
Diffstat (limited to 'src/modules/ethumb')
-rw-r--r--src/modules/ethumb/emotion/emotion.c76
1 files changed, 62 insertions, 14 deletions
diff --git a/src/modules/ethumb/emotion/emotion.c b/src/modules/ethumb/emotion/emotion.c
index 12750883d8..651dc15f85 100644
--- a/src/modules/ethumb/emotion/emotion.c
+++ b/src/modules/ethumb/emotion/emotion.c
@@ -407,20 +407,64 @@ _thumb_cancel(Ethumb *e EINA_UNUSED, void *data)
free(_plugin);
}
-EAPI Ethumb_Plugin *
-ethumb_plugin_get(void)
-{
- static const char *extensions[] = { "avi", "mp4", "ogv", "mov", "mpg", "wmv",
- NULL };
- static Ethumb_Plugin plugin =
- {
- extensions,
- _thumb_generate,
- _thumb_cancel
- };
-
- return &plugin;
-}
+static const char *extensions[] = { /* based on emotion's list */
+ "264",
+ "3g2",
+ "3gp",
+ "3gp2",
+ "3gpp",
+ "3gpp2",
+ "3p2",
+ "asf",
+ "avi",
+ "bdm",
+ "bdmv",
+ "clpi",
+ "clp",
+ "fla",
+ "flv",
+ "m1v",
+ "m2v",
+ "m2t",
+ "m4v",
+ "mkv",
+ "mov",
+ "mp2",
+ "mp2ts",
+ "mp4",
+ "mpe",
+ "mpeg",
+ "mpg",
+ "mpl",
+ "mpls",
+ "mts",
+ "mxf",
+ "nut",
+ "nuv",
+ "ogg",
+ "ogm",
+ "ogv",
+ "rm",
+ "rmj",
+ "rmm",
+ "rms",
+ "rmx",
+ "rmvb",
+ "swf",
+ "ts",
+ "weba",
+ "webm",
+ "wmv",
+ NULL
+};
+static const Ethumb_Plugin plugin =
+ {
+ ETHUMB_PLUGIN_API_VERSION,
+ "emotion",
+ extensions,
+ _thumb_generate,
+ _thumb_cancel
+};
static Eina_Bool
_module_init(void)
@@ -450,6 +494,8 @@ _module_init(void)
emotion_init();
+ ethumb_plugin_register(&plugin);
+
_init_count = 1;
return EINA_TRUE;
@@ -472,6 +518,8 @@ _module_shutdown(void)
_init_count--;
if (_init_count > 0) return;
+ ethumb_plugin_unregister(&plugin);
+
emotion_shutdown();
eina_prefix_free(_pfx);