summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib/emotion_smart.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-08-02 16:22:30 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-08-02 16:22:30 +0000
commit828b67374e0bd4547772842df66a467b012a2723 (patch)
treeee277e1c47eb3197d97ad6efa3a13de52cae5b24 /legacy/emotion/src/lib/emotion_smart.c
parent1cffa73758853130abeb378239da5ad9eb9cdf1f (diff)
emotion: make gstreamer backend async and handle it correctly every where.
SVN revision: 62010
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 986e3d1013..72171032ae 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -82,6 +82,7 @@ struct _Smart_Data
82 82
83 double ratio; 83 double ratio;
84 double pos; 84 double pos;
85 double remember_jump;
85 double seek_pos; 86 double seek_pos;
86 double len; 87 double len;
87 88
@@ -89,7 +90,9 @@ struct _Smart_Data
89 90
90 Emotion_Suspend state; 91 Emotion_Suspend state;
91 92
93 Eina_Bool open : 1;
92 Eina_Bool play : 1; 94 Eina_Bool play : 1;
95 Eina_Bool remember_play : 1;
93 Eina_Bool seek : 1; 96 Eina_Bool seek : 1;
94 Eina_Bool seeking : 1; 97 Eina_Bool seeking : 1;
95}; 98};
@@ -329,8 +332,10 @@ emotion_object_init(Evas_Object *obj, const char *module_filename)
329 sd->spu.button = -1; 332 sd->spu.button = -1;
330 sd->ratio = 1.0; 333 sd->ratio = 1.0;
331 sd->pos = 0; 334 sd->pos = 0;
335 sd->remember_jump = 0;
332 sd->seek_pos = 0; 336 sd->seek_pos = 0;
333 sd->len = 0; 337 sd->len = 0;
338 sd->remember_play = 0;
334 339
335 _emotion_module_close(sd->module, sd->video); 340 _emotion_module_close(sd->module, sd->video);
336 sd->module = NULL; 341 sd->module = NULL;
@@ -370,6 +375,7 @@ emotion_object_file_set(Evas_Object *obj, const char *file)
370 sd->module->file_close(sd->video); 375 sd->module->file_close(sd->video);
371 evas_object_image_data_set(sd->obj, NULL); 376 evas_object_image_data_set(sd->obj, NULL);
372 evas_object_image_size_set(sd->obj, 1, 1); 377 evas_object_image_size_set(sd->obj, 1, 1);
378 sd->open = 0;
373 if (!sd->module->file_open(sd->file, obj, sd->video)) 379 if (!sd->module->file_open(sd->file, obj, sd->video))
374 return EINA_FALSE; 380 return EINA_FALSE;
375 sd->module->size_get(sd->video, &w, &h); 381 sd->module->size_get(sd->video, &w, &h);
@@ -419,7 +425,13 @@ emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
419 if (play == sd->play) return; 425 if (play == sd->play) return;
420 if (!sd->module) return; 426 if (!sd->module) return;
421 if (!sd->video) return; 427 if (!sd->video) return;
428 if (!sd->open)
429 {
430 sd->remember_play = play;
431 return;
432 }
422 sd->play = play; 433 sd->play = play;
434 sd->remember_play = play;
423 if (sd->state != EMOTION_WAKEUP) emotion_object_suspend_set(obj, EMOTION_WAKEUP); 435 if (sd->state != EMOTION_WAKEUP) emotion_object_suspend_set(obj, EMOTION_WAKEUP);
424 if (sd->play) sd->module->play(sd->video, sd->pos); 436 if (sd->play) sd->module->play(sd->video, sd->pos);
425 else sd->module->stop(sd->video); 437 else sd->module->stop(sd->video);
@@ -445,6 +457,12 @@ emotion_object_position_set(Evas_Object *obj, double sec)
445 DBG("sec=%f", sec); 457 DBG("sec=%f", sec);
446 if (!sd->module) return; 458 if (!sd->module) return;
447 if (!sd->video) return; 459 if (!sd->video) return;
460 if (!sd->open)
461 {
462 sd->remember_jump = sec;
463 return ;
464 }
465 sd->remember_jump = 0;
448 sd->seek_pos = sec; 466 sd->seek_pos = sec;
449 sd->seek = 1; 467 sd->seek = 1;
450 sd->pos = sd->seek_pos; 468 sd->pos = sd->seek_pos;
@@ -1064,7 +1082,11 @@ emotion_object_last_position_load(Evas_Object *obj)
1064 1082
1065 EINA_REFCOUNT_REF(sd); 1083 EINA_REFCOUNT_REF(sd);
1066 1084
1067 sd->load_xattr = eio_file_xattr_get(tmp, "user.e.time_seek", _eio_load_xattr_done, _eio_load_xattr_error, sd); 1085 sd->load_xattr = eio_file_xattr_get(tmp,
1086 "user.e.time_seek",
1087 _eio_load_xattr_done,
1088 _eio_load_xattr_error,
1089 sd);
1068#else 1090#else
1069# ifdef HAVE_XATTR 1091# ifdef HAVE_XATTR
1070 { 1092 {
@@ -1266,6 +1288,15 @@ _emotion_decode_stop(Evas_Object *obj)
1266EAPI void 1288EAPI void
1267_emotion_open_done(Evas_Object *obj) 1289_emotion_open_done(Evas_Object *obj)
1268{ 1290{
1291 Smart_Data *sd;
1292
1293 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1294 sd->open = 1;
1295
1296 if (sd->remember_jump)
1297 emotion_object_position_set(obj, sd->remember_jump);
1298 if (sd->remember_play != sd->play)
1299 emotion_object_play_set(obj, sd->remember_play);
1269 evas_object_smart_callback_call(obj, SIG_OPEN_DONE, NULL); 1300 evas_object_smart_callback_call(obj, SIG_OPEN_DONE, NULL);
1270} 1301}
1271 1302