summaryrefslogtreecommitdiff
path: root/src/modules/ethumb
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-04-26 14:49:26 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2015-06-07 11:00:52 +0300
commitf9c116a48749c642eb31154a4cfb5f60a110dcba (patch)
tree2cbf4d8891d6aa65c5f8867cb95549947208b864 /src/modules/ethumb
parentb563efc52ffbc02ae33d4901326a583102975cbb (diff)
emotion: porting evas smart callbacks to eo
Diffstat (limited to 'src/modules/ethumb')
-rw-r--r--src/modules/ethumb/emotion/emotion.c56
1 files changed, 35 insertions, 21 deletions
diff --git a/src/modules/ethumb/emotion/emotion.c b/src/modules/ethumb/emotion/emotion.c
index 4443712be6..6134406af3 100644
--- a/src/modules/ethumb/emotion/emotion.c
+++ b/src/modules/ethumb/emotion/emotion.c
@@ -1,5 +1,8 @@
1#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
2#include "config.h" 2#include "config.h"
3#else
4#define EFL_EO_API_SUPPORT
5#define EFL_BETA_API_SUPPORT
3#endif 6#endif
4 7
5#include "Ethumb.h" 8#include "Ethumb.h"
@@ -9,6 +12,7 @@
9 12
10#include <stdio.h> 13#include <stdio.h>
11#include <stdlib.h> 14#include <stdlib.h>
15#include <Eo.h>
12#include <Eina.h> 16#include <Eina.h>
13#include <Eet.h> 17#include <Eet.h>
14#include <Ecore_File.h> 18#include <Ecore_File.h>
@@ -67,8 +71,9 @@ _resize_movie(struct _emotion_plugin *_plugin)
67 emotion_object_audio_mute_set(_plugin->video, 1); 71 emotion_object_audio_mute_set(_plugin->video, 1);
68} 72}
69 73
70static void 74static Eina_Bool
71_frame_decode_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 75_frame_decode_cb(void *data,
76 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
72{ 77{
73 struct _emotion_plugin *_plugin = data; 78 struct _emotion_plugin *_plugin = data;
74 79
@@ -76,16 +81,22 @@ _frame_decode_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_U
76 _frame_grab(data); 81 _frame_grab(data);
77 else 82 else
78 _frame_grab_single(data); 83 _frame_grab_single(data);
79}
80 84
81static void 85 return EINA_TRUE;
82_frame_resized_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 86 }
87
88static Eina_Bool
89_frame_resized_cb(void *data,
90 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
83{ 91{
84 _resize_movie(data); 92 _resize_movie(data);
93
94 return EINA_TRUE;
85} 95}
86 96
87static void 97static Eina_Bool
88_video_stopped_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 98_video_stopped_cb(void *data,
99 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
89{ 100{
90 struct _emotion_plugin *_plugin = data; 101 struct _emotion_plugin *_plugin = data;
91 102
@@ -94,6 +105,8 @@ _video_stopped_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_
94 _plugin->ptotal = 0; 105 _plugin->ptotal = 0;
95 _plugin->first = EINA_FALSE; 106 _plugin->first = EINA_FALSE;
96 _plugin->total_time = _plugin->tmp_time; 107 _plugin->total_time = _plugin->tmp_time;
108
109 return EINA_TRUE;
97} 110}
98 111
99static void 112static void
@@ -194,12 +207,12 @@ _finish_thumb_generation(struct _emotion_plugin *_plugin, int success)
194{ 207{
195 int r = 0; 208 int r = 0;
196 209
197 evas_object_smart_callback_del(_plugin->video, "frame_resize", 210 eo_do(_plugin->video, eo_event_callback_del(
198 _frame_resized_cb); 211 EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin));
199 evas_object_smart_callback_del(_plugin->video, "frame_decode", 212 eo_do(_plugin->video, eo_event_callback_del(
200 _frame_decode_cb); 213 EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb, _plugin));
201 evas_object_smart_callback_del(_plugin->video, "decode_stop", 214 eo_do(_plugin->video, eo_event_callback_del(
202 _video_stopped_cb); 215 EMOTION_OBJECT_EVENT_DECODE_STOP, _video_stopped_cb, _plugin));
203 216
204 emotion_object_play_set(_plugin->video, 0); 217 emotion_object_play_set(_plugin->video, 0);
205 218
@@ -243,8 +256,9 @@ _frame_grab_single(void *data)
243 256
244 ethumb_image_save(e); 257 ethumb_image_save(e);
245 258
246 evas_object_smart_callback_del(_plugin->video, "frame_resize", 259 eo_do(_plugin->video, eo_event_callback_del(
247 _frame_resized_cb); 260 EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin));
261
248 emotion_object_play_set(_plugin->video, 0); 262 emotion_object_play_set(_plugin->video, 0);
249 evas_object_del(_plugin->video); 263 evas_object_del(_plugin->video);
250 free(_plugin); 264 free(_plugin);
@@ -383,12 +397,12 @@ _thumb_generate(Ethumb *e)
383 _plugin->pcount = 1; 397 _plugin->pcount = 1;
384 398
385 _resize_movie(_plugin); 399 _resize_movie(_plugin);
386 evas_object_smart_callback_add(o, "frame_decode", 400 eo_do(o, eo_event_callback_add
387 _frame_decode_cb, _plugin); 401 (EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb, _plugin));
388 evas_object_smart_callback_add(o, "frame_resize", 402 eo_do(o, eo_event_callback_add
389 _frame_resized_cb, _plugin); 403 (EMOTION_OBJECT_EVENT_FRAME_RESIZE,_frame_resized_cb, _plugin));
390 evas_object_smart_callback_add(o, "decode_stop", 404 eo_do(o, eo_event_callback_add
391 _video_stopped_cb, _plugin); 405 (EMOTION_OBJECT_EVENT_DECODE_STOP, _video_stopped_cb, _plugin));
392 406
393 if (f == ETHUMB_THUMB_EET) 407 if (f == ETHUMB_THUMB_EET)
394 { 408 {