summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-02-16 20:33:11 +0100
committerdavemds <dave@gurumeditation.it>2014-02-16 20:33:11 +0100
commit064307edee5d9d099655275ad325ad89828c161c (patch)
treeb00164f3b9b6cce01c00e83fd3c7cdd612f9a37c
parent11e04529f8418925fc1746d03b926e0accae542b (diff)
Emotion test: more cleanups
* really free Frame_Data on EVAS_CALLBACK_FREE (data was NULL) * place video windows with an incremental offset
-rw-r--r--src/tests/emotion/emotion_test_main.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c
index ed308d5ed9..8baf23d9eb 100644
--- a/src/tests/emotion/emotion_test_main.c
+++ b/src/tests/emotion/emotion_test_main.c
@@ -564,12 +564,10 @@ static void
564init_video_object(const char *module_filename, const char *filename) 564init_video_object(const char *module_filename, const char *filename)
565{ 565{
566 Evas_Object *o, *oe; 566 Evas_Object *o, *oe;
567 int iw, ih; 567 Evas_Coord w, h, offset;
568 Evas_Coord w, h;
569 Frame_Data *fd; 568 Frame_Data *fd;
570 569
571 570 /* basic video object setup */
572/* basic video object setup */
573 o = emotion_object_add(evas); 571 o = emotion_object_add(evas);
574 if (!emotion_object_init(o, module_filename)) 572 if (!emotion_object_init(o, module_filename))
575 return; 573 return;
@@ -583,32 +581,27 @@ init_video_object(const char *module_filename, const char *filename)
583 evas_object_resize(o, 320, 240); 581 evas_object_resize(o, 320, 240);
584 emotion_object_smooth_scale_set(o, 1); 582 emotion_object_smooth_scale_set(o, 1);
585 evas_object_show(o); 583 evas_object_show(o);
586/* end basic video setup. all the rest here is just to be fancy */
587
588 584
589 video_objs = eina_list_append(video_objs, o); 585 video_objs = eina_list_append(video_objs, o);
586 /* end basic video setup. all the rest here is just to be fancy */
590 587
591 emotion_object_size_get(o, &iw, &ih);
592 w = iw; h = ih;
593 588
594 fd = calloc(1, sizeof(Frame_Data)); 589 fd = calloc(1, sizeof(Frame_Data));
595 if (!fd) exit(1); 590 if (!fd) exit(1);
596 591
597 oe = edje_object_add(evas); 592 oe = edje_object_add(evas);
598 evas_object_event_callback_add(oe, EVAS_CALLBACK_FREE, _oe_free_cb, NULL); 593 evas_object_event_callback_add(oe, EVAS_CALLBACK_FREE, _oe_free_cb, fd);
599 evas_object_data_set(oe, "frame_data", fd); 594 evas_object_data_set(oe, "frame_data", fd);
600 if (reflex) 595 if (reflex)
601 edje_object_file_set(oe, theme_file, "video_controller/reflex"); 596 edje_object_file_set(oe, theme_file, "video_controller/reflex");
602 else 597 else
603 edje_object_file_set(oe, theme_file, "video_controller"); 598 edje_object_file_set(oe, theme_file, "video_controller");
604 edje_extern_object_min_size_set(o, w, h);
605 edje_object_part_swallow(oe, "video_swallow", o); 599 edje_object_part_swallow(oe, "video_swallow", o);
600
601 offset = 20 * (eina_list_count(video_objs) - 1);
602 evas_object_move(oe, offset, offset);
606 edje_object_size_min_calc(oe, &w, &h); 603 edje_object_size_min_calc(oe, &w, &h);
607// evas_object_move(oe, rand() % (int)(startw - w), rand() % (int)(starth - h));
608 evas_object_move(oe, 0, 0);
609 evas_object_resize(oe, w, h); 604 evas_object_resize(oe, w, h);
610 edje_extern_object_min_size_set(o, 0, 0);
611 edje_object_part_swallow(oe, "video_swallow", o);
612 605
613 evas_object_smart_callback_add(o, "frame_decode", video_obj_frame_decode_cb, oe); 606 evas_object_smart_callback_add(o, "frame_decode", video_obj_frame_decode_cb, oe);
614 evas_object_smart_callback_add(o, "frame_resize", video_obj_frame_resize_cb, oe); 607 evas_object_smart_callback_add(o, "frame_resize", video_obj_frame_resize_cb, oe);