summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib/emotion_smart.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-10-21 14:59:22 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-10-21 14:59:22 +0000
commit0acd0ff1003893d1271b162685b0673558e822e0 (patch)
tree4f2432077d752229a992a8073584d7395e36f9a7 /legacy/emotion/src/lib/emotion_smart.c
parentce3a658ef7288c8ecc2ae36c05abdb23592f1771 (diff)
emotion: try to correctly fix the fill value.
SVN revision: 64255
Diffstat (limited to 'legacy/emotion/src/lib/emotion_smart.c')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c308
1 files changed, 168 insertions, 140 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 2fe4c53f1e..8a7ba22344 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -44,7 +44,7 @@ struct _Smart_Data
44{ 44{
45 EINA_REFCOUNT; 45 EINA_REFCOUNT;
46 Emotion_Video_Module *module; 46 Emotion_Video_Module *module;
47 void *video; 47 void *video_data;
48 48
49 char *module_name; 49 char *module_name;
50 50
@@ -79,8 +79,13 @@ struct _Smart_Data
79 int b; /* bottom */ 79 int b; /* bottom */
80 Evas_Object *clipper; 80 Evas_Object *clipper;
81 } crop; 81 } crop;
82 82
83 int w, h; 83 struct {
84 int w, h;
85 } video;
86 struct {
87 double w, h;
88 } fill;
84 89
85 double ratio; 90 double ratio;
86 double pos; 91 double pos;
@@ -203,8 +208,8 @@ _emotion_module_close(Emotion_Video_Module *mod, void *video)
203static void 208static void
204_smart_data_free(Smart_Data *sd) 209_smart_data_free(Smart_Data *sd)
205{ 210{
206 if (sd->video) sd->module->file_close(sd->video); 211 if (sd->video_data) sd->module->file_close(sd->video_data);
207 _emotion_module_close(sd->module, sd->video); 212 _emotion_module_close(sd->module, sd->video_data);
208 evas_object_del(sd->obj); 213 evas_object_del(sd->obj);
209 evas_object_del(sd->crop.clipper); 214 evas_object_del(sd->crop.clipper);
210 evas_object_del(sd->bg); 215 evas_object_del(sd->bg);
@@ -309,7 +314,10 @@ _clipper_position_size_update(Evas_Object *obj, int x, int y, int w, int h, int
309 scale_w = (double)w / (double)(vid_w - sd->crop.l - sd->crop.r); 314 scale_w = (double)w / (double)(vid_w - sd->crop.l - sd->crop.r);
310 scale_h = (double)h / (double)(vid_h - sd->crop.t - sd->crop.b); 315 scale_h = (double)h / (double)(vid_h - sd->crop.t - sd->crop.b);
311 316
312 evas_object_image_fill_set(sd->obj, 0, 0, vid_w * scale_w, vid_h * scale_h); 317 if (sd->fill.w < 0 && sd->fill.h < 0)
318 evas_object_image_fill_set(sd->obj, 0, 0, vid_w * scale_w, vid_h * scale_h);
319 else
320 evas_object_image_fill_set(sd->obj, 0, 0, sd->fill.w * w, sd->fill.h * h);
313 evas_object_resize(sd->obj, vid_w * scale_w, vid_h * scale_h); 321 evas_object_resize(sd->obj, vid_w * scale_w, vid_h * scale_h);
314 evas_object_move(sd->obj, x - sd->crop.l * scale_w, y - sd->crop.t * scale_h); 322 evas_object_move(sd->obj, x - sd->crop.l * scale_w, y - sd->crop.t * scale_h);
315 evas_object_resize(sd->crop.clipper, w, h); 323 evas_object_resize(sd->crop.clipper, w, h);
@@ -384,11 +392,11 @@ emotion_object_init(Evas_Object *obj, const char *module_filename)
384 sd->len = 0; 392 sd->len = 0;
385 sd->remember_play = 0; 393 sd->remember_play = 0;
386 394
387 _emotion_module_close(sd->module, sd->video); 395 _emotion_module_close(sd->module, sd->video_data);
388 sd->module = NULL; 396 sd->module = NULL;
389 sd->video = NULL; 397 sd->video_data = NULL;
390 398
391 module_filename = _emotion_module_open(module_filename, obj, &sd->module, &sd->video); 399 module_filename = _emotion_module_open(module_filename, obj, &sd->module, &sd->video_data);
392 if (!module_filename) 400 if (!module_filename)
393 return EINA_FALSE; 401 return EINA_FALSE;
394 402
@@ -413,28 +421,28 @@ emotion_object_file_set(Evas_Object *obj, const char *file)
413 DBG("file=%s", file); 421 DBG("file=%s", file);
414 if (!sd->module) return EINA_FALSE; 422 if (!sd->module) return EINA_FALSE;
415 423
416 sd->w = 0; 424 sd->video.w = 0;
417 sd->h = 0; 425 sd->video.h = 0;
418 if ((file) && (sd->file) && 426 if ((file) && (sd->file) &&
419 ((file == sd->file) || (!strcmp(file, sd->file)))) return EINA_FALSE; 427 ((file == sd->file) || (!strcmp(file, sd->file)))) return EINA_FALSE;
420 if ((file) && (file[0] != 0)) 428 if ((file) && (file[0] != 0))
421 { 429 {
422 eina_stringshare_replace(&sd->file, file); 430 eina_stringshare_replace(&sd->file, file);
423 sd->module->file_close(sd->video); 431 sd->module->file_close(sd->video_data);
424 evas_object_image_data_set(sd->obj, NULL); 432 evas_object_image_data_set(sd->obj, NULL);
425 evas_object_image_size_set(sd->obj, 1, 1); 433 evas_object_image_size_set(sd->obj, 1, 1);
426 _emotion_image_data_zero(sd->obj); 434 _emotion_image_data_zero(sd->obj);
427 sd->open = 0; 435 sd->open = 0;
428 if (!sd->module->file_open(sd->file, obj, sd->video)) 436 if (!sd->module->file_open(sd->file, obj, sd->video_data))
429 return EINA_FALSE; 437 return EINA_FALSE;
430 sd->pos = 0.0; 438 sd->pos = 0.0;
431 if (sd->play) sd->module->play(sd->video, 0.0); 439 if (sd->play) sd->module->play(sd->video_data, 0.0);
432 } 440 }
433 else 441 else
434 { 442 {
435 if (sd->video && sd->module) 443 if (sd->video_data && sd->module)
436 { 444 {
437 sd->module->file_close(sd->video); 445 sd->module->file_close(sd->video_data);
438 evas_object_image_data_set(sd->obj, NULL); 446 evas_object_image_data_set(sd->obj, NULL);
439 evas_object_image_size_set(sd->obj, 1, 1); 447 evas_object_image_size_set(sd->obj, 1, 1);
440 _emotion_image_data_zero(sd->obj); 448 _emotion_image_data_zero(sd->obj);
@@ -508,7 +516,9 @@ _emotion_object_aspect_border_apply(Evas_Object *obj, Smart_Data *sd, int w, int
508 double r; 516 double r;
509 517
510 int aspect_opt; 518 int aspect_opt;
511 sd->module->video_data_size_get(sd->video, &iw, &ih); 519
520 iw = sd->video.w;
521 ih = sd->video.h;
512 522
513 ir = (double)iw / ih; 523 ir = (double)iw / ih;
514 r = (double)w / h; 524 r = (double)w / h;
@@ -674,7 +684,7 @@ emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
674 DBG("play=%hhu, was=%hhu", play, sd->play); 684 DBG("play=%hhu, was=%hhu", play, sd->play);
675 if (play == sd->play) return; 685 if (play == sd->play) return;
676 if (!sd->module) return; 686 if (!sd->module) return;
677 if (!sd->video) return; 687 if (!sd->video_data) return;
678 if (!sd->open) 688 if (!sd->open)
679 { 689 {
680 sd->remember_play = play; 690 sd->remember_play = play;
@@ -683,8 +693,8 @@ emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
683 sd->play = play; 693 sd->play = play;
684 sd->remember_play = play; 694 sd->remember_play = play;
685 if (sd->state != EMOTION_WAKEUP) emotion_object_suspend_set(obj, EMOTION_WAKEUP); 695 if (sd->state != EMOTION_WAKEUP) emotion_object_suspend_set(obj, EMOTION_WAKEUP);
686 if (sd->play) sd->module->play(sd->video, sd->pos); 696 if (sd->play) sd->module->play(sd->video_data, sd->pos);
687 else sd->module->stop(sd->video); 697 else sd->module->stop(sd->video_data);
688} 698}
689 699
690EAPI Eina_Bool 700EAPI Eina_Bool
@@ -693,7 +703,7 @@ emotion_object_play_get(const Evas_Object *obj)
693 Smart_Data *sd; 703 Smart_Data *sd;
694 704
695 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 705 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
696 if (!sd->video) return EINA_FALSE; 706 if (!sd->video_data) return EINA_FALSE;
697 707
698 return sd->play; 708 return sd->play;
699} 709}
@@ -706,7 +716,7 @@ emotion_object_position_set(Evas_Object *obj, double sec)
706 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 716 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
707 DBG("sec=%f", sec); 717 DBG("sec=%f", sec);
708 if (!sd->module) return; 718 if (!sd->module) return;
709 if (!sd->video) return; 719 if (!sd->video_data) return;
710 if (!sd->open) 720 if (!sd->open)
711 { 721 {
712 sd->remember_jump = sec; 722 sd->remember_jump = sec;
@@ -727,9 +737,9 @@ emotion_object_position_get(const Evas_Object *obj)
727 737
728 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 738 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
729 if (!sd->module) return 0.0; 739 if (!sd->module) return 0.0;
730 if (!sd->video) return 0.0; 740 if (!sd->video_data) return 0.0;
731 if (!sd->module->pos_get) return 0.0; 741 if (!sd->module->pos_get) return 0.0;
732 sd->pos = sd->module->pos_get(sd->video); 742 sd->pos = sd->module->pos_get(sd->video_data);
733 return sd->pos; 743 return sd->pos;
734} 744}
735 745
@@ -740,8 +750,8 @@ emotion_object_seekable_get(const Evas_Object *obj)
740 750
741 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 751 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
742 if (!sd->module) return EINA_FALSE; 752 if (!sd->module) return EINA_FALSE;
743 if (!sd->video) return EINA_FALSE; 753 if (!sd->video_data) return EINA_FALSE;
744 return sd->module->seekable(sd->video); 754 return sd->module->seekable(sd->video_data);
745} 755}
746 756
747EAPI Eina_Bool 757EAPI Eina_Bool
@@ -751,8 +761,8 @@ emotion_object_video_handled_get(const Evas_Object *obj)
751 761
752 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 762 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
753 if (!sd->module) return EINA_FALSE; 763 if (!sd->module) return EINA_FALSE;
754 if (!sd->video) return EINA_FALSE; 764 if (!sd->video_data) return EINA_FALSE;
755 return sd->module->video_handled(sd->video); 765 return sd->module->video_handled(sd->video_data);
756} 766}
757 767
758EAPI Eina_Bool 768EAPI Eina_Bool
@@ -762,8 +772,8 @@ emotion_object_audio_handled_get(const Evas_Object *obj)
762 772
763 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 773 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
764 if (!sd->module) return EINA_FALSE; 774 if (!sd->module) return EINA_FALSE;
765 if (!sd->video) return EINA_FALSE; 775 if (!sd->video_data) return EINA_FALSE;
766 return sd->module->audio_handled(sd->video); 776 return sd->module->audio_handled(sd->video_data);
767} 777}
768 778
769EAPI double 779EAPI double
@@ -773,8 +783,8 @@ emotion_object_play_length_get(const Evas_Object *obj)
773 783
774 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 784 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
775 if (!sd->module) return 0.0; 785 if (!sd->module) return 0.0;
776 if (!sd->video) return 0.0; 786 if (!sd->video_data) return 0.0;
777 sd->len = sd->module->len_get(sd->video); 787 sd->len = sd->module->len_get(sd->video_data);
778 return sd->len; 788 return sd->len;
779} 789}
780 790
@@ -786,8 +796,8 @@ emotion_object_size_get(const Evas_Object *obj, int *iw, int *ih)
786 if (iw) *iw = 0; 796 if (iw) *iw = 0;
787 if (ih) *ih = 0; 797 if (ih) *ih = 0;
788 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 798 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
789 if (iw) *iw = sd->w; 799 if (iw) *iw = sd->video.w;
790 if (ih) *ih = sd->h; 800 if (ih) *ih = sd->video.h;
791} 801}
792 802
793EAPI void 803EAPI void
@@ -815,7 +825,7 @@ emotion_object_ratio_get(const Evas_Object *obj)
815 825
816 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0); 826 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0);
817 if (!sd->module) return 0.0; 827 if (!sd->module) return 0.0;
818 if (!sd->video) return 0.0; 828 if (!sd->video_data) return 0.0;
819 return sd->ratio; 829 return sd->ratio;
820} 830}
821 831
@@ -829,8 +839,8 @@ emotion_object_event_simple_send(Evas_Object *obj, Emotion_Event ev)
829 839
830 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 840 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
831 if (!sd->module) return; 841 if (!sd->module) return;
832 if (!sd->video) return; 842 if (!sd->video_data) return;
833 sd->module->event_feed(sd->video, ev); 843 sd->module->event_feed(sd->video_data, ev);
834} 844}
835 845
836EAPI void 846EAPI void
@@ -841,8 +851,8 @@ emotion_object_audio_volume_set(Evas_Object *obj, double vol)
841 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 851 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
842 DBG("vol=%f", vol); 852 DBG("vol=%f", vol);
843 if (!sd->module) return; 853 if (!sd->module) return;
844 if (!sd->video) return; 854 if (!sd->video_data) return;
845 sd->module->audio_channel_volume_set(sd->video, vol); 855 sd->module->audio_channel_volume_set(sd->video_data, vol);
846} 856}
847 857
848EAPI double 858EAPI double
@@ -852,8 +862,8 @@ emotion_object_audio_volume_get(const Evas_Object *obj)
852 862
853 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0); 863 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 1.0);
854 if (!sd->module) return 0.0; 864 if (!sd->module) return 0.0;
855 if (!sd->video) return 0.0; 865 if (!sd->video_data) return 0.0;
856 return sd->module->audio_channel_volume_get(sd->video); 866 return sd->module->audio_channel_volume_get(sd->video_data);
857} 867}
858 868
859EAPI void 869EAPI void
@@ -864,8 +874,8 @@ emotion_object_audio_mute_set(Evas_Object *obj, Eina_Bool mute)
864 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 874 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
865 DBG("mute=%hhu", mute); 875 DBG("mute=%hhu", mute);
866 if (!sd->module) return; 876 if (!sd->module) return;
867 if (!sd->video) return; 877 if (!sd->video_data) return;
868 sd->module->audio_channel_mute_set(sd->video, mute); 878 sd->module->audio_channel_mute_set(sd->video_data, mute);
869} 879}
870 880
871EAPI Eina_Bool 881EAPI Eina_Bool
@@ -875,8 +885,8 @@ emotion_object_audio_mute_get(const Evas_Object *obj)
875 885
876 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 886 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
877 if (!sd->module) return EINA_FALSE; 887 if (!sd->module) return EINA_FALSE;
878 if (!sd->video) return EINA_FALSE; 888 if (!sd->video_data) return EINA_FALSE;
879 return sd->module->audio_channel_mute_get(sd->video); 889 return sd->module->audio_channel_mute_get(sd->video_data);
880} 890}
881 891
882EAPI int 892EAPI int
@@ -886,8 +896,8 @@ emotion_object_audio_channel_count(const Evas_Object *obj)
886 896
887 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 897 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
888 if (!sd->module) return 0; 898 if (!sd->module) return 0;
889 if (!sd->video) return 0; 899 if (!sd->video_data) return 0;
890 return sd->module->audio_channel_count(sd->video); 900 return sd->module->audio_channel_count(sd->video_data);
891} 901}
892 902
893EAPI const char * 903EAPI const char *
@@ -897,8 +907,8 @@ emotion_object_audio_channel_name_get(const Evas_Object *obj, int channel)
897 907
898 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 908 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
899 if (!sd->module) return NULL; 909 if (!sd->module) return NULL;
900 if (!sd->video) return NULL; 910 if (!sd->video_data) return NULL;
901 return sd->module->audio_channel_name_get(sd->video, channel); 911 return sd->module->audio_channel_name_get(sd->video_data, channel);
902} 912}
903 913
904EAPI void 914EAPI void
@@ -909,8 +919,8 @@ emotion_object_audio_channel_set(Evas_Object *obj, int channel)
909 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 919 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
910 DBG("channel=%d", channel); 920 DBG("channel=%d", channel);
911 if (!sd->module) return; 921 if (!sd->module) return;
912 if (!sd->video) return; 922 if (!sd->video_data) return;
913 sd->module->audio_channel_set(sd->video, channel); 923 sd->module->audio_channel_set(sd->video_data, channel);
914} 924}
915 925
916EAPI int 926EAPI int
@@ -920,8 +930,8 @@ emotion_object_audio_channel_get(const Evas_Object *obj)
920 930
921 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 931 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
922 if (!sd->module) return 0; 932 if (!sd->module) return 0;
923 if (!sd->video) return 0; 933 if (!sd->video_data) return 0;
924 return sd->module->audio_channel_get(sd->video); 934 return sd->module->audio_channel_get(sd->video_data);
925} 935}
926 936
927EAPI void 937EAPI void
@@ -932,8 +942,8 @@ emotion_object_video_mute_set(Evas_Object *obj, Eina_Bool mute)
932 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 942 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
933 DBG("mute=%hhu", mute); 943 DBG("mute=%hhu", mute);
934 if (!sd->module) return; 944 if (!sd->module) return;
935 if (!sd->video) return; 945 if (!sd->video_data) return;
936 sd->module->video_channel_mute_set(sd->video, mute); 946 sd->module->video_channel_mute_set(sd->video_data, mute);
937} 947}
938 948
939EAPI Eina_Bool 949EAPI Eina_Bool
@@ -943,8 +953,8 @@ emotion_object_video_mute_get(const Evas_Object *obj)
943 953
944 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 954 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
945 if (!sd->module) return EINA_FALSE; 955 if (!sd->module) return EINA_FALSE;
946 if (!sd->video) return EINA_FALSE; 956 if (!sd->video_data) return EINA_FALSE;
947 return sd->module->video_channel_mute_get(sd->video); 957 return sd->module->video_channel_mute_get(sd->video_data);
948} 958}
949 959
950EAPI int 960EAPI int
@@ -954,8 +964,8 @@ emotion_object_video_channel_count(const Evas_Object *obj)
954 964
955 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 965 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
956 if (!sd->module) return EINA_FALSE; 966 if (!sd->module) return EINA_FALSE;
957 if (!sd->video) return EINA_FALSE; 967 if (!sd->video_data) return EINA_FALSE;
958 return sd->module->video_channel_count(sd->video); 968 return sd->module->video_channel_count(sd->video_data);
959} 969}
960 970
961EAPI const char * 971EAPI const char *
@@ -965,8 +975,8 @@ emotion_object_video_channel_name_get(const Evas_Object *obj, int channel)
965 975
966 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 976 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
967 if (!sd->module) return NULL; 977 if (!sd->module) return NULL;
968 if (!sd->video) return NULL; 978 if (!sd->video_data) return NULL;
969 return sd->module->video_channel_name_get(sd->video, channel); 979 return sd->module->video_channel_name_get(sd->video_data, channel);
970} 980}
971 981
972EAPI void 982EAPI void
@@ -977,8 +987,8 @@ emotion_object_video_channel_set(Evas_Object *obj, int channel)
977 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 987 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
978 DBG("channel=%d", channel); 988 DBG("channel=%d", channel);
979 if (!sd->module) return; 989 if (!sd->module) return;
980 if (!sd->video) return; 990 if (!sd->video_data) return;
981 sd->module->video_channel_set(sd->video, channel); 991 sd->module->video_channel_set(sd->video_data, channel);
982} 992}
983 993
984EAPI int 994EAPI int
@@ -988,8 +998,8 @@ emotion_object_video_channel_get(const Evas_Object *obj)
988 998
989 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 999 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
990 if (!sd->module) return 0; 1000 if (!sd->module) return 0;
991 if (!sd->video) return 0; 1001 if (!sd->video_data) return 0;
992 return sd->module->video_channel_get(sd->video); 1002 return sd->module->video_channel_get(sd->video_data);
993} 1003}
994 1004
995EAPI void 1005EAPI void
@@ -1000,8 +1010,8 @@ emotion_object_spu_mute_set(Evas_Object *obj, Eina_Bool mute)
1000 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1010 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1001 DBG("mute=%hhu", mute); 1011 DBG("mute=%hhu", mute);
1002 if (!sd->module) return; 1012 if (!sd->module) return;
1003 if (!sd->video) return; 1013 if (!sd->video_data) return;
1004 sd->module->spu_channel_mute_set(sd->video, mute); 1014 sd->module->spu_channel_mute_set(sd->video_data, mute);
1005} 1015}
1006 1016
1007EAPI Eina_Bool 1017EAPI Eina_Bool
@@ -1011,8 +1021,8 @@ emotion_object_spu_mute_get(const Evas_Object *obj)
1011 1021
1012 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1022 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1013 if (!sd->module) return EINA_FALSE; 1023 if (!sd->module) return EINA_FALSE;
1014 if (!sd->video) return EINA_FALSE; 1024 if (!sd->video_data) return EINA_FALSE;
1015 return sd->module->spu_channel_mute_get(sd->video); 1025 return sd->module->spu_channel_mute_get(sd->video_data);
1016} 1026}
1017 1027
1018EAPI int 1028EAPI int
@@ -1022,8 +1032,8 @@ emotion_object_spu_channel_count(const Evas_Object *obj)
1022 1032
1023 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1033 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1024 if (!sd->module) return 0; 1034 if (!sd->module) return 0;
1025 if (!sd->video) return 0; 1035 if (!sd->video_data) return 0;
1026 return sd->module->spu_channel_count(sd->video); 1036 return sd->module->spu_channel_count(sd->video_data);
1027} 1037}
1028 1038
1029EAPI const char * 1039EAPI const char *
@@ -1033,8 +1043,8 @@ emotion_object_spu_channel_name_get(const Evas_Object *obj, int channel)
1033 1043
1034 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1044 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1035 if (!sd->module) return NULL; 1045 if (!sd->module) return NULL;
1036 if (!sd->video) return NULL; 1046 if (!sd->video_data) return NULL;
1037 return sd->module->spu_channel_name_get(sd->video, channel); 1047 return sd->module->spu_channel_name_get(sd->video_data, channel);
1038} 1048}
1039 1049
1040EAPI void 1050EAPI void
@@ -1045,8 +1055,8 @@ emotion_object_spu_channel_set(Evas_Object *obj, int channel)
1045 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1055 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1046 DBG("channel=%d", channel); 1056 DBG("channel=%d", channel);
1047 if (!sd->module) return; 1057 if (!sd->module) return;
1048 if (!sd->video) return; 1058 if (!sd->video_data) return;
1049 sd->module->spu_channel_set(sd->video, channel); 1059 sd->module->spu_channel_set(sd->video_data, channel);
1050} 1060}
1051 1061
1052EAPI int 1062EAPI int
@@ -1056,8 +1066,8 @@ emotion_object_spu_channel_get(const Evas_Object *obj)
1056 1066
1057 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1067 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1058 if (!sd->module) return 0; 1068 if (!sd->module) return 0;
1059 if (!sd->video) return 0; 1069 if (!sd->video_data) return 0;
1060 return sd->module->spu_channel_get(sd->video); 1070 return sd->module->spu_channel_get(sd->video_data);
1061} 1071}
1062 1072
1063EAPI int 1073EAPI int
@@ -1067,8 +1077,8 @@ emotion_object_chapter_count(const Evas_Object *obj)
1067 1077
1068 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1078 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1069 if (!sd->module) return 0; 1079 if (!sd->module) return 0;
1070 if (!sd->video) return 0; 1080 if (!sd->video_data) return 0;
1071 return sd->module->chapter_count(sd->video); 1081 return sd->module->chapter_count(sd->video_data);
1072} 1082}
1073 1083
1074EAPI void 1084EAPI void
@@ -1079,8 +1089,8 @@ emotion_object_chapter_set(Evas_Object *obj, int chapter)
1079 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1089 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1080 DBG("chapter=%d", chapter); 1090 DBG("chapter=%d", chapter);
1081 if (!sd->module) return; 1091 if (!sd->module) return;
1082 if (!sd->video) return; 1092 if (!sd->video_data) return;
1083 sd->module->chapter_set(sd->video, chapter); 1093 sd->module->chapter_set(sd->video_data, chapter);
1084} 1094}
1085 1095
1086EAPI int 1096EAPI int
@@ -1090,8 +1100,8 @@ emotion_object_chapter_get(const Evas_Object *obj)
1090 1100
1091 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1101 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1092 if (!sd->module) return 0; 1102 if (!sd->module) return 0;
1093 if (!sd->video) return 0; 1103 if (!sd->video_data) return 0;
1094 return sd->module->chapter_get(sd->video); 1104 return sd->module->chapter_get(sd->video_data);
1095} 1105}
1096 1106
1097EAPI const char * 1107EAPI const char *
@@ -1101,8 +1111,8 @@ emotion_object_chapter_name_get(const Evas_Object *obj, int chapter)
1101 1111
1102 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1112 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1103 if (!sd->module) return NULL; 1113 if (!sd->module) return NULL;
1104 if (!sd->video) return NULL; 1114 if (!sd->video_data) return NULL;
1105 return sd->module->chapter_name_get(sd->video, chapter); 1115 return sd->module->chapter_name_get(sd->video_data, chapter);
1106} 1116}
1107 1117
1108EAPI void 1118EAPI void
@@ -1113,8 +1123,8 @@ emotion_object_play_speed_set(Evas_Object *obj, double speed)
1113 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1123 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1114 DBG("speed=%f", speed); 1124 DBG("speed=%f", speed);
1115 if (!sd->module) return; 1125 if (!sd->module) return;
1116 if (!sd->video) return; 1126 if (!sd->video_data) return;
1117 sd->module->speed_set(sd->video, speed); 1127 sd->module->speed_set(sd->video_data, speed);
1118} 1128}
1119 1129
1120EAPI double 1130EAPI double
@@ -1124,8 +1134,8 @@ emotion_object_play_speed_get(const Evas_Object *obj)
1124 1134
1125 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0); 1135 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0.0);
1126 if (!sd->module) return 0.0; 1136 if (!sd->module) return 0.0;
1127 if (!sd->video) return 0.0; 1137 if (!sd->video_data) return 0.0;
1128 return sd->module->speed_get(sd->video); 1138 return sd->module->speed_get(sd->video_data);
1129} 1139}
1130 1140
1131EAPI void 1141EAPI void
@@ -1135,8 +1145,8 @@ emotion_object_eject(Evas_Object *obj)
1135 1145
1136 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1146 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1137 if (!sd->module) return; 1147 if (!sd->module) return;
1138 if (!sd->video) return; 1148 if (!sd->video_data) return;
1139 sd->module->eject(sd->video); 1149 sd->module->eject(sd->video_data);
1140} 1150}
1141 1151
1142EAPI const char * 1152EAPI const char *
@@ -1209,30 +1219,23 @@ emotion_object_meta_info_get(const Evas_Object *obj, Emotion_Meta_Info meta)
1209 1219
1210 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1220 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1211 if (!sd->module) return NULL; 1221 if (!sd->module) return NULL;
1212 if (!sd->video) return NULL; 1222 if (!sd->video_data) return NULL;
1213 switch (meta) 1223 switch (meta)
1214 { 1224 {
1215 case EMOTION_META_INFO_TRACK_TITLE: 1225 case EMOTION_META_INFO_TRACK_TITLE:
1216 return sd->module->meta_get(sd->video, META_TRACK_TITLE); 1226 return sd->module->meta_get(sd->video_data, META_TRACK_TITLE);
1217 break;
1218 case EMOTION_META_INFO_TRACK_ARTIST: 1227 case EMOTION_META_INFO_TRACK_ARTIST:
1219 return sd->module->meta_get(sd->video, META_TRACK_ARTIST); 1228 return sd->module->meta_get(sd->video_data, META_TRACK_ARTIST);
1220 break;
1221 case EMOTION_META_INFO_TRACK_ALBUM: 1229 case EMOTION_META_INFO_TRACK_ALBUM:
1222 return sd->module->meta_get(sd->video, META_TRACK_ALBUM); 1230 return sd->module->meta_get(sd->video_data, META_TRACK_ALBUM);
1223 break;
1224 case EMOTION_META_INFO_TRACK_YEAR: 1231 case EMOTION_META_INFO_TRACK_YEAR:
1225 return sd->module->meta_get(sd->video, META_TRACK_YEAR); 1232 return sd->module->meta_get(sd->video_data, META_TRACK_YEAR);
1226 break;
1227 case EMOTION_META_INFO_TRACK_GENRE: 1233 case EMOTION_META_INFO_TRACK_GENRE:
1228 return sd->module->meta_get(sd->video, META_TRACK_GENRE); 1234 return sd->module->meta_get(sd->video_data, META_TRACK_GENRE);
1229 break;
1230 case EMOTION_META_INFO_TRACK_COMMENT: 1235 case EMOTION_META_INFO_TRACK_COMMENT:
1231 return sd->module->meta_get(sd->video, META_TRACK_COMMENT); 1236 return sd->module->meta_get(sd->video_data, META_TRACK_COMMENT);
1232 break;
1233 case EMOTION_META_INFO_TRACK_DISC_ID: 1237 case EMOTION_META_INFO_TRACK_DISC_ID:
1234 return sd->module->meta_get(sd->video, META_TRACK_DISCID); 1238 return sd->module->meta_get(sd->video_data, META_TRACK_DISCID);
1235 break;
1236 default: 1239 default:
1237 break; 1240 break;
1238 } 1241 }
@@ -1247,9 +1250,9 @@ emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization)
1247 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1250 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1248 DBG("visualization=%d", visualization); 1251 DBG("visualization=%d", visualization);
1249 if (!sd->module) return; 1252 if (!sd->module) return;
1250 if (!sd->video) return; 1253 if (!sd->video_data) return;
1251 if (!sd->module->vis_set) return; 1254 if (!sd->module->vis_set) return;
1252 sd->module->vis_set(sd->video, visualization); 1255 sd->module->vis_set(sd->video_data, visualization);
1253} 1256}
1254 1257
1255EAPI Emotion_Vis 1258EAPI Emotion_Vis
@@ -1259,9 +1262,9 @@ emotion_object_vis_get(const Evas_Object *obj)
1259 1262
1260 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_VIS_NONE); 1263 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_VIS_NONE);
1261 if (!sd->module) return EMOTION_VIS_NONE; 1264 if (!sd->module) return EMOTION_VIS_NONE;
1262 if (!sd->video) return EMOTION_VIS_NONE; 1265 if (!sd->video_data) return EMOTION_VIS_NONE;
1263 if (!sd->module->vis_get) return EMOTION_VIS_NONE; 1266 if (!sd->module->vis_get) return EMOTION_VIS_NONE;
1264 return sd->module->vis_get(sd->video); 1267 return sd->module->vis_get(sd->video_data);
1265} 1268}
1266 1269
1267EAPI Eina_Bool 1270EAPI Eina_Bool
@@ -1271,9 +1274,9 @@ emotion_object_vis_supported(const Evas_Object *obj, Emotion_Vis visualization)
1271 1274
1272 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1275 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1273 if (!sd->module) return EINA_FALSE; 1276 if (!sd->module) return EINA_FALSE;
1274 if (!sd->video) return EINA_FALSE; 1277 if (!sd->video_data) return EINA_FALSE;
1275 if (!sd->module->vis_supported) return EINA_FALSE; 1278 if (!sd->module->vis_supported) return EINA_FALSE;
1276 return sd->module->vis_supported(sd->video, visualization); 1279 return sd->module->vis_supported(sd->video_data, visualization);
1277} 1280}
1278 1281
1279EAPI void 1282EAPI void
@@ -1282,12 +1285,10 @@ emotion_object_priority_set(Evas_Object *obj, Eina_Bool priority)
1282 Smart_Data *sd; 1285 Smart_Data *sd;
1283 1286
1284 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1287 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1285 fprintf(stderr, "priority set %p\n", sd->module);
1286 if (!sd->module) return ; 1288 if (!sd->module) return ;
1287 if (!sd->video) return ; 1289 if (!sd->video_data) return ;
1288 if (!sd->module->priority_set) return ; 1290 if (!sd->module->priority_set) return ;
1289 fprintf(stderr, "calling\n"); 1291 sd->module->priority_set(sd->video_data, priority);
1290 sd->module->priority_set(sd->video, priority);
1291} 1292}
1292 1293
1293EAPI Eina_Bool 1294EAPI Eina_Bool
@@ -1297,9 +1298,9 @@ emotion_object_priority_get(const Evas_Object *obj)
1297 1298
1298 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 1299 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
1299 if (!sd->module) return EINA_FALSE; 1300 if (!sd->module) return EINA_FALSE;
1300 if (!sd->video) return EINA_FALSE; 1301 if (!sd->video_data) return EINA_FALSE;
1301 if (!sd->module->priority_get) return EINA_FALSE; 1302 if (!sd->module->priority_get) return EINA_FALSE;
1302 return sd->module->priority_get(sd->video); 1303 return sd->module->priority_get(sd->video_data);
1303} 1304}
1304 1305
1305#ifdef HAVE_EIO 1306#ifdef HAVE_EIO
@@ -1445,7 +1446,7 @@ _emotion_video_get(const Evas_Object *obj)
1445 Smart_Data *sd; 1446 Smart_Data *sd;
1446 1447
1447 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL); 1448 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1448 return sd->video; 1449 return sd->video_data;
1449} 1450}
1450 1451
1451EAPI void 1452EAPI void
@@ -1479,16 +1480,14 @@ EAPI void
1479_emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio) 1480_emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio)
1480{ 1481{
1481 Smart_Data *sd; 1482 Smart_Data *sd;
1482 int iw, ih;
1483 double tmp; 1483 double tmp;
1484 int changed = 0; 1484 int changed = 0;
1485 1485
1486 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1486 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1487 evas_object_image_size_get(sd->obj, &iw, &ih); 1487 if ((w != sd->video.w) || (h != sd->video.h))
1488 if ((w != iw) || (h != ih))
1489 { 1488 {
1490 sd->w = w; 1489 sd->video.w = w;
1491 sd->h = h; 1490 sd->video.h = h;
1492 _emotion_image_data_zero(sd->obj); 1491 _emotion_image_data_zero(sd->obj);
1493 changed = 1; 1492 changed = 1;
1494 } 1493 }
@@ -1632,7 +1631,38 @@ _emotion_seek_done(Evas_Object *obj)
1632 } 1631 }
1633} 1632}
1634 1633
1634EAPI void
1635_emotion_frame_refill(Evas_Object *obj, double w, double h)
1636{
1637 Smart_Data *sd;
1638
1639 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1640 if (sd->fill.w != w || sd->fill.h != h)
1641 {
1642 Evas_Coord ow, oh;
1643
1644 evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
1645 if (w <= 0 || h <= 0)
1646 {
1647 double scale_w, scale_h;
1648
1649 sd->fill.w = -1;
1650 sd->fill.h = -1;
1635 1651
1652 scale_w = (double) ow / (double)(sd->video.w - sd->crop.l - sd->crop.r);
1653 scale_h = (double) oh / (double)(sd->video.h - sd->crop.t - sd->crop.b);
1654
1655 evas_object_image_fill_set(sd->obj, 0, 0, scale_w * sd->video.w, scale_h * sd->video.h);
1656 }
1657 else
1658 {
1659 sd->fill.w = w;
1660 sd->fill.h = h;
1661
1662 evas_object_image_fill_set(sd->obj, 0, 0, w * ow, h * oh);
1663 }
1664 }
1665}
1636 1666
1637/****************************/ 1667/****************************/
1638/* Internal object routines */ 1668/* Internal object routines */
@@ -1649,13 +1679,13 @@ _mouse_move(void *data, Evas *ev __UNUSED__, Evas_Object *obj, void *event_info)
1649 e = event_info; 1679 e = event_info;
1650 sd = data; 1680 sd = data;
1651 if (!sd->module) return; 1681 if (!sd->module) return;
1652 if (!sd->video) return; 1682 if (!sd->video_data) return;
1653 evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); 1683 evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
1654 evas_object_image_size_get(obj, &iw, &ih); 1684 evas_object_image_size_get(obj, &iw, &ih);
1655 if ((iw < 1) || (ih < 1)) return; 1685 if ((iw < 1) || (ih < 1)) return;
1656 x = (((int)e->cur.canvas.x - ox) * iw) / ow; 1686 x = (((int)e->cur.canvas.x - ox) * iw) / ow;
1657 y = (((int)e->cur.canvas.y - oy) * ih) / oh; 1687 y = (((int)e->cur.canvas.y - oy) * ih) / oh;
1658 sd->module->event_mouse_move_feed(sd->video, x, y); 1688 sd->module->event_mouse_move_feed(sd->video_data, x, y);
1659} 1689}
1660 1690
1661static void 1691static void
@@ -1669,13 +1699,13 @@ _mouse_down(void *data, Evas *ev __UNUSED__, Evas_Object *obj, void *event_info)
1669 e = event_info; 1699 e = event_info;
1670 sd = data; 1700 sd = data;
1671 if (!sd->module) return; 1701 if (!sd->module) return;
1672 if (!sd->video) return; 1702 if (!sd->video_data) return;
1673 evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); 1703 evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
1674 evas_object_image_size_get(obj, &iw, &ih); 1704 evas_object_image_size_get(obj, &iw, &ih);
1675 if ((iw < 1) || (ih < 1)) return; 1705 if ((iw < 1) || (ih < 1)) return;
1676 x = (((int)e->canvas.x - ox) * iw) / ow; 1706 x = (((int)e->canvas.x - ox) * iw) / ow;
1677 y = (((int)e->canvas.y - oy) * ih) / oh; 1707 y = (((int)e->canvas.y - oy) * ih) / oh;
1678 sd->module->event_mouse_button_feed(sd->video, 1, x, y); 1708 sd->module->event_mouse_button_feed(sd->video_data, 1, x, y);
1679} 1709}
1680 1710
1681static void 1711static void
@@ -1691,7 +1721,7 @@ _pos_set_job(void *data)
1691 if (sd->seek) 1721 if (sd->seek)
1692 { 1722 {
1693 sd->seeking = 1; 1723 sd->seeking = 1;
1694 sd->module->pos_set(sd->video, sd->seek_pos); 1724 sd->module->pos_set(sd->video_data, sd->seek_pos);
1695 sd->seek = 0; 1725 sd->seek = 0;
1696 } 1726 }
1697} 1727}
@@ -1706,7 +1736,7 @@ _pixels_get(void *data, Evas_Object *obj)
1706 unsigned char *bgra_data; 1736 unsigned char *bgra_data;
1707 1737
1708 sd = data; 1738 sd = data;
1709 sd->module->video_data_size_get(sd->video, &w, &h); 1739 sd->module->video_data_size_get(sd->video_data, &w, &h);
1710 w = (w >> 1) << 1; 1740 w = (w >> 1) << 1;
1711 h = (h >> 1) << 1; 1741 h = (h >> 1) << 1;
1712 1742
@@ -1723,7 +1753,7 @@ _pixels_get(void *data, Evas_Object *obj)
1723 } 1753 }
1724 else 1754 else
1725 { 1755 {
1726 format = sd->module->format_get(sd->video); 1756 format = sd->module->format_get(sd->video_data);
1727 if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420)) 1757 if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420))
1728 { 1758 {
1729 unsigned char **rows; 1759 unsigned char **rows;
@@ -1732,7 +1762,7 @@ _pixels_get(void *data, Evas_Object *obj)
1732 rows = evas_object_image_data_get(obj, 1); 1762 rows = evas_object_image_data_get(obj, 1);
1733 if (rows) 1763 if (rows)
1734 { 1764 {
1735 if (sd->module->yuv_rows_get(sd->video, iw, ih, 1765 if (sd->module->yuv_rows_get(sd->video_data, iw, ih,
1736 rows, 1766 rows,
1737 &rows[ih], 1767 &rows[ih],
1738 &rows[ih + (ih / 2)])) 1768 &rows[ih + (ih / 2)]))
@@ -1744,7 +1774,7 @@ _pixels_get(void *data, Evas_Object *obj)
1744 else if (format == EMOTION_FORMAT_BGRA) 1774 else if (format == EMOTION_FORMAT_BGRA)
1745 { 1775 {
1746 evas_object_image_colorspace_set(obj, EVAS_COLORSPACE_ARGB8888); 1776 evas_object_image_colorspace_set(obj, EVAS_COLORSPACE_ARGB8888);
1747 if (sd->module->bgra_data_get(sd->video, &bgra_data)) 1777 if (sd->module->bgra_data_get(sd->video_data, &bgra_data))
1748 { 1778 {
1749 evas_object_image_data_set(obj, bgra_data); 1779 evas_object_image_data_set(obj, bgra_data);
1750 evas_object_image_pixels_dirty_set(obj, 0); 1780 evas_object_image_pixels_dirty_set(obj, 0);
@@ -1858,6 +1888,8 @@ _smart_add(Evas_Object * obj)
1858 evas_object_lower(sd->bg); 1888 evas_object_lower(sd->bg);
1859 sd->ratio = 1.0; 1889 sd->ratio = 1.0;
1860 sd->spu.button = -1; 1890 sd->spu.button = -1;
1891 sd->fill.w = -1;
1892 sd->fill.h = -1;
1861 evas_object_image_alpha_set(sd->obj, 0); 1893 evas_object_image_alpha_set(sd->obj, 0);
1862 pixel = evas_object_image_data_get(sd->obj, 1); 1894 pixel = evas_object_image_data_get(sd->obj, 1);
1863 if (pixel) 1895 if (pixel)
@@ -1885,14 +1917,13 @@ static void
1885_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y) 1917_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
1886{ 1918{
1887 Smart_Data *sd; 1919 Smart_Data *sd;
1920 int w, h;
1888 1921
1889 sd = evas_object_smart_data_get(obj); 1922 sd = evas_object_smart_data_get(obj);
1890 if (!sd) return; 1923 if (!sd) return;
1891 1924
1892 int vid_w, vid_h, w, h;
1893 sd->module->video_data_size_get(sd->video, &vid_w, &vid_h);
1894 evas_object_geometry_get(obj, NULL, NULL, &w, &h); 1925 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
1895 _clipper_position_size_update(obj, x, y, w, h, vid_w, vid_h); 1926 _clipper_position_size_update(obj, x, y, w, h, sd->video.w, sd->video.h);
1896 evas_object_move(sd->bg, x, y); 1927 evas_object_move(sd->bg, x, y);
1897} 1928}
1898 1929
@@ -1904,9 +1935,6 @@ _smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h)
1904 sd = evas_object_smart_data_get(obj); 1935 sd = evas_object_smart_data_get(obj);
1905 if (!sd) return; 1936 if (!sd) return;
1906 1937
1907 int vid_w, vid_h;
1908
1909 sd->module->video_data_size_get(sd->video, &vid_w, &vid_h);
1910 _emotion_object_aspect_border_apply(obj, sd, w, h); 1938 _emotion_object_aspect_border_apply(obj, sd, w, h);
1911 evas_object_resize(sd->bg, w, h); 1939 evas_object_resize(sd->bg, w, h);
1912} 1940}