summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib/emotion_smart.c
diff options
context:
space:
mode:
authordoursse <doursse>2007-10-31 19:34:39 +0000
committerdoursse <doursse@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2007-10-31 19:34:39 +0000
commit4649e92bb8b330f9f87836555b9bc73f535d56e5 (patch)
tree0437475699ba13b54a5ab6b71dfea28aa4d76e52 /legacy/emotion/src/lib/emotion_smart.c
parent5f684ac5123092624e81b9799c3d53e35e3e1795 (diff)
* 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
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c250
1 files changed, 128 insertions, 122 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index c80e0d043e..442d0da8c6 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -1,6 +1,5 @@
1#include "Emotion.h" 1#include "Emotion.h"
2#include "emotion_private.h" 2#include "emotion_private.h"
3#include <dlfcn.h>
4 3
5#define E_SMART_OBJ_GET(smart, o, type) \ 4#define E_SMART_OBJ_GET(smart, o, type) \
6 { \ 5 { \
@@ -34,7 +33,7 @@ struct _Smart_Data
34{ 33{
35 Emotion_Video_Module *module; 34 Emotion_Video_Module *module;
36 void *video; 35 void *video;
37 36
38 char *module_name; 37 char *module_name;
39 38
40 char *file; 39 char *file;
@@ -43,12 +42,12 @@ struct _Smart_Data
43 double pos; 42 double pos;
44 double seek_pos; 43 double seek_pos;
45 double len; 44 double len;
46 45
47 Ecore_Job *job; 46 Ecore_Job *job;
48 47
49 unsigned char play : 1; 48 unsigned char play : 1;
50 unsigned char seek : 1; 49 unsigned char seek : 1;
51 50
52 char *title; 51 char *title;
53 struct { 52 struct {
54 char *info; 53 char *info;
@@ -90,56 +89,62 @@ static Evas_Smart *smart = NULL;
90static unsigned char 89static unsigned char
91_emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module **mod, void **video) 90_emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module **mod, void **video)
92{ 91{
93 void *handle; 92 Ecore_Plugin *plugin;
94 char buf[4096]; 93 int group_id;
94 char *tmp = NULL;
95 Smart_Data *sd; 95 Smart_Data *sd;
96 96
97 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 97 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
98 snprintf(buf, sizeof(buf), "%s%s", PACKAGE_LIB_DIR"/emotion/", 98 group_id = ecore_path_group_new("emotion_module");
99 name); 99 tmp = getenv("EMOTION_MODULES_DIR");
100 handle = dlopen(buf, RTLD_LAZY); 100 if (tmp)
101 if (handle) 101 ecore_path_group_add(group_id, tmp);
102 ecore_path_group_add(group_id, PACKAGE_LIB_DIR"/emotion/");
103 plugin = ecore_plugin_load(group_id, name, NULL);
104 if (plugin)
102 { 105 {
103 unsigned char (*func_module_open)(Evas_Object *, Emotion_Video_Module **, void **, Emotion_Module_Options *); 106 unsigned char (*func_module_open)(Evas_Object *, Emotion_Video_Module **, void **, Emotion_Module_Options *);
104 107
105 func_module_open = dlsym(handle, "module_open"); 108 func_module_open = ecore_plugin_symbol_get(plugin, "module_open");
106 if (func_module_open) 109 if (func_module_open)
107 { 110 {
108 if (func_module_open(obj, mod, video, &(sd->module_options))) 111 if (func_module_open(obj, mod, video, &(sd->module_options)))
109 { 112 {
110 if (*mod) 113 if (*mod)
111 { 114 {
112 (*mod)->handle = handle; 115 (*mod)->plugin = plugin;
116 (*mod)->group_id = group_id;
113 return 1; 117 return 1;
114 } 118 }
115 } 119 }
116 } 120 }
117 dlclose(handle); 121 ecore_plugin_unload(plugin);
118 } 122 }
119 else 123 else
120 { 124 printf ("Unable to load module %s\n", name);
121 char *err; 125
122 err = dlerror(); 126 ecore_path_group_del(group_id);
123 printf ("No module. Error: %s\n", err);
124 }
125 return 0; 127 return 0;
126} 128}
127 129
128static void 130static void
129_emotion_module_close(Emotion_Video_Module *mod, void *video) 131_emotion_module_close(Emotion_Video_Module *mod, void *video)
130{ 132{
131 void *handle; 133 Ecore_Plugin *plugin;
132 void (*module_close) (Emotion_Video_Module *module, void *); 134 void (*module_close) (Emotion_Video_Module *module, void *);
133 135
134 handle = mod->handle; 136 plugin = mod->plugin;
135 module_close = dlsym(handle, "module_close"); 137 module_close = ecore_plugin_symbol_get(mod->plugin, "module_close");
136 if ((module_close) && (video)) module_close(mod, video); 138 if ((module_close) && (video)) module_close(mod, video);
137 /* FIXME: we can't go dlclosing here as a thread still may be running from 139 /* FIXME: we can't go dlclosing here as a thread still may be running from
138 * the module - this in theory will leak- but it shouldnt be too bad and 140 * the module - this in theory will leak- but it shouldnt be too bad and
139 * mean that once a module is dlopened() it cant be closed - its refcount 141 * mean that once a module is dlopened() it cant be closed - its refcount
140 * will just keep going up 142 * will just keep going up
141 */ 143 */
142// dlclose(handle); 144 /*
145 ecore_plugin_unload(plugin);
146 ecore_path_group_del(group_id);
147 */
143} 148}
144 149
145/*******************************/ 150/*******************************/
@@ -152,14 +157,14 @@ EAPI Evas_Object *
152emotion_object_add(Evas *evas) 157emotion_object_add(Evas *evas)
153{ 158{
154 _smart_init(); 159 _smart_init();
155 return evas_object_smart_add(evas, smart); 160 return evas_object_smart_add(evas, smart);
156} 161}
157 162
158EAPI void 163EAPI void
159emotion_object_module_option_set(Evas_Object *obj, const char *opt, const char *val) 164emotion_object_module_option_set(Evas_Object *obj, const char *opt, const char *val)
160{ 165{
161 Smart_Data *sd; 166 Smart_Data *sd;
162 167
163 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 168 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
164 if ((!opt) || (!val)) return; 169 if ((!opt) || (!val)) return;
165 if (!strcmp(opt, "video")) 170 if (!strcmp(opt, "video"))
@@ -176,7 +181,7 @@ EAPI Evas_Bool
176emotion_object_init(Evas_Object *obj, const char *module_filename) 181emotion_object_init(Evas_Object *obj, const char *module_filename)
177{ 182{
178 Smart_Data *sd; 183 Smart_Data *sd;
179 184
180 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 185 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
181 186
182 if (sd->file) free(sd->file); 187 if (sd->file) free(sd->file);
@@ -212,14 +217,14 @@ EAPI void
212emotion_object_file_set(Evas_Object *obj, const char *file) 217emotion_object_file_set(Evas_Object *obj, const char *file)
213{ 218{
214 Smart_Data *sd; 219 Smart_Data *sd;
215 220
216 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 221 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
217 222
218 if ((file) && (sd->file) && (!strcmp(file, sd->file))) return; 223 if ((file) && (sd->file) && (!strcmp(file, sd->file))) return;
219 if ((file) && (file[0] != 0)) 224 if ((file) && (file[0] != 0))
220 { 225 {
221 int w, h; 226 int w, h;
222 227
223 sd->file = strdup(file); 228 sd->file = strdup(file);
224 if (sd->module) 229 if (sd->module)
225 { 230 {
@@ -249,7 +254,7 @@ EAPI const char *
249emotion_object_file_get(Evas_Object *obj) 254emotion_object_file_get(Evas_Object *obj)
250{ 255{
251 Smart_Data *sd; 256 Smart_Data *sd;
252 257
253 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 258 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
254 return sd->file; 259 return sd->file;
255} 260}
@@ -258,7 +263,7 @@ EAPI void
258emotion_object_play_set(Evas_Object *obj, Evas_Bool play) 263emotion_object_play_set(Evas_Object *obj, Evas_Bool play)
259{ 264{
260 Smart_Data *sd; 265 Smart_Data *sd;
261 266
262 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 267 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
263 if (((play) && (sd->play)) || ((!play) && (!sd->play))) return; 268 if (((play) && (sd->play)) || ((!play) && (!sd->play))) return;
264 if (!sd->module) return; 269 if (!sd->module) return;
@@ -272,7 +277,7 @@ EAPI Evas_Bool
272emotion_object_play_get(Evas_Object *obj) 277emotion_object_play_get(Evas_Object *obj)
273{ 278{
274 Smart_Data *sd; 279 Smart_Data *sd;
275 280
276 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 281 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
277 if (!sd->video) return 0; 282 if (!sd->video) return 0;
278 283
@@ -283,7 +288,7 @@ EAPI void
283emotion_object_position_set(Evas_Object *obj, double sec) 288emotion_object_position_set(Evas_Object *obj, double sec)
284{ 289{
285 Smart_Data *sd; 290 Smart_Data *sd;
286 291
287 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 292 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
288 if (!sd->module) return; 293 if (!sd->module) return;
289 if (!sd->video) return; 294 if (!sd->video) return;
@@ -298,7 +303,7 @@ EAPI double
298emotion_object_position_get(Evas_Object *obj) 303emotion_object_position_get(Evas_Object *obj)
299{ 304{
300 Smart_Data *sd; 305 Smart_Data *sd;
301 306
302 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 307 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
303 if (!sd->module) return 0.0; 308 if (!sd->module) return 0.0;
304 if (!sd->video) return 0.0; 309 if (!sd->video) return 0.0;
@@ -309,7 +314,7 @@ EAPI Evas_Bool
309emotion_object_seekable_get(Evas_Object *obj) 314emotion_object_seekable_get(Evas_Object *obj)
310{ 315{
311 Smart_Data *sd; 316 Smart_Data *sd;
312 317
313 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 318 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
314 if (!sd->module) return 0; 319 if (!sd->module) return 0;
315 if (!sd->video) return 0; 320 if (!sd->video) return 0;
@@ -320,7 +325,7 @@ EAPI Evas_Bool
320emotion_object_video_handled_get(Evas_Object *obj) 325emotion_object_video_handled_get(Evas_Object *obj)
321{ 326{
322 Smart_Data *sd; 327 Smart_Data *sd;
323 328
324 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 329 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
325 if (!sd->module) return 0; 330 if (!sd->module) return 0;
326 if (!sd->video) return 0; 331 if (!sd->video) return 0;
@@ -331,7 +336,7 @@ EAPI Evas_Bool
331emotion_object_audio_handled_get(Evas_Object *obj) 336emotion_object_audio_handled_get(Evas_Object *obj)
332{ 337{
333 Smart_Data *sd; 338 Smart_Data *sd;
334 339
335 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 340 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
336 if (!sd->module) return 0; 341 if (!sd->module) return 0;
337 if (!sd->video) return 0; 342 if (!sd->video) return 0;
@@ -342,7 +347,7 @@ EAPI double
342emotion_object_play_length_get(Evas_Object *obj) 347emotion_object_play_length_get(Evas_Object *obj)
343{ 348{
344 Smart_Data *sd; 349 Smart_Data *sd;
345 350
346 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 351 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
347 if (!sd->module) return 0.0; 352 if (!sd->module) return 0.0;
348 if (!sd->video) return 0.0; 353 if (!sd->video) return 0.0;
@@ -354,7 +359,7 @@ EAPI void
354emotion_object_size_get(Evas_Object *obj, int *iw, int *ih) 359emotion_object_size_get(Evas_Object *obj, int *iw, int *ih)
355{ 360{
356 Smart_Data *sd; 361 Smart_Data *sd;
357 362
358 if (iw) *iw = 0; 363 if (iw) *iw = 0;
359 if (ih) *ih = 0; 364 if (ih) *ih = 0;
360 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 365 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
@@ -365,7 +370,7 @@ EAPI void
365emotion_object_smooth_scale_set(Evas_Object *obj, Evas_Bool smooth) 370emotion_object_smooth_scale_set(Evas_Object *obj, Evas_Bool smooth)
366{ 371{
367 Smart_Data *sd; 372 Smart_Data *sd;
368 373
369 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 374 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
370 evas_object_image_smooth_scale_set(sd->obj, smooth); 375 evas_object_image_smooth_scale_set(sd->obj, smooth);
371} 376}
@@ -374,7 +379,7 @@ EAPI Evas_Bool
374emotion_object_smooth_scale_get(Evas_Object *obj) 379emotion_object_smooth_scale_get(Evas_Object *obj)
375{ 380{
376 Smart_Data *sd; 381 Smart_Data *sd;
377 382
378 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 383 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
379 return evas_object_image_smooth_scale_get(sd->obj); 384 return evas_object_image_smooth_scale_get(sd->obj);
380} 385}
@@ -383,7 +388,7 @@ EAPI double
383emotion_object_ratio_get(Evas_Object *obj) 388emotion_object_ratio_get(Evas_Object *obj)
384{ 389{
385 Smart_Data *sd; 390 Smart_Data *sd;
386 391
387 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0); 392 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0);
388 if (!sd->module) return 0.0; 393 if (!sd->module) return 0.0;
389 if (!sd->video) return 0.0; 394 if (!sd->video) return 0.0;
@@ -394,7 +399,7 @@ EAPI void
394emotion_object_event_simple_send(Evas_Object *obj, Emotion_Event ev) 399emotion_object_event_simple_send(Evas_Object *obj, Emotion_Event ev)
395{ 400{
396 Smart_Data *sd; 401 Smart_Data *sd;
397 402
398 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 403 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
399 if (!sd->module) return; 404 if (!sd->module) return;
400 if (!sd->video) return; 405 if (!sd->video) return;
@@ -405,7 +410,7 @@ EAPI void
405emotion_object_audio_volume_set(Evas_Object *obj, double vol) 410emotion_object_audio_volume_set(Evas_Object *obj, double vol)
406{ 411{
407 Smart_Data *sd; 412 Smart_Data *sd;
408 413
409 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 414 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
410 if (!sd->module) return; 415 if (!sd->module) return;
411 if (!sd->video) return; 416 if (!sd->video) return;
@@ -416,7 +421,7 @@ EAPI double
416emotion_object_audio_volume_get(Evas_Object *obj) 421emotion_object_audio_volume_get(Evas_Object *obj)
417{ 422{
418 Smart_Data *sd; 423 Smart_Data *sd;
419 424
420 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0); 425 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0);
421 if (!sd->module) return 0.0; 426 if (!sd->module) return 0.0;
422 if (!sd->video) return 0.0; 427 if (!sd->video) return 0.0;
@@ -427,7 +432,7 @@ EAPI void
427emotion_object_audio_mute_set(Evas_Object *obj, Evas_Bool mute) 432emotion_object_audio_mute_set(Evas_Object *obj, Evas_Bool mute)
428{ 433{
429 Smart_Data *sd; 434 Smart_Data *sd;
430 435
431 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 436 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
432 if (!sd->module) return; 437 if (!sd->module) return;
433 if (!sd->video) return; 438 if (!sd->video) return;
@@ -438,7 +443,7 @@ EAPI Evas_Bool
438emotion_object_audio_mute_get(Evas_Object *obj) 443emotion_object_audio_mute_get(Evas_Object *obj)
439{ 444{
440 Smart_Data *sd; 445 Smart_Data *sd;
441 446
442 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 447 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
443 if (!sd->module) return 0; 448 if (!sd->module) return 0;
444 if (!sd->video) return 0; 449 if (!sd->video) return 0;
@@ -449,7 +454,7 @@ EAPI int
449emotion_object_audio_channel_count(Evas_Object *obj) 454emotion_object_audio_channel_count(Evas_Object *obj)
450{ 455{
451 Smart_Data *sd; 456 Smart_Data *sd;
452 457
453 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 458 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
454 if (!sd->module) return 0; 459 if (!sd->module) return 0;
455 if (!sd->video) return 0; 460 if (!sd->video) return 0;
@@ -460,7 +465,7 @@ EAPI const char *
460emotion_object_audio_channel_name_get(Evas_Object *obj, int channel) 465emotion_object_audio_channel_name_get(Evas_Object *obj, int channel)
461{ 466{
462 Smart_Data *sd; 467 Smart_Data *sd;
463 468
464 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 469 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
465 if (!sd->module) return NULL; 470 if (!sd->module) return NULL;
466 if (!sd->video) return NULL; 471 if (!sd->video) return NULL;
@@ -471,7 +476,7 @@ EAPI void
471emotion_object_audio_channel_set(Evas_Object *obj, int channel) 476emotion_object_audio_channel_set(Evas_Object *obj, int channel)
472{ 477{
473 Smart_Data *sd; 478 Smart_Data *sd;
474 479
475 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 480 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
476 if (!sd->module) return; 481 if (!sd->module) return;
477 if (!sd->video) return; 482 if (!sd->video) return;
@@ -482,7 +487,7 @@ EAPI int
482emotion_object_audio_channel_get(Evas_Object *obj) 487emotion_object_audio_channel_get(Evas_Object *obj)
483{ 488{
484 Smart_Data *sd; 489 Smart_Data *sd;
485 490
486 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 491 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
487 if (!sd->module) return 0; 492 if (!sd->module) return 0;
488 if (!sd->video) return 0; 493 if (!sd->video) return 0;
@@ -493,7 +498,7 @@ EAPI void
493emotion_object_video_mute_set(Evas_Object *obj, Evas_Bool mute) 498emotion_object_video_mute_set(Evas_Object *obj, Evas_Bool mute)
494{ 499{
495 Smart_Data *sd; 500 Smart_Data *sd;
496 501
497 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 502 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
498 if (!sd->module) return; 503 if (!sd->module) return;
499 if (!sd->video) return; 504 if (!sd->video) return;
@@ -504,7 +509,7 @@ EAPI Evas_Bool
504emotion_object_video_mute_get(Evas_Object *obj) 509emotion_object_video_mute_get(Evas_Object *obj)
505{ 510{
506 Smart_Data *sd; 511 Smart_Data *sd;
507 512
508 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 513 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
509 if (!sd->module) return 0; 514 if (!sd->module) return 0;
510 if (!sd->video) return 0; 515 if (!sd->video) return 0;
@@ -515,7 +520,7 @@ EAPI int
515emotion_object_video_channel_count(Evas_Object *obj) 520emotion_object_video_channel_count(Evas_Object *obj)
516{ 521{
517 Smart_Data *sd; 522 Smart_Data *sd;
518 523
519 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 524 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
520 if (!sd->module) return 0; 525 if (!sd->module) return 0;
521 if (!sd->video) return 0; 526 if (!sd->video) return 0;
@@ -526,7 +531,7 @@ EAPI const char *
526emotion_object_video_channel_name_get(Evas_Object *obj, int channel) 531emotion_object_video_channel_name_get(Evas_Object *obj, int channel)
527{ 532{
528 Smart_Data *sd; 533 Smart_Data *sd;
529 534
530 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 535 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
531 if (!sd->module) return NULL; 536 if (!sd->module) return NULL;
532 if (!sd->video) return NULL; 537 if (!sd->video) return NULL;
@@ -537,7 +542,7 @@ EAPI void
537emotion_object_video_channel_set(Evas_Object *obj, int channel) 542emotion_object_video_channel_set(Evas_Object *obj, int channel)
538{ 543{
539 Smart_Data *sd; 544 Smart_Data *sd;
540 545
541 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 546 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
542 if (!sd->module) return; 547 if (!sd->module) return;
543 if (!sd->video) return; 548 if (!sd->video) return;
@@ -548,7 +553,7 @@ EAPI int
548emotion_object_video_channel_get(Evas_Object *obj) 553emotion_object_video_channel_get(Evas_Object *obj)
549{ 554{
550 Smart_Data *sd; 555 Smart_Data *sd;
551 556
552 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 557 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
553 if (!sd->module) return 0; 558 if (!sd->module) return 0;
554 if (!sd->video) return 0; 559 if (!sd->video) return 0;
@@ -559,7 +564,7 @@ EAPI void
559emotion_object_spu_mute_set(Evas_Object *obj, Evas_Bool mute) 564emotion_object_spu_mute_set(Evas_Object *obj, Evas_Bool mute)
560{ 565{
561 Smart_Data *sd; 566 Smart_Data *sd;
562 567
563 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 568 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
564 if (!sd->module) return; 569 if (!sd->module) return;
565 if (!sd->video) return; 570 if (!sd->video) return;
@@ -570,7 +575,7 @@ EAPI Evas_Bool
570emotion_object_spu_mute_get(Evas_Object *obj) 575emotion_object_spu_mute_get(Evas_Object *obj)
571{ 576{
572 Smart_Data *sd; 577 Smart_Data *sd;
573 578
574 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 579 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
575 if (!sd->module) return 0; 580 if (!sd->module) return 0;
576 if (!sd->video) return 0; 581 if (!sd->video) return 0;
@@ -581,7 +586,7 @@ EAPI int
581emotion_object_spu_channel_count(Evas_Object *obj) 586emotion_object_spu_channel_count(Evas_Object *obj)
582{ 587{
583 Smart_Data *sd; 588 Smart_Data *sd;
584 589
585 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 590 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
586 if (!sd->module) return 0; 591 if (!sd->module) return 0;
587 if (!sd->video) return 0; 592 if (!sd->video) return 0;
@@ -592,7 +597,7 @@ EAPI const char *
592emotion_object_spu_channel_name_get(Evas_Object *obj, int channel) 597emotion_object_spu_channel_name_get(Evas_Object *obj, int channel)
593{ 598{
594 Smart_Data *sd; 599 Smart_Data *sd;
595 600
596 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 601 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
597 if (!sd->module) return NULL; 602 if (!sd->module) return NULL;
598 if (!sd->video) return NULL; 603 if (!sd->video) return NULL;
@@ -603,7 +608,7 @@ EAPI void
603emotion_object_spu_channel_set(Evas_Object *obj, int channel) 608emotion_object_spu_channel_set(Evas_Object *obj, int channel)
604{ 609{
605 Smart_Data *sd; 610 Smart_Data *sd;
606 611
607 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 612 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
608 if (!sd->module) return; 613 if (!sd->module) return;
609 if (!sd->video) return; 614 if (!sd->video) return;
@@ -614,7 +619,7 @@ EAPI int
614emotion_object_spu_channel_get(Evas_Object *obj) 619emotion_object_spu_channel_get(Evas_Object *obj)
615{ 620{
616 Smart_Data *sd; 621 Smart_Data *sd;
617 622
618 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 623 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
619 if (!sd->module) return 0; 624 if (!sd->module) return 0;
620 if (!sd->video) return 0; 625 if (!sd->video) return 0;
@@ -625,7 +630,7 @@ EAPI int
625emotion_object_chapter_count(Evas_Object *obj) 630emotion_object_chapter_count(Evas_Object *obj)
626{ 631{
627 Smart_Data *sd; 632 Smart_Data *sd;
628 633
629 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 634 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
630 if (!sd->module) return 0; 635 if (!sd->module) return 0;
631 if (!sd->video) return 0; 636 if (!sd->video) return 0;
@@ -636,7 +641,7 @@ EAPI void
636emotion_object_chapter_set(Evas_Object *obj, int chapter) 641emotion_object_chapter_set(Evas_Object *obj, int chapter)
637{ 642{
638 Smart_Data *sd; 643 Smart_Data *sd;
639 644
640 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 645 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
641 if (!sd->module) return; 646 if (!sd->module) return;
642 if (!sd->video) return; 647 if (!sd->video) return;
@@ -647,7 +652,7 @@ EAPI int
647emotion_object_chapter_get(Evas_Object *obj) 652emotion_object_chapter_get(Evas_Object *obj)
648{ 653{
649 Smart_Data *sd; 654 Smart_Data *sd;
650 655
651 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 656 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
652 if (!sd->module) return 0; 657 if (!sd->module) return 0;
653 if (!sd->video) return 0; 658 if (!sd->video) return 0;
@@ -658,7 +663,7 @@ EAPI const char *
658emotion_object_chapter_name_get(Evas_Object *obj, int chapter) 663emotion_object_chapter_name_get(Evas_Object *obj, int chapter)
659{ 664{
660 Smart_Data *sd; 665 Smart_Data *sd;
661 666
662 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 667 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
663 if (!sd->module) return NULL; 668 if (!sd->module) return NULL;
664 if (!sd->video) return NULL; 669 if (!sd->video) return NULL;
@@ -669,7 +674,7 @@ EAPI void
669emotion_object_play_speed_set(Evas_Object *obj, double speed) 674emotion_object_play_speed_set(Evas_Object *obj, double speed)
670{ 675{
671 Smart_Data *sd; 676 Smart_Data *sd;
672 677
673 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 678 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
674 if (!sd->module) return; 679 if (!sd->module) return;
675 if (!sd->video) return; 680 if (!sd->video) return;
@@ -680,7 +685,7 @@ EAPI double
680emotion_object_play_speed_get(Evas_Object *obj) 685emotion_object_play_speed_get(Evas_Object *obj)
681{ 686{
682 Smart_Data *sd; 687 Smart_Data *sd;
683 688
684 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 689 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
685 if (!sd->module) return 0.0; 690 if (!sd->module) return 0.0;
686 if (!sd->video) return 0.0; 691 if (!sd->video) return 0.0;
@@ -691,7 +696,7 @@ EAPI void
691emotion_object_eject(Evas_Object *obj) 696emotion_object_eject(Evas_Object *obj)
692{ 697{
693 Smart_Data *sd; 698 Smart_Data *sd;
694 699
695 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 700 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
696 if (!sd->module) return; 701 if (!sd->module) return;
697 if (!sd->video) return; 702 if (!sd->video) return;
@@ -702,7 +707,7 @@ EAPI const char *
702emotion_object_title_get(Evas_Object *obj) 707emotion_object_title_get(Evas_Object *obj)
703{ 708{
704 Smart_Data *sd; 709 Smart_Data *sd;
705 710
706 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 711 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
707 return sd->title; 712 return sd->title;
708} 713}
@@ -711,7 +716,7 @@ EAPI const char *
711emotion_object_progress_info_get(Evas_Object *obj) 716emotion_object_progress_info_get(Evas_Object *obj)
712{ 717{
713 Smart_Data *sd; 718 Smart_Data *sd;
714 719
715 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 720 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
716 return sd->progress.info; 721 return sd->progress.info;
717} 722}
@@ -720,7 +725,7 @@ EAPI double
720emotion_object_progress_status_get(Evas_Object *obj) 725emotion_object_progress_status_get(Evas_Object *obj)
721{ 726{
722 Smart_Data *sd; 727 Smart_Data *sd;
723 728
724 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 729 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
725 return sd->progress.stat; 730 return sd->progress.stat;
726} 731}
@@ -729,7 +734,7 @@ EAPI const char *
729emotion_object_ref_file_get(Evas_Object *obj) 734emotion_object_ref_file_get(Evas_Object *obj)
730{ 735{
731 Smart_Data *sd; 736 Smart_Data *sd;
732 737
733 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 738 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
734 return sd->ref.file; 739 return sd->ref.file;
735} 740}
@@ -738,7 +743,7 @@ EAPI int
738emotion_object_ref_num_get(Evas_Object *obj) 743emotion_object_ref_num_get(Evas_Object *obj)
739{ 744{
740 Smart_Data *sd; 745 Smart_Data *sd;
741 746
742 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 747 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
743 return sd->ref.num; 748 return sd->ref.num;
744} 749}
@@ -747,7 +752,7 @@ EAPI int
747emotion_object_spu_button_count_get(Evas_Object *obj) 752emotion_object_spu_button_count_get(Evas_Object *obj)
748{ 753{
749 Smart_Data *sd; 754 Smart_Data *sd;
750 755
751 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 756 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
752 return sd->spu.button_num; 757 return sd->spu.button_num;
753} 758}
@@ -756,7 +761,7 @@ EAPI int
756emotion_object_spu_button_get(Evas_Object *obj) 761emotion_object_spu_button_get(Evas_Object *obj)
757{ 762{
758 Smart_Data *sd; 763 Smart_Data *sd;
759 764
760 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 765 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
761 return sd->spu.button; 766 return sd->spu.button;
762} 767}
@@ -765,7 +770,7 @@ EAPI const char *
765emotion_object_meta_info_get(Evas_Object *obj, Emotion_Meta_Info meta) 770emotion_object_meta_info_get(Evas_Object *obj, Emotion_Meta_Info meta)
766{ 771{
767 Smart_Data *sd; 772 Smart_Data *sd;
768 773
769 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 774 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
770 if (!sd->module) return NULL; 775 if (!sd->module) return NULL;
771 if (!sd->video) return NULL; 776 if (!sd->video) return NULL;
@@ -811,7 +816,7 @@ EAPI void *
811_emotion_video_get(Evas_Object *obj) 816_emotion_video_get(Evas_Object *obj)
812{ 817{
813 Smart_Data *sd; 818 Smart_Data *sd;
814 819
815 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 820 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
816 return sd->video; 821 return sd->video;
817} 822}
@@ -820,7 +825,7 @@ EAPI void
820_emotion_frame_new(Evas_Object *obj) 825_emotion_frame_new(Evas_Object *obj)
821{ 826{
822 Smart_Data *sd; 827 Smart_Data *sd;
823 828
824 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 829 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
825// printf("pix get set 1 %p\n", sd->obj); 830// printf("pix get set 1 %p\n", sd->obj);
826 evas_object_image_pixels_dirty_set(sd->obj, 1); 831 evas_object_image_pixels_dirty_set(sd->obj, 1);
@@ -831,7 +836,7 @@ _emotion_video_pos_update(Evas_Object *obj, double pos, double len)
831{ 836{
832 Smart_Data *sd; 837 Smart_Data *sd;
833 int npos = 0, nlen = 0; 838 int npos = 0, nlen = 0;
834 839
835 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 840 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
836 if (pos != sd->pos) npos = 1; 841 if (pos != sd->pos) npos = 1;
837 if (len != sd->len) nlen = 1; 842 if (len != sd->len) nlen = 1;
@@ -869,7 +874,7 @@ EAPI void
869_emotion_decode_stop(Evas_Object *obj) 874_emotion_decode_stop(Evas_Object *obj)
870{ 875{
871 Smart_Data *sd; 876 Smart_Data *sd;
872 877
873 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 878 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
874 if (sd->play) 879 if (sd->play)
875 { 880 {
@@ -894,7 +899,7 @@ EAPI void
894_emotion_channels_change(Evas_Object *obj) 899_emotion_channels_change(Evas_Object *obj)
895{ 900{
896 Smart_Data *sd; 901 Smart_Data *sd;
897 902
898 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 903 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
899 evas_object_smart_callback_call(obj, "channels_change", NULL); 904 evas_object_smart_callback_call(obj, "channels_change", NULL);
900} 905}
@@ -903,7 +908,7 @@ EAPI void
903_emotion_title_set(Evas_Object *obj, char *title) 908_emotion_title_set(Evas_Object *obj, char *title)
904{ 909{
905 Smart_Data *sd; 910 Smart_Data *sd;
906 911
907 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 912 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
908 if (sd->title) free(sd->title); 913 if (sd->title) free(sd->title);
909 sd->title = strdup(title); 914 sd->title = strdup(title);
@@ -914,7 +919,7 @@ EAPI void
914_emotion_progress_set(Evas_Object *obj, char *info, double stat) 919_emotion_progress_set(Evas_Object *obj, char *info, double stat)
915{ 920{
916 Smart_Data *sd; 921 Smart_Data *sd;
917 922
918 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 923 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
919 if (sd->progress.info) free(sd->progress.info); 924 if (sd->progress.info) free(sd->progress.info);
920 sd->progress.info = strdup(info); 925 sd->progress.info = strdup(info);
@@ -926,7 +931,7 @@ EAPI void
926_emotion_file_ref_set(Evas_Object *obj, char *file, int num) 931_emotion_file_ref_set(Evas_Object *obj, char *file, int num)
927{ 932{
928 Smart_Data *sd; 933 Smart_Data *sd;
929 934
930 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 935 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
931 if (sd->ref.file) free(sd->ref.file); 936 if (sd->ref.file) free(sd->ref.file);
932 sd->ref.file = strdup(file); 937 sd->ref.file = strdup(file);
@@ -938,7 +943,7 @@ EAPI void
938_emotion_spu_button_num_set(Evas_Object *obj, int num) 943_emotion_spu_button_num_set(Evas_Object *obj, int num)
939{ 944{
940 Smart_Data *sd; 945 Smart_Data *sd;
941 946
942 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 947 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
943 sd->spu.button_num = num; 948 sd->spu.button_num = num;
944 evas_object_smart_callback_call(obj, "button_num_change", NULL); 949 evas_object_smart_callback_call(obj, "button_num_change", NULL);
@@ -948,7 +953,7 @@ EAPI void
948_emotion_spu_button_set(Evas_Object *obj, int button) 953_emotion_spu_button_set(Evas_Object *obj, int button)
949{ 954{
950 Smart_Data *sd; 955 Smart_Data *sd;
951 956
952 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 957 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
953 sd->spu.button = button; 958 sd->spu.button = button;
954 evas_object_smart_callback_call(obj, "button_change", NULL); 959 evas_object_smart_callback_call(obj, "button_change", NULL);
@@ -959,14 +964,14 @@ _emotion_spu_button_set(Evas_Object *obj, int button)
959/* Internal object routines */ 964/* Internal object routines */
960/****************************/ 965/****************************/
961 966
962static void 967static void
963_mouse_move(void *data, Evas *ev, Evas_Object *obj, void *event_info) 968_mouse_move(void *data, Evas *ev, Evas_Object *obj, void *event_info)
964{ 969{
965 Evas_Event_Mouse_Move *e; 970 Evas_Event_Mouse_Move *e;
966 Smart_Data *sd; 971 Smart_Data *sd;
967 int x, y, iw, ih; 972 int x, y, iw, ih;
968 Evas_Coord ox, oy, ow, oh; 973 Evas_Coord ox, oy, ow, oh;
969 974
970 e = event_info; 975 e = event_info;
971 sd = data; 976 sd = data;
972 if (!sd->module) return; 977 if (!sd->module) return;
@@ -979,14 +984,14 @@ _mouse_move(void *data, Evas *ev, Evas_Object *obj, void *event_info)
979 sd->module->event_mouse_move_feed(sd->video, x, y); 984 sd->module->event_mouse_move_feed(sd->video, x, y);
980} 985}
981 986
982static void 987static void
983_mouse_down(void *data, Evas *ev, Evas_Object *obj, void *event_info) 988_mouse_down(void *data, Evas *ev, Evas_Object *obj, void *event_info)
984{ 989{
985 Evas_Event_Mouse_Down *e; 990 Evas_Event_Mouse_Down *e;
986 Smart_Data *sd; 991 Smart_Data *sd;
987 int x, y, iw, ih; 992 int x, y, iw, ih;
988 Evas_Coord ox, oy, ow, oh; 993 Evas_Coord ox, oy, ow, oh;
989 994
990 e = event_info; 995 e = event_info;
991 sd = data; 996 sd = data;
992 if (!sd->module) return; 997 if (!sd->module) return;
@@ -1004,7 +1009,7 @@ _pos_set_job(void *data)
1004{ 1009{
1005 Evas_Object *obj; 1010 Evas_Object *obj;
1006 Smart_Data *sd; 1011 Smart_Data *sd;
1007 1012
1008 obj = data; 1013 obj = data;
1009 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1014 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1010 sd->job = NULL; 1015 sd->job = NULL;
@@ -1023,7 +1028,7 @@ _pixels_get(void *data, Evas_Object *obj)
1023 Smart_Data *sd; 1028 Smart_Data *sd;
1024 Emotion_Format format; 1029 Emotion_Format format;
1025 unsigned char *bgra_data; 1030 unsigned char *bgra_data;
1026 1031
1027 sd = data; 1032 sd = data;
1028 evas_object_image_size_get(obj, &iw, &ih); 1033 evas_object_image_size_get(obj, &iw, &ih);
1029 sd->module->video_data_size_get(sd->video, &w, &h); 1034 sd->module->video_data_size_get(sd->video, &w, &h);
@@ -1048,14 +1053,14 @@ _pixels_get(void *data, Evas_Object *obj)
1048 if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420)) 1053 if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420))
1049 { 1054 {
1050 unsigned char **rows; 1055 unsigned char **rows;
1051 1056
1052 evas_object_image_colorspace_set(obj, EVAS_COLORSPACE_YCBCR422P601_PL); 1057 evas_object_image_colorspace_set(obj, EVAS_COLORSPACE_YCBCR422P601_PL);
1053 rows = evas_object_image_data_get(obj, 1); 1058 rows = evas_object_image_data_get(obj, 1);
1054 if (rows) 1059 if (rows)
1055 { 1060 {
1056 if (sd->module->yuv_rows_get(sd->video, iw, ih, 1061 if (sd->module->yuv_rows_get(sd->video, iw, ih,
1057 rows, 1062 rows,
1058 &rows[ih], 1063 &rows[ih],
1059 &rows[ih + (ih / 2)])) 1064 &rows[ih + (ih / 2)]))
1060 evas_object_image_data_update_add(obj, 0, 0, iw, ih); 1065 evas_object_image_data_update_add(obj, 0, 0, iw, ih);
1061 } 1066 }
@@ -1074,10 +1079,10 @@ _pixels_get(void *data, Evas_Object *obj)
1074 } 1079 }
1075 } 1080 }
1076// no need for this because on any new frame decode info from the decoder 1081// no need for this because on any new frame decode info from the decoder
1077// module, the previous "current frame" is released (done) for us anyway 1082// module, the previous "current frame" is released (done) for us anyway
1078// sd->module->frame_done(sd->video); 1083// sd->module->frame_done(sd->video);
1079 1084
1080/* 1085/*
1081 evas_object_image_size_get(obj, &iw, &ih); 1086 evas_object_image_size_get(obj, &iw, &ih);
1082 sd->module->video_data_size_get(sd->video, &w, &h); 1087 sd->module->video_data_size_get(sd->video, &w, &h);
1083 if ((w != iw) || (h != ih)) 1088 if ((w != iw) || (h != ih))
@@ -1091,23 +1096,23 @@ _pixels_get(void *data, Evas_Object *obj)
1091 { 1096 {
1092 unsigned char **rows; 1097 unsigned char **rows;
1093 Evas_Pixel_Import_Source ps; 1098 Evas_Pixel_Import_Source ps;
1094 1099
1095 ps.format = EVAS_PIXEL_FORMAT_YUV420P_601; 1100 ps.format = EVAS_PIXEL_FORMAT_YUV420P_601;
1096 ps.w = iw; 1101 ps.w = iw;
1097 ps.h = ih; 1102 ps.h = ih;
1098 1103
1099 ps.rows = malloc(ps.h * 2 * sizeof(void *)); 1104 ps.rows = malloc(ps.h * 2 * sizeof(void *));
1100 if (!ps.rows) 1105 if (!ps.rows)
1101 { 1106 {
1102 sd->module->frame_done(sd->video); 1107 sd->module->frame_done(sd->video);
1103 return; 1108 return;
1104 } 1109 }
1105 1110
1106 rows = (unsigned char **)ps.rows; 1111 rows = (unsigned char **)ps.rows;
1107 1112
1108 if (sd->module->yuv_rows_get(sd->video, iw, ih, 1113 if (sd->module->yuv_rows_get(sd->video, iw, ih,
1109 rows, 1114 rows,
1110 &rows[ps.h], 1115 &rows[ps.h],
1111 &rows[ps.h + (ps.h / 2)])) 1116 &rows[ps.h + (ps.h / 2)]))
1112 evas_object_image_pixels_import(obj, &ps); 1117 evas_object_image_pixels_import(obj, &ps);
1113 evas_object_image_pixels_dirty_set(obj, 0); 1118 evas_object_image_pixels_dirty_set(obj, 0);
@@ -1122,7 +1127,7 @@ _pixels_get(void *data, Evas_Object *obj)
1122 } 1127 }
1123 } 1128 }
1124 sd->module->frame_done(sd->video); 1129 sd->module->frame_done(sd->video);
1125 */ 1130 */
1126} 1131}
1127 1132
1128/*******************************************/ 1133/*******************************************/
@@ -1157,7 +1162,7 @@ _smart_add(Evas_Object * obj)
1157{ 1162{
1158 Smart_Data *sd; 1163 Smart_Data *sd;
1159 unsigned int *pixel; 1164 unsigned int *pixel;
1160 1165
1161 sd = calloc(1, sizeof(Smart_Data)); 1166 sd = calloc(1, sizeof(Smart_Data));
1162 if (!sd) return; 1167 if (!sd) return;
1163 sd->obj = evas_object_image_add(evas_object_evas_get(obj)); 1168 sd->obj = evas_object_image_add(evas_object_evas_get(obj));
@@ -1176,11 +1181,12 @@ _smart_add(Evas_Object * obj)
1176 } 1181 }
1177 evas_object_smart_data_set(obj, sd); 1182 evas_object_smart_data_set(obj, sd);
1178} 1183}
1179 1184
1180static void 1185static void
1181_smart_del(Evas_Object * obj) 1186_smart_del(Evas_Object * obj)
1182{ 1187{
1183 Smart_Data *sd; 1188 Smart_Data *sd;
1189
1184 sd = evas_object_smart_data_get(obj); 1190 sd = evas_object_smart_data_get(obj);
1185 if (!sd) return; 1191 if (!sd) return;
1186 if (sd->video) sd->module->file_close(sd->video); 1192 if (sd->video) sd->module->file_close(sd->video);
@@ -1199,7 +1205,7 @@ static void
1199_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y) 1205_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
1200{ 1206{
1201 Smart_Data *sd; 1207 Smart_Data *sd;
1202 1208
1203 sd = evas_object_smart_data_get(obj); 1209 sd = evas_object_smart_data_get(obj);
1204 if (!sd) return; 1210 if (!sd) return;
1205 evas_object_move(sd->obj, x, y); 1211 evas_object_move(sd->obj, x, y);
@@ -1209,7 +1215,7 @@ static void
1209_smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h) 1215_smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h)
1210{ 1216{
1211 Smart_Data *sd; 1217 Smart_Data *sd;
1212 1218
1213 sd = evas_object_smart_data_get(obj); 1219 sd = evas_object_smart_data_get(obj);
1214 if (!sd) return; 1220 if (!sd) return;
1215 evas_object_image_fill_set(sd->obj, 0, 0, w, h); 1221 evas_object_image_fill_set(sd->obj, 0, 0, w, h);
@@ -1220,18 +1226,18 @@ static void
1220_smart_show(Evas_Object * obj) 1226_smart_show(Evas_Object * obj)
1221{ 1227{
1222 Smart_Data *sd; 1228 Smart_Data *sd;
1223 1229
1224 sd = evas_object_smart_data_get(obj); 1230 sd = evas_object_smart_data_get(obj);
1225 if (!sd) return; 1231 if (!sd) return;
1226 evas_object_show(sd->obj); 1232 evas_object_show(sd->obj);
1227 1233
1228} 1234}
1229 1235
1230static void 1236static void
1231_smart_hide(Evas_Object * obj) 1237_smart_hide(Evas_Object * obj)
1232{ 1238{
1233 Smart_Data *sd; 1239 Smart_Data *sd;
1234 1240
1235 sd = evas_object_smart_data_get(obj); 1241 sd = evas_object_smart_data_get(obj);
1236 if (!sd) return; 1242 if (!sd) return;
1237 evas_object_hide(sd->obj); 1243 evas_object_hide(sd->obj);
@@ -1241,7 +1247,7 @@ static void
1241_smart_color_set(Evas_Object * obj, int r, int g, int b, int a) 1247_smart_color_set(Evas_Object * obj, int r, int g, int b, int a)
1242{ 1248{
1243 Smart_Data *sd; 1249 Smart_Data *sd;
1244 1250
1245 sd = evas_object_smart_data_get(obj); 1251 sd = evas_object_smart_data_get(obj);
1246 if (!sd) return; 1252 if (!sd) return;
1247 evas_object_color_set(sd->obj, r, g, b, a); 1253 evas_object_color_set(sd->obj, r, g, b, a);
@@ -1251,7 +1257,7 @@ static void
1251_smart_clip_set(Evas_Object * obj, Evas_Object * clip) 1257_smart_clip_set(Evas_Object * obj, Evas_Object * clip)
1252{ 1258{
1253 Smart_Data *sd; 1259 Smart_Data *sd;
1254 1260
1255 sd = evas_object_smart_data_get(obj); 1261 sd = evas_object_smart_data_get(obj);
1256 if (!sd) return; 1262 if (!sd) return;
1257 evas_object_clip_set(sd->obj, clip); 1263 evas_object_clip_set(sd->obj, clip);
@@ -1261,8 +1267,8 @@ static void
1261_smart_clip_unset(Evas_Object * obj) 1267_smart_clip_unset(Evas_Object * obj)
1262{ 1268{
1263 Smart_Data *sd; 1269 Smart_Data *sd;
1264 1270
1265 sd = evas_object_smart_data_get(obj); 1271 sd = evas_object_smart_data_get(obj);
1266 if (!sd) return; 1272 if (!sd) return;
1267 evas_object_clip_unset(sd->obj); 1273 evas_object_clip_unset(sd->obj);
1268} 1274}