diff options
Diffstat (limited to '')
-rw-r--r-- | legacy/emotion/src/bin/emotion_test_main.c | 40 | ||||
-rw-r--r-- | legacy/emotion/src/lib/Emotion.h | 29 | ||||
-rw-r--r-- | legacy/emotion/src/lib/emotion_private.h | 27 | ||||
-rw-r--r-- | legacy/emotion/src/lib/emotion_smart.c | 33 | ||||
-rw-r--r-- | legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c | 58 | ||||
-rw-r--r-- | legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c | 178 | ||||
-rw-r--r-- | legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.h | 2 | ||||
-rw-r--r-- | legacy/emotion/src/modules/xine/emotion_xine.c | 33 |
8 files changed, 253 insertions, 147 deletions
diff --git a/legacy/emotion/src/bin/emotion_test_main.c b/legacy/emotion/src/bin/emotion_test_main.c index 16bb1a5aaa..fbf2a0442f 100644 --- a/legacy/emotion/src/bin/emotion_test_main.c +++ b/legacy/emotion/src/bin/emotion_test_main.c | |||
@@ -46,6 +46,7 @@ static int startw = 800; | |||
46 | static int starth = 600; | 46 | static int starth = 600; |
47 | 47 | ||
48 | static Evas_List *video_objs = NULL; | 48 | static Evas_List *video_objs = NULL; |
49 | static Emotion_Vis vis = EMOTION_VIS_NONE; | ||
49 | 50 | ||
50 | static int | 51 | static int |
51 | main_start(int argc, char **argv) | 52 | main_start(int argc, char **argv) |
@@ -92,6 +93,11 @@ main_start(int argc, char **argv) | |||
92 | { | 93 | { |
93 | mode = 3; | 94 | mode = 3; |
94 | } | 95 | } |
96 | else if ((!strcmp(argv[i], "-vis")) && (i < (argc - 1))) | ||
97 | { | ||
98 | vis = atoi(argv[i + 1]); | ||
99 | i++; | ||
100 | } | ||
95 | } | 101 | } |
96 | } | 102 | } |
97 | #if HAVE_ECORE_EVAS_X | 103 | #if HAVE_ECORE_EVAS_X |
@@ -370,6 +376,33 @@ bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info) | |||
370 | printf("done\n"); | 376 | printf("done\n"); |
371 | } | 377 | } |
372 | } | 378 | } |
379 | else if (!strcmp(ev->keyname, "z")) | ||
380 | { | ||
381 | Evas_List *l; | ||
382 | |||
383 | vis = (vis + 1) % EMOTION_VIS_LAST; | ||
384 | printf("new visualization: %d\n", vis); | ||
385 | |||
386 | |||
387 | for (l = video_objs; l; l = l->next) | ||
388 | { | ||
389 | Evas_Object *obj; | ||
390 | Evas_Bool supported; | ||
391 | |||
392 | obj = l->data; | ||
393 | supported = emotion_object_vis_supported(obj, vis); | ||
394 | if (supported) | ||
395 | emotion_object_vis_set(obj, vis); | ||
396 | else | ||
397 | { | ||
398 | const char *file; | ||
399 | |||
400 | file = emotion_object_file_get(obj); | ||
401 | printf("object %p (%s) does not support visualization %d\n", | ||
402 | obj, file, vis); | ||
403 | } | ||
404 | } | ||
405 | } | ||
373 | else | 406 | else |
374 | { | 407 | { |
375 | printf("UNHANDLED: %s\n", ev->keyname); | 408 | printf("UNHANDLED: %s\n", ev->keyname); |
@@ -736,6 +769,7 @@ init_video_object(char *module_filename, char *filename) | |||
736 | o = emotion_object_add(evas); | 769 | o = emotion_object_add(evas); |
737 | if (!emotion_object_init(o, module_filename)) | 770 | if (!emotion_object_init(o, module_filename)) |
738 | return; | 771 | return; |
772 | emotion_object_vis_set(o, vis); | ||
739 | emotion_object_file_set(o, filename); | 773 | emotion_object_file_set(o, filename); |
740 | emotion_object_play_set(o, 1); | 774 | emotion_object_play_set(o, 1); |
741 | evas_object_move(o, 0, 0); | 775 | evas_object_move(o, 0, 0); |
@@ -836,7 +870,7 @@ main(int argc, char **argv) | |||
836 | (!strcmp(argv[i], "--help")))) | 870 | (!strcmp(argv[i], "--help")))) |
837 | { | 871 | { |
838 | printf("Usage:\n"); | 872 | printf("Usage:\n"); |
839 | printf(" %s [-gl] [-g WxH] [-xine] [-gstreamer] filename\n", argv[0]); | 873 | printf(" %s [-gl] [-g WxH] [-vis NUMBER] [-xine] [-gstreamer] filename\n", argv[0]); |
840 | exit(-1); | 874 | exit(-1); |
841 | } | 875 | } |
842 | else if (!strcmp(argv[i], "-gl")) | 876 | else if (!strcmp(argv[i], "-gl")) |
@@ -856,6 +890,10 @@ main(int argc, char **argv) | |||
856 | { | 890 | { |
857 | module_filename = "gstreamer"; | 891 | module_filename = "gstreamer"; |
858 | } | 892 | } |
893 | else if ((!strcmp(argv[i], "-vis")) && (i < (argc - 1))) | ||
894 | { | ||
895 | i++; | ||
896 | } | ||
859 | else | 897 | else |
860 | { | 898 | { |
861 | printf ("module : %s\n", module_filename); | 899 | printf ("module : %s\n", module_filename); |
diff --git a/legacy/emotion/src/lib/Emotion.h b/legacy/emotion/src/lib/Emotion.h index e55757f0c3..04bd444f3f 100644 --- a/legacy/emotion/src/lib/Emotion.h +++ b/legacy/emotion/src/lib/Emotion.h | |||
@@ -74,9 +74,34 @@ enum _Emotion_Meta_Info | |||
74 | EMOTION_META_INFO_TRACK_COUNT | 74 | EMOTION_META_INFO_TRACK_COUNT |
75 | }; | 75 | }; |
76 | 76 | ||
77 | enum _Emotion_Vis | ||
78 | { | ||
79 | EMOTION_VIS_NONE, | ||
80 | EMOTION_VIS_GOOM, | ||
81 | EMOTION_VIS_LIBVISUAL_BUMPSCOPE, | ||
82 | EMOTION_VIS_LIBVISUAL_CORONA, | ||
83 | EMOTION_VIS_LIBVISUAL_DANCING_PARTICLES, | ||
84 | EMOTION_VIS_LIBVISUAL_GDKPIXBUF, | ||
85 | EMOTION_VIS_LIBVISUAL_G_FORCE, | ||
86 | EMOTION_VIS_LIBVISUAL_GOOM, | ||
87 | EMOTION_VIS_LIBVISUAL_INFINITE, | ||
88 | EMOTION_VIS_LIBVISUAL_JAKDAW, | ||
89 | EMOTION_VIS_LIBVISUAL_JESS, | ||
90 | EMOTION_VIS_LIBVISUAL_LV_ANALYSER, | ||
91 | EMOTION_VIS_LIBVISUAL_LV_FLOWER, | ||
92 | EMOTION_VIS_LIBVISUAL_LV_GLTEST, | ||
93 | EMOTION_VIS_LIBVISUAL_LV_SCOPE, | ||
94 | EMOTION_VIS_LIBVISUAL_MADSPIN, | ||
95 | EMOTION_VIS_LIBVISUAL_NEBULUS, | ||
96 | EMOTION_VIS_LIBVISUAL_OINKSIE, | ||
97 | EMOTION_VIS_LIBVISUAL_PLASMA, | ||
98 | EMOTION_VIS_LAST /* sentinel */ | ||
99 | }; | ||
100 | |||
77 | typedef enum _Emotion_Module Emotion_Module; | 101 | typedef enum _Emotion_Module Emotion_Module; |
78 | typedef enum _Emotion_Event Emotion_Event; | 102 | typedef enum _Emotion_Event Emotion_Event; |
79 | typedef enum _Emotion_Meta_Info Emotion_Meta_Info; | 103 | typedef enum _Emotion_Meta_Info Emotion_Meta_Info; |
104 | typedef enum _Emotion_Vis Emotion_Vis; | ||
80 | 105 | ||
81 | #define EMOTION_CHANNEL_AUTO -1 | 106 | #define EMOTION_CHANNEL_AUTO -1 |
82 | #define EMOTION_CHANNEL_DEFAULT 0 | 107 | #define EMOTION_CHANNEL_DEFAULT 0 |
@@ -140,6 +165,10 @@ EAPI int emotion_object_spu_button_count_get (Evas_Object *obj); | |||
140 | EAPI int emotion_object_spu_button_get (Evas_Object *obj); | 165 | EAPI int emotion_object_spu_button_get (Evas_Object *obj); |
141 | EAPI const char *emotion_object_meta_info_get (Evas_Object *obj, Emotion_Meta_Info meta); | 166 | EAPI const char *emotion_object_meta_info_get (Evas_Object *obj, Emotion_Meta_Info meta); |
142 | 167 | ||
168 | EAPI void emotion_object_vis_set (Evas_Object *obj, Emotion_Vis visualization); | ||
169 | EAPI Emotion_Vis emotion_object_vis_get (Evas_Object *obj); | ||
170 | EAPI Evas_Bool emotion_object_vis_supported (Evas_Object *obj, Emotion_Vis visualization); | ||
171 | |||
143 | #ifdef __cplusplus | 172 | #ifdef __cplusplus |
144 | } | 173 | } |
145 | #endif | 174 | #endif |
diff --git a/legacy/emotion/src/lib/emotion_private.h b/legacy/emotion/src/lib/emotion_private.h index 4d9256183b..ede8c865c3 100644 --- a/legacy/emotion/src/lib/emotion_private.h +++ b/legacy/emotion/src/lib/emotion_private.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <Ecore_Job.h> | 6 | #include <Ecore_Job.h> |
7 | #include <Ecore_Data.h> | 7 | #include <Ecore_Data.h> |
8 | #include <Ecore_Str.h> | 8 | #include <Ecore_Str.h> |
9 | #include <Emotion.h> | ||
9 | 10 | ||
10 | #include <stdlib.h> | 11 | #include <stdlib.h> |
11 | #include <stdio.h> | 12 | #include <stdio.h> |
@@ -23,7 +24,6 @@ | |||
23 | #define META_TRACK_COUNT 8 | 24 | #define META_TRACK_COUNT 8 |
24 | 25 | ||
25 | typedef enum _Emotion_Format Emotion_Format; | 26 | typedef enum _Emotion_Format Emotion_Format; |
26 | typedef enum _Emotion_Vis Emotion_Vis; | ||
27 | typedef struct _Emotion_Video_Module Emotion_Video_Module; | 27 | typedef struct _Emotion_Video_Module Emotion_Video_Module; |
28 | typedef struct _Emotion_Module_Options Emotion_Module_Options; | 28 | typedef struct _Emotion_Module_Options Emotion_Module_Options; |
29 | 29 | ||
@@ -36,28 +36,6 @@ enum _Emotion_Format | |||
36 | EMOTION_FORMAT_BGRA | 36 | EMOTION_FORMAT_BGRA |
37 | }; | 37 | }; |
38 | 38 | ||
39 | enum _Emotion_Vis | ||
40 | { | ||
41 | EMOTION_VIS_GOOM, | ||
42 | EMOTION_VIS_LIBVISUAL_BUMPSCOPE, | ||
43 | EMOTION_VIS_LIBVISUAL_CORONA, | ||
44 | EMOTION_VIS_LIBVISUAL_DANCING_PARTICLES, | ||
45 | EMOTION_VIS_LIBVISUAL_GDKPIXBUF, | ||
46 | EMOTION_VIS_LIBVISUAL_G_FORCE, | ||
47 | EMOTION_VIS_LIBVISUAL_GOOM, | ||
48 | EMOTION_VIS_LIBVISUAL_INFINITE, | ||
49 | EMOTION_VIS_LIBVISUAL_JAKDAW, | ||
50 | EMOTION_VIS_LIBVISUAL_JESS, | ||
51 | EMOTION_VIS_LIBVISUAL_LV_ANALYSER, | ||
52 | EMOTION_VIS_LIBVISUAL_LV_FLOWER, | ||
53 | EMOTION_VIS_LIBVISUAL_LV_GLTEST, | ||
54 | EMOTION_VIS_LIBVISUAL_LV_SCOPE, | ||
55 | EMOTION_VIS_LIBVISUAL_MADSPIN, | ||
56 | EMOTION_VIS_LIBVISUAL_NEBULUS, | ||
57 | EMOTION_VIS_LIBVISUAL_OINKSIE, | ||
58 | EMOTION_VIS_LIBVISUAL_PLASMA | ||
59 | }; | ||
60 | |||
61 | struct _Emotion_Module_Options | 39 | struct _Emotion_Module_Options |
62 | { | 40 | { |
63 | unsigned char no_video : 1; | 41 | unsigned char no_video : 1; |
@@ -74,13 +52,14 @@ struct _Emotion_Video_Module | |||
74 | void (*stop) (void *ef); | 52 | void (*stop) (void *ef); |
75 | void (*size_get) (void *ef, int *w, int *h); | 53 | void (*size_get) (void *ef, int *w, int *h); |
76 | void (*pos_set) (void *ef, double pos); | 54 | void (*pos_set) (void *ef, double pos); |
77 | void (*vis_set) (void *ef, Emotion_Vis vis); | ||
78 | double (*len_get) (void *ef); | 55 | double (*len_get) (void *ef); |
79 | int (*fps_num_get) (void *ef); | 56 | int (*fps_num_get) (void *ef); |
80 | int (*fps_den_get) (void *ef); | 57 | int (*fps_den_get) (void *ef); |
81 | double (*fps_get) (void *ef); | 58 | double (*fps_get) (void *ef); |
82 | double (*pos_get) (void *ef); | 59 | double (*pos_get) (void *ef); |
60 | void (*vis_set) (void *ef, Emotion_Vis vis); | ||
83 | Emotion_Vis (*vis_get) (void *ef); | 61 | Emotion_Vis (*vis_get) (void *ef); |
62 | Evas_Bool (*vis_supported) (void *ef, Emotion_Vis vis); | ||
84 | double (*ratio_get) (void *ef); | 63 | double (*ratio_get) (void *ef); |
85 | int (*video_handled) (void *ef); | 64 | int (*video_handled) (void *ef); |
86 | int (*audio_handled) (void *ef); | 65 | int (*audio_handled) (void *ef); |
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c index 848bc2ea29..f77ce76fb5 100644 --- a/legacy/emotion/src/lib/emotion_smart.c +++ b/legacy/emotion/src/lib/emotion_smart.c | |||
@@ -815,8 +815,41 @@ emotion_object_meta_info_get(Evas_Object *obj, Emotion_Meta_Info meta) | |||
815 | return NULL; | 815 | return NULL; |
816 | } | 816 | } |
817 | 817 | ||
818 | EAPI void | ||
819 | emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization) | ||
820 | { | ||
821 | Smart_Data *sd; | ||
822 | |||
823 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | ||
824 | if (!sd->module) return; | ||
825 | if (!sd->video) return; | ||
826 | if (!sd->module->vis_set) return; | ||
827 | sd->module->vis_set(sd->video, visualization); | ||
828 | } | ||
829 | |||
830 | EAPI Emotion_Vis | ||
831 | emotion_object_vis_get(Evas_Object *obj) | ||
832 | { | ||
833 | Smart_Data *sd; | ||
834 | |||
835 | E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EMOTION_VIS_NONE); | ||
836 | if (!sd->module) return EMOTION_VIS_NONE; | ||
837 | if (!sd->video) return EMOTION_VIS_NONE; | ||
838 | if (!sd->module->vis_get) return EMOTION_VIS_NONE; | ||
839 | return sd->module->vis_get(sd->video); | ||
840 | } | ||
818 | 841 | ||
842 | EAPI Evas_Bool | ||
843 | emotion_object_vis_supported(Evas_Object *obj, Emotion_Vis visualization) | ||
844 | { | ||
845 | Smart_Data *sd; | ||
819 | 846 | ||
847 | E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); | ||
848 | if (!sd->module) return 0; | ||
849 | if (!sd->video) return 0; | ||
850 | if (!sd->module->vis_supported) return 0; | ||
851 | return sd->module->vis_supported(sd->video, visualization); | ||
852 | } | ||
820 | 853 | ||
821 | 854 | ||
822 | 855 | ||
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c index f78ecadee5..2ada21518a 100644 --- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c +++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c | |||
@@ -42,8 +42,6 @@ static void em_size_get (void *video, | |||
42 | static void em_pos_set (void *video, | 42 | static void em_pos_set (void *video, |
43 | double pos); | 43 | double pos); |
44 | 44 | ||
45 | static void em_vis_set (void *video, | ||
46 | Emotion_Vis vis); | ||
47 | 45 | ||
48 | static double em_len_get (void *video); | 46 | static double em_len_get (void *video); |
49 | 47 | ||
@@ -55,8 +53,14 @@ static double em_fps_get (void *video); | |||
55 | 53 | ||
56 | static double em_pos_get (void *video); | 54 | static double em_pos_get (void *video); |
57 | 55 | ||
56 | static void em_vis_set (void *video, | ||
57 | Emotion_Vis vis); | ||
58 | |||
58 | static Emotion_Vis em_vis_get (void *video); | 59 | static Emotion_Vis em_vis_get (void *video); |
59 | 60 | ||
61 | static Evas_Bool em_vis_supported (void *video, | ||
62 | Emotion_Vis vis); | ||
63 | |||
60 | static double em_ratio_get (void *video); | 64 | static double em_ratio_get (void *video); |
61 | 65 | ||
62 | static int em_video_handled (void *video); | 66 | static int em_video_handled (void *video); |
@@ -177,13 +181,14 @@ static Emotion_Video_Module em_module = | |||
177 | em_stop, /* stop */ | 181 | em_stop, /* stop */ |
178 | em_size_get, /* size_get */ | 182 | em_size_get, /* size_get */ |
179 | em_pos_set, /* pos_set */ | 183 | em_pos_set, /* pos_set */ |
180 | em_vis_set, /* vis_set */ | ||
181 | em_len_get, /* len_get */ | 184 | em_len_get, /* len_get */ |
182 | em_fps_num_get, /* fps_num_get */ | 185 | em_fps_num_get, /* fps_num_get */ |
183 | em_fps_den_get, /* fps_den_get */ | 186 | em_fps_den_get, /* fps_den_get */ |
184 | em_fps_get, /* fps_get */ | 187 | em_fps_get, /* fps_get */ |
185 | em_pos_get, /* pos_get */ | 188 | em_pos_get, /* pos_get */ |
189 | em_vis_set, /* vis_set */ | ||
186 | em_vis_get, /* vis_get */ | 190 | em_vis_get, /* vis_get */ |
191 | em_vis_supported, /* vis_supported */ | ||
187 | em_ratio_get, /* ratio_get */ | 192 | em_ratio_get, /* ratio_get */ |
188 | em_video_handled, /* video_handled */ | 193 | em_video_handled, /* video_handled */ |
189 | em_audio_handled, /* audio_handled */ | 194 | em_audio_handled, /* audio_handled */ |
@@ -265,7 +270,7 @@ em_init(Evas_Object *obj, | |||
265 | ev->ratio = 1.0; | 270 | ev->ratio = 1.0; |
266 | ev->video_sink_nbr = 0; | 271 | ev->video_sink_nbr = 0; |
267 | ev->audio_sink_nbr = 0; | 272 | ev->audio_sink_nbr = 0; |
268 | ev->vis = EMOTION_VIS_GOOM; | 273 | ev->vis = EMOTION_VIS_NONE; |
269 | 274 | ||
270 | /* Create the file descriptors */ | 275 | /* Create the file descriptors */ |
271 | if (pipe(fds) == 0) | 276 | if (pipe(fds) == 0) |
@@ -581,18 +586,6 @@ em_pos_set(void *video, | |||
581 | } | 586 | } |
582 | } | 587 | } |
583 | 588 | ||
584 | static void | ||
585 | em_vis_set(void *video, | ||
586 | Emotion_Vis vis) | ||
587 | { | ||
588 | Emotion_Gstreamer_Video *ev; | ||
589 | |||
590 | ev = (Emotion_Gstreamer_Video *)video; | ||
591 | |||
592 | if (ev->vis == vis) return; | ||
593 | ev->vis = vis; | ||
594 | } | ||
595 | |||
596 | static double | 589 | static double |
597 | em_len_get(void *video) | 590 | em_len_get(void *video) |
598 | { | 591 | { |
@@ -663,6 +656,18 @@ em_pos_get(void *video) | |||
663 | return ev->position; | 656 | return ev->position; |
664 | } | 657 | } |
665 | 658 | ||
659 | static void | ||
660 | em_vis_set(void *video, | ||
661 | Emotion_Vis vis) | ||
662 | { | ||
663 | Emotion_Gstreamer_Video *ev; | ||
664 | |||
665 | ev = (Emotion_Gstreamer_Video *)video; | ||
666 | |||
667 | if (ev->vis == vis) return; | ||
668 | ev->vis = vis; | ||
669 | } | ||
670 | |||
666 | static Emotion_Vis | 671 | static Emotion_Vis |
667 | em_vis_get(void *video) | 672 | em_vis_get(void *video) |
668 | { | 673 | { |
@@ -673,6 +678,27 @@ em_vis_get(void *video) | |||
673 | return ev->vis; | 678 | return ev->vis; |
674 | } | 679 | } |
675 | 680 | ||
681 | static Evas_Bool | ||
682 | em_vis_supported(void *ef, Emotion_Vis vis) | ||
683 | { | ||
684 | const char *name; | ||
685 | GstElementFactory *factory; | ||
686 | |||
687 | if (vis == EMOTION_VIS_NONE) | ||
688 | return 1; | ||
689 | |||
690 | name = emotion_visualization_element_name_get(vis); | ||
691 | if (!name) | ||
692 | return 0; | ||
693 | |||
694 | factory = gst_element_factory_find(name); | ||
695 | if (!factory) | ||
696 | return 0; | ||
697 | |||
698 | gst_object_unref(factory); | ||
699 | return 1; | ||
700 | } | ||
701 | |||
676 | static double | 702 | static double |
677 | em_ratio_get(void *video) | 703 | em_ratio_get(void *video) |
678 | { | 704 | { |
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c index 4499a86c63..1a921fc7eb 100644 --- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c +++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c | |||
@@ -249,6 +249,54 @@ emotion_pipeline_cdda_track_count_get(void *video) | |||
249 | return tracks_count; | 249 | return tracks_count; |
250 | } | 250 | } |
251 | 251 | ||
252 | const char * | ||
253 | emotion_visualization_element_name_get(Emotion_Vis visualisation) | ||
254 | { | ||
255 | switch (visualisation) | ||
256 | { | ||
257 | case EMOTION_VIS_NONE: | ||
258 | return NULL; | ||
259 | case EMOTION_VIS_GOOM: | ||
260 | return "goom"; | ||
261 | case EMOTION_VIS_LIBVISUAL_BUMPSCOPE: | ||
262 | return "libvisual_bumpscope"; | ||
263 | case EMOTION_VIS_LIBVISUAL_CORONA: | ||
264 | return "libvisual_corona"; | ||
265 | case EMOTION_VIS_LIBVISUAL_DANCING_PARTICLES: | ||
266 | return "libvisual_dancingparticles"; | ||
267 | case EMOTION_VIS_LIBVISUAL_GDKPIXBUF: | ||
268 | return "libvisual_gdkpixbuf"; | ||
269 | case EMOTION_VIS_LIBVISUAL_G_FORCE: | ||
270 | return "libvisual_G-Force"; | ||
271 | case EMOTION_VIS_LIBVISUAL_GOOM: | ||
272 | return "libvisual_goom"; | ||
273 | case EMOTION_VIS_LIBVISUAL_INFINITE: | ||
274 | return "libvisual_infinite"; | ||
275 | case EMOTION_VIS_LIBVISUAL_JAKDAW: | ||
276 | return "libvisual_jakdaw"; | ||
277 | case EMOTION_VIS_LIBVISUAL_JESS: | ||
278 | return "libvisual_jess"; | ||
279 | case EMOTION_VIS_LIBVISUAL_LV_ANALYSER: | ||
280 | return "libvisual_lv_analyzer"; | ||
281 | case EMOTION_VIS_LIBVISUAL_LV_FLOWER: | ||
282 | return "libvisual_lv_flower"; | ||
283 | case EMOTION_VIS_LIBVISUAL_LV_GLTEST: | ||
284 | return "libvisual_lv_gltest"; | ||
285 | case EMOTION_VIS_LIBVISUAL_LV_SCOPE: | ||
286 | return "libvisual_lv_scope"; | ||
287 | case EMOTION_VIS_LIBVISUAL_MADSPIN: | ||
288 | return "libvisual_madspin"; | ||
289 | case EMOTION_VIS_LIBVISUAL_NEBULUS: | ||
290 | return "libvisual_nebulus"; | ||
291 | case EMOTION_VIS_LIBVISUAL_OINKSIE: | ||
292 | return "libvisual_oinksie"; | ||
293 | case EMOTION_VIS_LIBVISUAL_PLASMA: | ||
294 | return "libvisual_plazma"; | ||
295 | default: | ||
296 | return "goom"; | ||
297 | } | ||
298 | } | ||
299 | |||
252 | GstElement * | 300 | GstElement * |
253 | emotion_audio_sink_create(Emotion_Gstreamer_Video *ev, int index) | 301 | emotion_audio_sink_create(Emotion_Gstreamer_Video *ev, int index) |
254 | { | 302 | { |
@@ -302,102 +350,46 @@ emotion_audio_sink_create(Emotion_Gstreamer_Video *ev, int index) | |||
302 | 350 | ||
303 | /* visualisation part */ | 351 | /* visualisation part */ |
304 | { | 352 | { |
305 | GstElement *vis = NULL; | 353 | const char *vis_name = emotion_visualization_element_name_get(ev->vis); |
306 | char *vis_name; | ||
307 | 354 | ||
308 | switch (ev->vis) | 355 | if (vis_name) |
309 | { | 356 | { |
310 | case EMOTION_VIS_GOOM: | 357 | GstElement *vis; |
311 | vis_name = "goom"; | ||
312 | break; | ||
313 | case EMOTION_VIS_LIBVISUAL_BUMPSCOPE: | ||
314 | vis_name = "libvisual_bumpscope"; | ||
315 | break; | ||
316 | case EMOTION_VIS_LIBVISUAL_CORONA: | ||
317 | vis_name = "libvisual_corona"; | ||
318 | break; | ||
319 | case EMOTION_VIS_LIBVISUAL_DANCING_PARTICLES: | ||
320 | vis_name = "libvisual_dancingparticles"; | ||
321 | break; | ||
322 | case EMOTION_VIS_LIBVISUAL_GDKPIXBUF: | ||
323 | vis_name = "libvisual_gdkpixbuf"; | ||
324 | break; | ||
325 | case EMOTION_VIS_LIBVISUAL_G_FORCE: | ||
326 | vis_name = "libvisual_G-Force"; | ||
327 | break; | ||
328 | case EMOTION_VIS_LIBVISUAL_GOOM: | ||
329 | vis_name = "libvisual_goom"; | ||
330 | break; | ||
331 | case EMOTION_VIS_LIBVISUAL_INFINITE: | ||
332 | vis_name = "libvisual_infinite"; | ||
333 | break; | ||
334 | case EMOTION_VIS_LIBVISUAL_JAKDAW: | ||
335 | vis_name = "libvisual_jakdaw"; | ||
336 | break; | ||
337 | case EMOTION_VIS_LIBVISUAL_JESS: | ||
338 | vis_name = "libvisual_jess"; | ||
339 | break; | ||
340 | case EMOTION_VIS_LIBVISUAL_LV_ANALYSER: | ||
341 | vis_name = "libvisual_lv_analyzer"; | ||
342 | break; | ||
343 | case EMOTION_VIS_LIBVISUAL_LV_FLOWER: | ||
344 | vis_name = "libvisual_lv_flower"; | ||
345 | break; | ||
346 | case EMOTION_VIS_LIBVISUAL_LV_GLTEST: | ||
347 | vis_name = "libvisual_lv_gltest"; | ||
348 | break; | ||
349 | case EMOTION_VIS_LIBVISUAL_LV_SCOPE: | ||
350 | vis_name = "libvisual_lv_scope"; | ||
351 | break; | ||
352 | case EMOTION_VIS_LIBVISUAL_MADSPIN: | ||
353 | vis_name = "libvisual_madspin"; | ||
354 | break; | ||
355 | case EMOTION_VIS_LIBVISUAL_NEBULUS: | ||
356 | vis_name = "libvisual_nebulus"; | ||
357 | break; | ||
358 | case EMOTION_VIS_LIBVISUAL_OINKSIE: | ||
359 | vis_name = "libvisual_oinksie"; | ||
360 | break; | ||
361 | case EMOTION_VIS_LIBVISUAL_PLASMA: | ||
362 | vis_name = "libvisual_plazma"; | ||
363 | break; | ||
364 | default: | ||
365 | vis_name = "goom"; | ||
366 | break; | ||
367 | } | ||
368 | 358 | ||
369 | g_snprintf(buf, 128, "vis%d", index); | 359 | g_snprintf(buf, 128, "vis%d", index); |
370 | if ((vis = gst_element_factory_make(vis_name, buf))) | 360 | vis = gst_element_factory_make(vis_name, buf); |
371 | { | 361 | if (vis) |
372 | GstElement *queue; | 362 | { |
373 | GstElement *conv; | 363 | GstElement *queue; |
374 | GstElement *cspace; | 364 | GstElement *conv; |
375 | GstElement *sink; | 365 | GstElement *cspace; |
376 | GstPad *vispad; | 366 | GstElement *sink; |
377 | GstCaps *caps; | 367 | GstPad *vispad; |
378 | 368 | GstCaps *caps; | |
379 | g_snprintf(buf, 128, "visbin%d", index); | 369 | |
380 | visbin = gst_bin_new(buf); | 370 | g_snprintf(buf, 128, "visbin%d", index); |
381 | 371 | visbin = gst_bin_new(buf); | |
382 | queue = gst_element_factory_make("queue", NULL); | 372 | |
383 | conv = gst_element_factory_make("audioconvert", NULL); | 373 | queue = gst_element_factory_make("queue", NULL); |
384 | cspace = gst_element_factory_make("ffmpegcolorspace", NULL); | 374 | conv = gst_element_factory_make("audioconvert", NULL); |
385 | g_snprintf(buf, 128, "vissink%d", index); | 375 | cspace = gst_element_factory_make("ffmpegcolorspace", NULL); |
386 | sink = gst_element_factory_make("fakesink", buf); | 376 | g_snprintf(buf, 128, "vissink%d", index); |
387 | 377 | sink = gst_element_factory_make("fakesink", buf); | |
388 | gst_bin_add_many(GST_BIN(visbin), | 378 | |
389 | queue, conv, vis, cspace, sink, NULL); | 379 | gst_bin_add_many(GST_BIN(visbin), |
390 | gst_element_link_many(queue, conv, vis, cspace, NULL); | 380 | queue, conv, vis, cspace, sink, NULL); |
391 | caps = gst_caps_new_simple("video/x-raw-rgb", | 381 | gst_element_link_many(queue, conv, vis, cspace, NULL); |
392 | "bpp", G_TYPE_INT, 32, | 382 | caps = gst_caps_new_simple("video/x-raw-rgb", |
393 | "width", G_TYPE_INT, 320, | 383 | "bpp", G_TYPE_INT, 32, |
394 | "height", G_TYPE_INT, 200, | 384 | "width", G_TYPE_INT, 320, |
395 | NULL); | 385 | "height", G_TYPE_INT, 200, |
396 | gst_element_link_filtered(cspace, sink, caps); | 386 | NULL); |
397 | 387 | gst_element_link_filtered(cspace, sink, caps); | |
398 | vispad = gst_element_get_pad(queue, "sink"); | 388 | |
399 | gst_element_add_pad(visbin, gst_ghost_pad_new("sink", vispad)); | 389 | vispad = gst_element_get_pad(queue, "sink"); |
400 | gst_object_unref(vispad); | 390 | gst_element_add_pad(visbin, gst_ghost_pad_new("sink", vispad)); |
391 | gst_object_unref(vispad); | ||
392 | } | ||
401 | } | 393 | } |
402 | } | 394 | } |
403 | 395 | ||
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.h b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.h index a5ac8be644..2e8a703294 100644 --- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.h +++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.h | |||
@@ -37,5 +37,7 @@ void file_new_decoded_pad_cb (GstElement *decodebin, | |||
37 | gboolean last, | 37 | gboolean last, |
38 | gpointer user_data); | 38 | gpointer user_data); |
39 | 39 | ||
40 | const char *emotion_visualization_element_name_get(Emotion_Vis visualisation); | ||
41 | |||
40 | 42 | ||
41 | #endif /* __EMOTION_GSTREAMER_PIPELINE_H__ */ | 43 | #endif /* __EMOTION_GSTREAMER_PIPELINE_H__ */ |
diff --git a/legacy/emotion/src/modules/xine/emotion_xine.c b/legacy/emotion/src/modules/xine/emotion_xine.c index 657eb5a399..9f902757b0 100644 --- a/legacy/emotion/src/modules/xine/emotion_xine.c +++ b/legacy/emotion/src/modules/xine/emotion_xine.c | |||
@@ -11,13 +11,14 @@ static void em_play (void *ef, double pos); | |||
11 | static void em_stop (void *ef); | 11 | static void em_stop (void *ef); |
12 | static void em_size_get (void *ef, int *w, int *h); | 12 | static void em_size_get (void *ef, int *w, int *h); |
13 | static void em_pos_set (void *ef, double pos); | 13 | static void em_pos_set (void *ef, double pos); |
14 | static void em_vis_set (void *ef, Emotion_Vis vis); | ||
15 | static double em_len_get (void *ef); | 14 | static double em_len_get (void *ef); |
16 | static int em_fps_num_get (void *ef); | 15 | static int em_fps_num_get (void *ef); |
17 | static int em_fps_den_get (void *ef); | 16 | static int em_fps_den_get (void *ef); |
18 | static double em_fps_get (void *ef); | 17 | static double em_fps_get (void *ef); |
19 | static double em_pos_get (void *ef); | 18 | static double em_pos_get (void *ef); |
19 | static void em_vis_set (void *ef, Emotion_Vis vis); | ||
20 | static Emotion_Vis em_vis_get (void *ef); | 20 | static Emotion_Vis em_vis_get (void *ef); |
21 | static Evas_Bool em_vis_supported (void *ef, Emotion_Vis vis); | ||
21 | static double em_ratio_get (void *ef); | 22 | static double em_ratio_get (void *ef); |
22 | static int em_seekable (void *ef); | 23 | static int em_seekable (void *ef); |
23 | static void em_frame_done (void *ef); | 24 | static void em_frame_done (void *ef); |
@@ -508,17 +509,6 @@ em_pos_set(void *ef, double pos) | |||
508 | _em_slave_event(ev, 6, ppos); | 509 | _em_slave_event(ev, 6, ppos); |
509 | } | 510 | } |
510 | 511 | ||
511 | static void | ||
512 | em_vis_set(void *ef, | ||
513 | Emotion_Vis vis) | ||
514 | { | ||
515 | Emotion_Xine_Video *ev; | ||
516 | |||
517 | ev = (Emotion_Xine_Video *)ef; | ||
518 | if (ev->vis == vis) return; | ||
519 | ev->vis = vis; | ||
520 | } | ||
521 | |||
522 | static double | 512 | static double |
523 | em_len_get(void *ef) | 513 | em_len_get(void *ef) |
524 | { | 514 | { |
@@ -564,6 +554,16 @@ em_pos_get(void *ef) | |||
564 | return ev->pos; | 554 | return ev->pos; |
565 | } | 555 | } |
566 | 556 | ||
557 | static void | ||
558 | em_vis_set(void *ef, Emotion_Vis vis) | ||
559 | { | ||
560 | Emotion_Xine_Video *ev; | ||
561 | |||
562 | ev = (Emotion_Xine_Video *)ef; | ||
563 | if (ev->vis == vis) return; | ||
564 | ev->vis = vis; | ||
565 | } | ||
566 | |||
567 | static Emotion_Vis | 567 | static Emotion_Vis |
568 | em_vis_get(void *ef) | 568 | em_vis_get(void *ef) |
569 | { | 569 | { |
@@ -574,6 +574,12 @@ em_vis_get(void *ef) | |||
574 | return ev->vis; | 574 | return ev->vis; |
575 | } | 575 | } |
576 | 576 | ||
577 | static Evas_Bool | ||
578 | em_vis_supported(void *ef, Emotion_Vis vis) | ||
579 | { | ||
580 | return 0; | ||
581 | } | ||
582 | |||
577 | static double | 583 | static double |
578 | em_ratio_get(void *ef) | 584 | em_ratio_get(void *ef) |
579 | { | 585 | { |
@@ -1467,13 +1473,14 @@ static Emotion_Video_Module em_module = | |||
1467 | em_stop, /* stop */ | 1473 | em_stop, /* stop */ |
1468 | em_size_get, /* size_get */ | 1474 | em_size_get, /* size_get */ |
1469 | em_pos_set, /* pos_set */ | 1475 | em_pos_set, /* pos_set */ |
1470 | em_vis_set, /* vis_set */ | ||
1471 | em_len_get, /* len_get */ | 1476 | em_len_get, /* len_get */ |
1472 | em_fps_num_get, /* fps_num_get */ | 1477 | em_fps_num_get, /* fps_num_get */ |
1473 | em_fps_den_get, /* fps_den_get */ | 1478 | em_fps_den_get, /* fps_den_get */ |
1474 | em_fps_get, /* fps_get */ | 1479 | em_fps_get, /* fps_get */ |
1475 | em_pos_get, /* pos_get */ | 1480 | em_pos_get, /* pos_get */ |
1481 | em_vis_set, /* vis_set */ | ||
1476 | em_vis_get, /* vis_get */ | 1482 | em_vis_get, /* vis_get */ |
1483 | em_vis_supported, /* vis_supported */ | ||
1477 | em_ratio_get, /* ratio_get */ | 1484 | em_ratio_get, /* ratio_get */ |
1478 | em_video_handled, /* video_handled */ | 1485 | em_video_handled, /* video_handled */ |
1479 | em_audio_handled, /* audio_handled */ | 1486 | em_audio_handled, /* audio_handled */ |