main_start(int argc, char **argv)
{
int mode = 0;
-
+
start_time = ecore_time_get();
if (!ecore_init()) return -1;
ecore_app_args_set(argc, (const char **)argv);
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, NULL);
if (!ecore_evas_init()) return -1;
-#ifndef FB_ONLY
+#ifndef FB_ONLY
{
int i;
{
int n, w, h;
char buf[16], buf2[16];
-
+
n = sscanf(argv[i +1], "%10[^x]x%10s", buf, buf2);
if (n == 2)
{
#if HAVE_ECORE_EVAS_X
if (mode == 0)
ecore_evas = ecore_evas_software_x11_new(NULL, 0, 0, 0, startw, starth);
-#endif
+#endif
#if HAVE_ECORE_EVAS_GL
if (mode == 1)
ecore_evas = ecore_evas_gl_x11_new(NULL, 0, 0, 0, startw, starth);
#endif
if (mode == 3)
ecore_evas = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, startw, starth);
-
+
#else
startw = 240;
starth = 320;
evas_image_cache_set(evas, 8 * 1024 * 1024);
evas_font_cache_set(evas, 1 * 1024 * 1024);
evas_font_path_append(evas, PACKAGE_DATA_DIR"/data/fonts");
-
+
edje_init();
edje_frametime_set(1.0 / 30.0);
return 1;
main_resize(Ecore_Evas *ee)
{
Evas_Coord w, h;
-
+
evas_output_viewport_get(evas, NULL, NULL, &w, &h);
bg_resize(w, h);
}
evas_object_move(o, 0, 0);
evas_object_resize(o, startw, starth);
evas_object_layer_set(o, -999);
- evas_object_show(o);
+ evas_object_show(o);
evas_object_focus_set(o, 1);
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, bg_key_down, NULL);
o_bg = o;
broadcast_event(Emotion_Event ev)
{
Evas_List *l;
-
+
for (l = video_objs; l; l = l->next)
{
Evas_Object *obj;
-
+
obj = l->data;
emotion_object_event_simple_send(obj, ev);
}
bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
Evas_Event_Key_Down *ev;
-
+
ev = (Evas_Event_Key_Down *)event_info;
if (!strcmp(ev->keyname, "Escape"))
ecore_main_loop_quit();
else if (!strcmp(ev->keyname, "bracketleft"))
{
Evas_List *l;
-
+
for (l = video_objs; l; l = l->next)
{
Evas_Object *obj;
-
+
obj = l->data;
emotion_object_audio_volume_set(obj, emotion_object_audio_volume_get(obj) - 0.1);
}
else if (!strcmp(ev->keyname, "bracketright"))
{
Evas_List *l;
-
+
for (l = video_objs; l; l = l->next)
{
Evas_Object *obj;
-
+
obj = l->data;
emotion_object_audio_volume_set(obj, emotion_object_audio_volume_get(obj) + 0.1);
}
else if (!strcmp(ev->keyname, "v"))
{
Evas_List *l;
-
+
for (l = video_objs; l; l = l->next)
{
Evas_Object *obj;
-
+
obj = l->data;
if (emotion_object_video_mute_get(obj))
emotion_object_video_mute_set(obj, 0);
else if (!strcmp(ev->keyname, "a"))
{
Evas_List *l;
-
+
for (l = video_objs; l; l = l->next)
{
Evas_Object *obj;
-
+
obj = l->data;
if (emotion_object_audio_mute_get(obj))
{
else if (!strcmp(ev->keyname, "i"))
{
Evas_List *l;
-
+
for (l = video_objs; l; l = l->next)
{
Evas_Object *obj;
-
+
obj = l->data;
printf("audio channels: %i\n", emotion_object_audio_channel_count(obj));
printf("video channels: %i\n", emotion_object_video_channel_count(obj));
video_obj_down_cb(void *data, Evas *ev, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Down *e;
-
+
e = event_info;
evas_object_color_set(obj, 200, 50, 40, 200);
evas_object_raise(obj);
video_obj_up_cb(void *data, Evas *ev, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Up *e;
-
+
e = event_info;
evas_object_color_set(obj, 100, 100, 100, 100);
}
video_obj_move_cb(void *data, Evas *ev, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Move *e;
-
+
e = event_info;
if (e->buttons & 0x1)
{
Evas_Coord x, y;
-
+
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
x += e->cur.canvas.x - e->prev.canvas.x;
y += e->cur.canvas.y - e->prev.canvas.y;
else if (e->buttons & 0x4)
{
Evas_Coord w, h;
-
+
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
w += e->cur.canvas.x - e->prev.canvas.x;
h += e->cur.canvas.y - e->prev.canvas.y;
snprintf(buf, sizeof(buf), "%i:%02i:%02i.%02i / %i:%02i:%02i",
ph, pm, ps, pf, lh, lm, ls);
edje_object_part_text_set(oe, "video_progress_txt", buf);
-
+
if (0)
{
double t;
Evas_Object *oe;
oe = data;
- printf("progress: \"%s\" %3.3f\n",
+ printf("progress: \"%s\" %3.3f\n",
emotion_object_progress_info_get(obj),
emotion_object_progress_status_get(obj));
}
video_obj_signal_play_cb(void *data, Evas_Object *o, const char *emission, const char *source)
{
Evas_Object *ov;
-
+
ov = data;
emotion_object_play_set(ov, 1);
edje_object_signal_emit(o, "video_state", "play");
video_obj_signal_pause_cb(void *data, Evas_Object *o, const char *emission, const char *source)
{
Evas_Object *ov;
-
+
ov = data;
emotion_object_play_set(ov, 0);
edje_object_signal_emit(o, "video_state", "pause");
video_obj_signal_stop_cb(void *data, Evas_Object *o, const char *emission, const char *source)
{
Evas_Object *ov;
-
+
ov = data;
emotion_object_play_set(ov, 0);
emotion_object_position_set(ov, 0);
Evas_Object *ov;
double len;
double x, y;
-
+
ov = data;
edje_object_part_drag_value_get(o, source, &x, &y);
len = emotion_object_play_length_get(ov);
double spd;
double x, y;
char buf[256];
-
+
ov = data;
edje_object_part_drag_value_get(o, source, &x, &y);
spd = 255 * y;
{
Frame_Data *fd;
Evas_Coord x, y;
-
+
fd = evas_object_data_get(o, "frame_data");
fd->moving = 1;
evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
video_obj_signal_frame_move_stop_cb(void *data, Evas_Object *o, const char *emission, const char *source)
{
Frame_Data *fd;
-
+
fd = evas_object_data_get(o, "frame_data");
fd->moving = 0;
}
{
Frame_Data *fd;
Evas_Coord x, y;
-
+
fd = evas_object_data_get(o, "frame_data");
fd->resizing = 1;
evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
video_obj_signal_frame_resize_stop_cb(void *data, Evas_Object *o, const char *emission, const char *source)
{
Frame_Data *fd;
-
+
fd = evas_object_data_get(o, "frame_data");
fd->resizing = 0;
}
video_obj_signal_frame_move_cb(void *data, Evas_Object *o, const char *emission, const char *source)
{
Frame_Data *fd;
-
+
fd = evas_object_data_get(o, "frame_data");
if (fd->moving)
{
Evas_Coord x, y, ox, oy;
-
+
evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
evas_object_geometry_get(o, &ox, &oy, NULL, NULL);
evas_object_move(o, ox + (x - fd->x), oy + (y - fd->y));
else if (fd->resizing)
{
Evas_Coord x, y, ow, oh;
-
+
evas_pointer_canvas_xy_get(evas_object_evas_get(o), &x, &y);
evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
evas_object_resize(o, ow + (x - fd->x), oh + (y - fd->y));
Evas_Coord w, h;
Frame_Data *fd;
-
-/* basic video object setup */
- o = emotion_object_add(evas);
+
+/* basic video object setup */
+ o = emotion_object_add(evas);
if (!emotion_object_init(o, module_filename))
- return;
+ return;
emotion_object_file_set(o, filename);
emotion_object_play_set(o, 1);
evas_object_move(o, 0, 0);
evas_object_show(o);
/* end basic video setup. all the rest here is just to be fancy */
-
+
video_objs = evas_list_append(video_objs, o);
-
+
emotion_object_size_get(o, &iw, &ih);
w = iw; h = ih;
-
+
fd = calloc(1, sizeof(Frame_Data));
-
+
oe = edje_object_add(evas);
evas_object_data_set(oe, "frame_data", fd);
edje_object_file_set(oe, PACKAGE_DATA_DIR"/data/theme.edj", "video_controller");
evas_object_resize(oe, w, h);
edje_extern_object_min_size_set(o, 0, 0);
edje_object_part_swallow(oe, "video_swallow", o);
-
+
evas_object_smart_callback_add(o, "frame_decode", video_obj_frame_decode_cb, oe);
evas_object_smart_callback_add(o, "frame_resize", video_obj_frame_resize_cb, oe);
evas_object_smart_callback_add(o, "length_change", video_obj_length_change_cb, oe);
evas_object_smart_callback_add(o, "ref_change", video_obj_ref_cb, oe);
evas_object_smart_callback_add(o, "button_num_change", video_obj_button_num_cb, oe);
evas_object_smart_callback_add(o, "button_change", video_obj_button_cb, oe);
-
+
edje_object_signal_callback_add(oe, "video_control", "play", video_obj_signal_play_cb, o);
edje_object_signal_callback_add(oe, "video_control", "pause", video_obj_signal_pause_cb, o);
edje_object_signal_callback_add(oe, "video_control", "stop", video_obj_signal_stop_cb, o);
edje_object_signal_callback_add(oe, "frame_resize", "start", video_obj_signal_frame_resize_start_cb, oe);
edje_object_signal_callback_add(oe, "frame_resize", "stop", video_obj_signal_frame_resize_stop_cb, oe);
edje_object_signal_callback_add(oe, "mouse,move", "*", video_obj_signal_frame_move_cb, oe);
-
+
edje_object_part_drag_value_set(oe, "video_speed", 0.0, 1.0);
edje_object_part_text_set(oe, "video_speed_txt", "1.0");
edje_object_signal_emit(o, "video_state", "play");
-
+
evas_object_show(oe);
}
double t;
static double pt = 0.0;
static int frames = 0;
-
+
t = ecore_time_get();
if (frames == 0) pt = t;
frames++;
{
char *module_filename;
int i;
-
+
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++)
{
}
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
{
init_video_object(module_filename, argv[i]);
}
}
-
+
ecore_idle_enterer_add(enter_idle, NULL);
ecore_main_loop_begin();
#include "Emotion.h"
#include "emotion_private.h"
-#include <dlfcn.h>
#define E_SMART_OBJ_GET(smart, o, type) \
{ \
{
Emotion_Video_Module *module;
void *video;
-
+
char *module_name;
char *file;
double pos;
double seek_pos;
double len;
-
+
Ecore_Job *job;
-
+
unsigned char play : 1;
unsigned char seek : 1;
-
+
char *title;
struct {
char *info;
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);
+ */
}
/*******************************/
emotion_object_add(Evas *evas)
{
_smart_init();
- return evas_object_smart_add(evas, smart);
+ return evas_object_smart_add(evas, smart);
}
EAPI void
emotion_object_module_option_set(Evas_Object *obj, const char *opt, const char *val)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if ((!opt) || (!val)) return;
if (!strcmp(opt, "video"))
emotion_object_init(Evas_Object *obj, const char *module_filename)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (sd->file) free(sd->file);
emotion_object_file_set(Evas_Object *obj, const char *file)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
-
+
if ((file) && (sd->file) && (!strcmp(file, sd->file))) return;
if ((file) && (file[0] != 0))
{
int w, h;
-
+
sd->file = strdup(file);
if (sd->module)
{
emotion_object_file_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
return sd->file;
}
emotion_object_play_set(Evas_Object *obj, Evas_Bool play)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (((play) && (sd->play)) || ((!play) && (!sd->play))) return;
if (!sd->module) return;
emotion_object_play_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->video) return 0;
emotion_object_position_set(Evas_Object *obj, double sec)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_position_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
if (!sd->module) return 0.0;
if (!sd->video) return 0.0;
emotion_object_seekable_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_video_handled_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_audio_handled_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_play_length_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
if (!sd->module) return 0.0;
if (!sd->video) return 0.0;
emotion_object_size_get(Evas_Object *obj, int *iw, int *ih)
{
Smart_Data *sd;
-
+
if (iw) *iw = 0;
if (ih) *ih = 0;
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
emotion_object_smooth_scale_set(Evas_Object *obj, Evas_Bool smooth)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
evas_object_image_smooth_scale_set(sd->obj, smooth);
}
emotion_object_smooth_scale_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
return evas_object_image_smooth_scale_get(sd->obj);
}
emotion_object_ratio_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0);
if (!sd->module) return 0.0;
if (!sd->video) return 0.0;
emotion_object_event_simple_send(Evas_Object *obj, Emotion_Event ev)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_audio_volume_set(Evas_Object *obj, double vol)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_audio_volume_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0);
if (!sd->module) return 0.0;
if (!sd->video) return 0.0;
emotion_object_audio_mute_set(Evas_Object *obj, Evas_Bool mute)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_audio_mute_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_audio_channel_count(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_audio_channel_name_get(Evas_Object *obj, int channel)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
if (!sd->module) return NULL;
if (!sd->video) return NULL;
emotion_object_audio_channel_set(Evas_Object *obj, int channel)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_audio_channel_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_video_mute_set(Evas_Object *obj, Evas_Bool mute)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_video_mute_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_video_channel_count(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_video_channel_name_get(Evas_Object *obj, int channel)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
if (!sd->module) return NULL;
if (!sd->video) return NULL;
emotion_object_video_channel_set(Evas_Object *obj, int channel)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_video_channel_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_spu_mute_set(Evas_Object *obj, Evas_Bool mute)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_spu_mute_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_spu_channel_count(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_spu_channel_name_get(Evas_Object *obj, int channel)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
if (!sd->module) return NULL;
if (!sd->video) return NULL;
emotion_object_spu_channel_set(Evas_Object *obj, int channel)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_spu_channel_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_chapter_count(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_chapter_set(Evas_Object *obj, int chapter)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_chapter_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
if (!sd->module) return 0;
if (!sd->video) return 0;
emotion_object_chapter_name_get(Evas_Object *obj, int chapter)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
if (!sd->module) return NULL;
if (!sd->video) return NULL;
emotion_object_play_speed_set(Evas_Object *obj, double speed)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_play_speed_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
if (!sd->module) return 0.0;
if (!sd->video) return 0.0;
emotion_object_eject(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (!sd->module) return;
if (!sd->video) return;
emotion_object_title_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
return sd->title;
}
emotion_object_progress_info_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
return sd->progress.info;
}
emotion_object_progress_status_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
return sd->progress.stat;
}
emotion_object_ref_file_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
return sd->ref.file;
}
emotion_object_ref_num_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
return sd->ref.num;
}
emotion_object_spu_button_count_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
return sd->spu.button_num;
}
emotion_object_spu_button_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
return sd->spu.button;
}
emotion_object_meta_info_get(Evas_Object *obj, Emotion_Meta_Info meta)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
if (!sd->module) return NULL;
if (!sd->video) return NULL;
_emotion_video_get(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
return sd->video;
}
_emotion_frame_new(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
// printf("pix get set 1 %p\n", sd->obj);
evas_object_image_pixels_dirty_set(sd->obj, 1);
{
Smart_Data *sd;
int npos = 0, nlen = 0;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (pos != sd->pos) npos = 1;
if (len != sd->len) nlen = 1;
_emotion_decode_stop(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (sd->play)
{
_emotion_channels_change(Evas_Object *obj)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
evas_object_smart_callback_call(obj, "channels_change", NULL);
}
_emotion_title_set(Evas_Object *obj, char *title)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (sd->title) free(sd->title);
sd->title = strdup(title);
_emotion_progress_set(Evas_Object *obj, char *info, double stat)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (sd->progress.info) free(sd->progress.info);
sd->progress.info = strdup(info);
_emotion_file_ref_set(Evas_Object *obj, char *file, int num)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
if (sd->ref.file) free(sd->ref.file);
sd->ref.file = strdup(file);
_emotion_spu_button_num_set(Evas_Object *obj, int num)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
sd->spu.button_num = num;
evas_object_smart_callback_call(obj, "button_num_change", NULL);
_emotion_spu_button_set(Evas_Object *obj, int button)
{
Smart_Data *sd;
-
+
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
sd->spu.button = button;
evas_object_smart_callback_call(obj, "button_change", NULL);
/* Internal object routines */
/****************************/
-static void
+static void
_mouse_move(void *data, Evas *ev, Evas_Object *obj, void *event_info)
-{
+{
Evas_Event_Mouse_Move *e;
Smart_Data *sd;
int x, y, iw, ih;
Evas_Coord ox, oy, ow, oh;
-
+
e = event_info;
sd = data;
if (!sd->module) return;
sd->module->event_mouse_move_feed(sd->video, x, y);
}
-static void
+static void
_mouse_down(void *data, Evas *ev, Evas_Object *obj, void *event_info)
-{
+{
Evas_Event_Mouse_Down *e;
Smart_Data *sd;
int x, y, iw, ih;
Evas_Coord ox, oy, ow, oh;
-
+
e = event_info;
sd = data;
if (!sd->module) return;
{
Evas_Object *obj;
Smart_Data *sd;
-
+
obj = data;
E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
sd->job = NULL;
Smart_Data *sd;
Emotion_Format format;
unsigned char *bgra_data;
-
+
sd = data;
evas_object_image_size_get(obj, &iw, &ih);
sd->module->video_data_size_get(sd->video, &w, &h);
if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420))
{
unsigned char **rows;
-
+
evas_object_image_colorspace_set(obj, EVAS_COLORSPACE_YCBCR422P601_PL);
rows = evas_object_image_data_get(obj, 1);
if (rows)
{
if (sd->module->yuv_rows_get(sd->video, iw, ih,
- rows,
- &rows[ih],
+ rows,
+ &rows[ih],
&rows[ih + (ih / 2)]))
evas_object_image_data_update_add(obj, 0, 0, iw, ih);
}
}
}
// no need for this because on any new frame decode info from the decoder
-// module, the previous "current frame" is released (done) for us anyway
+// module, the previous "current frame" is released (done) for us anyway
// sd->module->frame_done(sd->video);
-/*
+/*
evas_object_image_size_get(obj, &iw, &ih);
sd->module->video_data_size_get(sd->video, &w, &h);
if ((w != iw) || (h != ih))
{
unsigned char **rows;
Evas_Pixel_Import_Source ps;
-
+
ps.format = EVAS_PIXEL_FORMAT_YUV420P_601;
ps.w = iw;
ps.h = ih;
-
+
ps.rows = malloc(ps.h * 2 * sizeof(void *));
if (!ps.rows)
{
sd->module->frame_done(sd->video);
return;
}
-
+
rows = (unsigned char **)ps.rows;
-
+
if (sd->module->yuv_rows_get(sd->video, iw, ih,
- rows,
- &rows[ps.h],
+ rows,
+ &rows[ps.h],
&rows[ps.h + (ps.h / 2)]))
evas_object_image_pixels_import(obj, &ps);
evas_object_image_pixels_dirty_set(obj, 0);
}
}
sd->module->frame_done(sd->video);
- */
+ */
}
/*******************************************/
{
Smart_Data *sd;
unsigned int *pixel;
-
+
sd = calloc(1, sizeof(Smart_Data));
if (!sd) return;
sd->obj = evas_object_image_add(evas_object_evas_get(obj));
}
evas_object_smart_data_set(obj, sd);
}
-
+
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);
_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
{
Smart_Data *sd;
-
+
sd = evas_object_smart_data_get(obj);
if (!sd) return;
evas_object_move(sd->obj, x, y);
_smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h)
{
Smart_Data *sd;
-
+
sd = evas_object_smart_data_get(obj);
if (!sd) return;
evas_object_image_fill_set(sd->obj, 0, 0, w, h);
_smart_show(Evas_Object * obj)
{
Smart_Data *sd;
-
+
sd = evas_object_smart_data_get(obj);
if (!sd) return;
evas_object_show(sd->obj);
-
+
}
static void
_smart_hide(Evas_Object * obj)
{
Smart_Data *sd;
-
+
sd = evas_object_smart_data_get(obj);
if (!sd) return;
evas_object_hide(sd->obj);
_smart_color_set(Evas_Object * obj, int r, int g, int b, int a)
{
Smart_Data *sd;
-
+
sd = evas_object_smart_data_get(obj);
if (!sd) return;
evas_object_color_set(sd->obj, r, g, b, a);
_smart_clip_set(Evas_Object * obj, Evas_Object * clip)
{
Smart_Data *sd;
-
+
sd = evas_object_smart_data_get(obj);
if (!sd) return;
evas_object_clip_set(sd->obj, clip);
_smart_clip_unset(Evas_Object * obj)
{
Smart_Data *sd;
-
+
sd = evas_object_smart_data_get(obj);
if (!sd) return;
evas_object_clip_unset(sd->obj);
-}
+}