Enlightenment CVS committal
Author : doursse
Project : e17
Module : libs/emotion
Dir : e17/libs/emotion/src/lib
Modified Files:
Emotion.h emotion_smart.c
Log Message:
emotion can use gstreamer, now
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/lib/Emotion.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- Emotion.h 4 Sep 2005 18:58:11 -0000 1.8
+++ Emotion.h 2 Oct 2005 07:34:36 -0000 1.9
@@ -3,6 +3,12 @@
#include <Evas.h>
+enum _Emotion_Module
+{
+ EMOTION_MODULE_XINE,
+ EMOTION_MODULE_GSTREAMER
+};
+
enum _Emotion_Event
{
EMOTION_EVENT_MENU1, // Escape Menu
@@ -46,6 +52,7 @@
EMOTION_META_INFO_TRACK_DISC_ID
};
+typedef enum _Emotion_Module Emotion_Module;
typedef enum _Emotion_Event Emotion_Event;
typedef enum _Emotion_Meta_Info Emotion_Meta_Info;
@@ -58,8 +65,8 @@
/* api calls available */
Evas_Object *emotion_object_add (Evas *evas);
-Evas_Bool emotion_object_init (Evas_Object *obj);
-void emotion_object_file_set (Evas_Object *obj, const
char *file);
+Evas_Bool emotion_object_init (Evas_Object *obj, const
char *module_filename);
+void emotion_object_file_set (Evas_Object *obj, const
char *filename);
const char *emotion_object_file_get (Evas_Object *obj);
void emotion_object_play_set (Evas_Object *obj, Evas_Bool
play);
Evas_Bool emotion_object_play_get (Evas_Object *obj);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/lib/emotion_smart.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- emotion_smart.c 30 Aug 2005 23:40:34 -0000 1.16
+++ emotion_smart.c 2 Oct 2005 07:34:36 -0000 1.17
@@ -35,6 +35,8 @@
Emotion_Video_Module *module;
void *video;
+ char *module_name;
+
char *file;
Evas_Object *obj;
double ratio;
@@ -94,12 +96,15 @@
void *handle;
char buf[4096];
- snprintf(buf, sizeof(buf), "%s/%s", PACKAGE_LIB_DIR"/emotion/", name);
+ snprintf(buf, sizeof(buf), "%s%s", PACKAGE_LIB_DIR"/emotion/",
+ name);
+ printf ("module : %s\n", buf);
handle = dlopen(buf, RTLD_NOW | RTLD_GLOBAL);
if (handle)
{
unsigned char (*func_module_open)(Evas_Object *, Emotion_Video_Module
**, void **);
+ printf ("module opened\n");
func_module_open = dlsym(handle, "module_open");
if (func_module_open)
{
@@ -111,6 +116,12 @@
}
dlclose(handle);
}
+ else
+ {
+ char *err;
+ err = dlerror();
+ printf ("pas de module : %s\n", err);
+ }
return 0;
}
@@ -129,6 +140,9 @@
/*******************************/
/* Externally accessible calls */
/*******************************/
+
+
+
Evas_Object *
emotion_object_add(Evas *evas)
{
@@ -137,7 +151,7 @@
}
Evas_Bool
-emotion_object_init(Evas_Object *obj)
+emotion_object_init(Evas_Object *obj, const char *module_filename)
{
Smart_Data *sd;
@@ -162,10 +176,14 @@
if (!sd->module || !sd->video)
{
- if (!_emotion_module_open("emotion_decoder_xine.so", obj, &sd->module,
&sd->video))
+ if (!_emotion_module_open(module_filename, obj, &sd->module,
&sd->video))
return 0;
}
+ if (!sd->module || !sd->video)
+ if (!_emotion_module_open(module_filename, obj, &sd->module, &sd->video))
+ return 0;
+
return 1;
}
@@ -177,27 +195,22 @@
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if ((file) && (sd->file) && (!strcmp(file, sd->file))) return;
-
if ((file) && (strlen(file) > 0))
{
int w, h;
-
- if (!emotion_object_init(obj))
- return;
sd->file = strdup(file);
if (sd->module)
{
- sd->module->file_close(sd->video);
- evas_object_image_size_set(sd->obj, 0, 0);
+ sd->module->file_close(sd->video);
+ evas_object_image_size_set(sd->obj, 0, 0);
}
if (!sd->module->file_open(sd->file, obj, sd->video))
- return;
+ return;
sd->module->size_get(sd->video, &w, &h);
evas_object_image_size_set(sd->obj, w, h);
sd->ratio = sd->module->ratio_get(sd->video);
sd->pos = 0.0;
- if (sd->play)
- sd->module->play(sd->video, 0.0);
+ if (sd->play) sd->module->play(sd->video, 0.0);
}
else
{
@@ -238,8 +251,11 @@
{
Smart_Data *sd;
+ printf ("play get\n");
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
+ printf ("play get1\n");
if (!sd->video) return 0;
+ printf ("play get2\n");
return sd->play;
}
@@ -810,7 +826,7 @@
Smart_Data *sd;
int iw, ih;
int changed = 0;
-
+ printf ("frame resize %d %d\n", w, h);
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
evas_object_image_size_get(sd->obj, &iw, &ih);
if ((w != iw) || (h != ih))
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs