summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2011-12-30 11:46:29 +0000
committerVincent Torri <vincent.torri@gmail.com>2011-12-30 11:46:29 +0000
commit1fb8ee18d98e68a48a9488429a76a7b0a21699f7 (patch)
tree02afc180be029204faa85df0d9688c0bebfbef88 /legacy/emotion
parentf981adaaaca5100fe082c406d26a0da008a27e4d (diff)
Emotion:fix compilation on Windows
Note1: disable generic plugin on Windows as shm_open like function note implemented on that platform yet. Note2: want_module stuff must be fixed in the m4 macro Note3: abstract semaphore code in Eina ? SVN revision: 66686
Diffstat (limited to 'legacy/emotion')
-rw-r--r--legacy/emotion/configure.ac5
-rw-r--r--legacy/emotion/src/bin/emotion_test_main.c5
-rw-r--r--legacy/emotion/src/lib/emotion_main.c16
-rw-r--r--legacy/emotion/src/lib/emotion_private.h12
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c27
-rw-r--r--legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h12
-rw-r--r--legacy/emotion/src/modules/generic/emotion_generic.c37
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_alloc.c11
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_convert.c13
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_fakeeos.c13
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c34
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h25
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_sink.c26
13 files changed, 173 insertions, 63 deletions
diff --git a/legacy/emotion/configure.ac b/legacy/emotion/configure.ac
index 74edd37975..21305b423a 100644
--- a/legacy/emotion/configure.ac
+++ b/legacy/emotion/configure.ac
@@ -55,9 +55,10 @@ AC_SUBST(VMAJ)
55 55
56want_generic="yes" 56want_generic="yes"
57case "$host_os" in 57case "$host_os" in
58 mingw* | cegcc*) 58 mingw*)
59 want_xine="no" 59 want_xine="no"
60 want_gstreamer="yes" 60 want_gstreamer="yes"
61 want_generic="no"
61 want_generic_vlc="no" 62 want_generic_vlc="no"
62 ;; 63 ;;
63 *) 64 *)
@@ -146,6 +147,8 @@ fi
146### Checks for header files 147### Checks for header files
147AC_HEADER_STDC 148AC_HEADER_STDC
148 149
150AC_CHECK_HEADERS([unistd.h])
151
149### Checks for types 152### Checks for types
150 153
151 154
diff --git a/legacy/emotion/src/bin/emotion_test_main.c b/legacy/emotion/src/bin/emotion_test_main.c
index 548aea2411..1ea3865a3c 100644
--- a/legacy/emotion/src/bin/emotion_test_main.c
+++ b/legacy/emotion/src/bin/emotion_test_main.c
@@ -1,4 +1,7 @@
1#include "config.h" 1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
2#include <stdlib.h> 5#include <stdlib.h>
3#include <stdio.h> 6#include <stdio.h>
4#include <string.h> 7#include <string.h>
diff --git a/legacy/emotion/src/lib/emotion_main.c b/legacy/emotion/src/lib/emotion_main.c
index d7d6902444..81809474fc 100644
--- a/legacy/emotion/src/lib/emotion_main.c
+++ b/legacy/emotion/src/lib/emotion_main.c
@@ -1,10 +1,13 @@
1#include "emotion_private.h" 1#ifdef HAVE_CONFIG_H
2#include "Emotion.h" 2# include "config.h"
3#endif
4
5#include <stdio.h>
3 6
4#ifdef EMOTION_HAVE_EEZE 7#ifdef EMOTION_HAVE_EEZE
5#include <sys/types.h> 8# include <sys/types.h>
6#include <sys/stat.h> 9# include <sys/stat.h>
7#include <fcntl.h> 10# include <fcntl.h>
8# include <sys/ioctl.h> 11# include <sys/ioctl.h>
9# ifdef HAVE_V4L2 12# ifdef HAVE_V4L2
10# include <linux/videodev2.h> 13# include <linux/videodev2.h>
@@ -16,6 +19,9 @@
16 19
17#include <Eet.h> 20#include <Eet.h>
18 21
22#include "Emotion.h"
23#include "emotion_private.h"
24
19EAPI int EMOTION_WEBCAM_UPDATE = 0; 25EAPI int EMOTION_WEBCAM_UPDATE = 0;
20 26
21struct ext_match_s 27struct ext_match_s
diff --git a/legacy/emotion/src/lib/emotion_private.h b/legacy/emotion/src/lib/emotion_private.h
index 7c5eb6e0aa..65954364a1 100644
--- a/legacy/emotion/src/lib/emotion_private.h
+++ b/legacy/emotion/src/lib/emotion_private.h
@@ -1,18 +1,6 @@
1#ifndef EMOTION_PRIVATE_H 1#ifndef EMOTION_PRIVATE_H
2#define EMOTION_PRIVATE_H 2#define EMOTION_PRIVATE_H
3 3
4#ifdef HAVE_CONFIG_H
5# include "config.h"
6#endif
7
8#include <stdlib.h>
9#include <stdio.h>
10#include <string.h>
11
12#include <Evas.h>
13#include <Ecore.h>
14#include <Emotion.h>
15
16#define META_TRACK_TITLE 1 4#define META_TRACK_TITLE 1
17#define META_TRACK_ARTIST 2 5#define META_TRACK_ARTIST 2
18#define META_TRACK_GENRE 3 6#define META_TRACK_GENRE 3
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 8a7ba22344..de31af8c17 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -1,11 +1,24 @@
1#include "emotion_private.h" 1#ifdef HAVE_CONFIG_H
2#include "Emotion.h" 2# include "config.h"
3#endif
4
5#include <Evas.h>
6#include <Ecore.h>
3 7
4#ifdef HAVE_EIO 8#ifdef HAVE_EIO
5# include <math.h> 9# include <math.h>
6# include <Eio.h> 10# include <Eio.h>
7#endif 11#endif
8 12
13#include "Emotion.h"
14#include "emotion_private.h"
15
16#ifdef _WIN32
17# define FMT_UCHAR "%c"
18#else
19# define FMT_UCHAR "%hhu"
20#endif
21
9#define E_SMART_OBJ_GET(smart, o, type) \ 22#define E_SMART_OBJ_GET(smart, o, type) \
10 { \ 23 { \
11 char *_e_smart_str; \ 24 char *_e_smart_str; \
@@ -515,7 +528,7 @@ _emotion_object_aspect_border_apply(Evas_Object *obj, Smart_Data *sd, int w, int
515 double ir; 528 double ir;
516 double r; 529 double r;
517 530
518 int aspect_opt; 531 int aspect_opt = 0;
519 532
520 iw = sd->video.w; 533 iw = sd->video.w;
521 ih = sd->video.h; 534 ih = sd->video.h;
@@ -681,7 +694,7 @@ emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
681 Smart_Data *sd; 694 Smart_Data *sd;
682 695
683 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 696 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
684 DBG("play=%hhu, was=%hhu", play, sd->play); 697 DBG("play=" FMT_UCHAR ", was=" FMT_UCHAR, play, sd->play);
685 if (play == sd->play) return; 698 if (play == sd->play) return;
686 if (!sd->module) return; 699 if (!sd->module) return;
687 if (!sd->video_data) return; 700 if (!sd->video_data) return;
@@ -872,7 +885,7 @@ emotion_object_audio_mute_set(Evas_Object *obj, Eina_Bool mute)
872 Smart_Data *sd; 885 Smart_Data *sd;
873 886
874 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 887 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
875 DBG("mute=%hhu", mute); 888 DBG("mute=" FMT_UCHAR, mute);
876 if (!sd->module) return; 889 if (!sd->module) return;
877 if (!sd->video_data) return; 890 if (!sd->video_data) return;
878 sd->module->audio_channel_mute_set(sd->video_data, mute); 891 sd->module->audio_channel_mute_set(sd->video_data, mute);
@@ -940,7 +953,7 @@ emotion_object_video_mute_set(Evas_Object *obj, Eina_Bool mute)
940 Smart_Data *sd; 953 Smart_Data *sd;
941 954
942 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 955 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
943 DBG("mute=%hhu", mute); 956 DBG("mute=" FMT_UCHAR, mute);
944 if (!sd->module) return; 957 if (!sd->module) return;
945 if (!sd->video_data) return; 958 if (!sd->video_data) return;
946 sd->module->video_channel_mute_set(sd->video_data, mute); 959 sd->module->video_channel_mute_set(sd->video_data, mute);
@@ -1008,7 +1021,7 @@ emotion_object_spu_mute_set(Evas_Object *obj, Eina_Bool mute)
1008 Smart_Data *sd; 1021 Smart_Data *sd;
1009 1022
1010 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 1023 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
1011 DBG("mute=%hhu", mute); 1024 DBG("mute=" FMT_UCHAR, mute);
1012 if (!sd->module) return; 1025 if (!sd->module) return;
1013 if (!sd->video_data) return; 1026 if (!sd->video_data) return;
1014 sd->module->spu_channel_mute_set(sd->video_data, mute); 1027 sd->module->spu_channel_mute_set(sd->video_data, mute);
diff --git a/legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h b/legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h
index 4dd847319f..40a9b3164b 100644
--- a/legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h
+++ b/legacy/emotion/src/modules/generic/Emotion_Generic_Plugin.h
@@ -1,13 +1,18 @@
1#ifndef EMOTION_GENERIC_PLUGIN_H 1#ifndef EMOTION_GENERIC_PLUGIN_H
2#define EMOTION_GENERIC_PLUGIN_H 2#define EMOTION_GENERIC_PLUGIN_H
3 3
4#include <semaphore.h>
5#include <stdlib.h> 4#include <stdlib.h>
6#include <unistd.h> 5#include <unistd.h>
7#include <sys/mman.h> 6#include <sys/mman.h>
8#include <sys/stat.h> 7#include <sys/stat.h>
9#include <fcntl.h> 8#include <fcntl.h>
10 9
10#ifdef _WIN32
11# include <windows.h>
12#else
13#include <semaphore.h>
14#endif
15
11#define DEFAULTWIDTH 320 16#define DEFAULTWIDTH 320
12#define DEFAULTHEIGHT 240 17#define DEFAULTHEIGHT 240
13#define DEFAULTPITCH 4 18#define DEFAULTPITCH 4
@@ -88,7 +93,12 @@ struct _Emotion_Generic_Video_Shared
88 int last; 93 int last;
89 int next; 94 int next;
90 } frame; 95 } frame;
96 /* FIXME: maybe abstracting that in Eina ? */
97#ifdef _WIN32
98 HANDLE lock;
99#else
91 sem_t lock; 100 sem_t lock;
101#endif
92 int frame_drop; 102 int frame_drop;
93}; 103};
94 104
diff --git a/legacy/emotion/src/modules/generic/emotion_generic.c b/legacy/emotion/src/modules/generic/emotion_generic.c
index 14156ab881..3ed8cfe8d9 100644
--- a/legacy/emotion/src/modules/generic/emotion_generic.c
+++ b/legacy/emotion/src/modules/generic/emotion_generic.c
@@ -1,14 +1,18 @@
1#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
2# include "config.h" 2# include "config.h"
3#endif 3#endif
4
4#include <sys/mman.h> 5#include <sys/mman.h>
5#include <sys/stat.h> 6#include <sys/stat.h>
6#include <sys/time.h> 7#include <sys/time.h>
7#include <sys/types.h> 8#include <sys/types.h>
8#include <fcntl.h> 9#include <fcntl.h>
9#include <unistd.h> 10#include <unistd.h>
11#include <errno.h>
12
10#include <Eina.h> 13#include <Eina.h>
11#include <Evas.h> 14#include <Evas.h>
15#include <Ecore.h>
12 16
13#include "Emotion.h" 17#include "Emotion.h"
14#include "emotion_private.h" 18#include "emotion_private.h"
@@ -161,7 +165,7 @@ _create_shm_data(Emotion_Generic_Video *ev, const char *shmname)
161 vs = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, shmfd, 0); 165 vs = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, shmfd, 0);
162 if (vs == MAP_FAILED) 166 if (vs == MAP_FAILED)
163 { 167 {
164 ERR("error when mapping shared memory.\n"); 168 ERR("error when mapping shared memory");
165 return EINA_FALSE; 169 return EINA_FALSE;
166 } 170 }
167 171
@@ -174,7 +178,17 @@ _create_shm_data(Emotion_Generic_Video *ev, const char *shmname)
174 vs->frame.last = 2; 178 vs->frame.last = 2;
175 vs->frame.next = 2; 179 vs->frame.next = 2;
176 vs->frame_drop = 0; 180 vs->frame_drop = 0;
181#ifdef _WIN32
182 /* FIXME: maximum count for the semaphore: 10. Is it sufficient ? */
183 vs->lock = CreateSemaphore(NULL, 1, 10, NULL);
184 if (!vs->lock)
185 {
186 ERR("can not create semaphore");
187 return EINA_FALSE;
188 }
189#else
177 sem_init(&vs->lock, 1, 1); 190 sem_init(&vs->lock, 1, 1);
191#endif
178 ev->frame.frames[0] = (unsigned char *)vs + sizeof(*vs); 192 ev->frame.frames[0] = (unsigned char *)vs + sizeof(*vs);
179 ev->frame.frames[1] = (unsigned char *)vs + sizeof(*vs) + vs->height * vs->width * vs->pitch; 193 ev->frame.frames[1] = (unsigned char *)vs + sizeof(*vs) + vs->height * vs->width * vs->pitch;
180 ev->frame.frames[2] = (unsigned char *)vs + sizeof(*vs) + 2 * vs->height * vs->width * vs->pitch; 194 ev->frame.frames[2] = (unsigned char *)vs + sizeof(*vs) + 2 * vs->height * vs->width * vs->pitch;
@@ -469,7 +483,11 @@ static void
469_player_file_closed(Emotion_Generic_Video *ev) 483_player_file_closed(Emotion_Generic_Video *ev)
470{ 484{
471 INF("Closed previous file."); 485 INF("Closed previous file.");
486#ifdef _WIN32
487 CloseHandle(ev->shared->lock);
488#else
472 sem_destroy(&ev->shared->lock); 489 sem_destroy(&ev->shared->lock);
490#endif
473 491
474 ev->closing = EINA_FALSE; 492 ev->closing = EINA_FALSE;
475 493
@@ -899,8 +917,8 @@ _player_exec(Emotion_Generic_Video *ev)
899 ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_NOT_LEADER, 917 ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_NOT_LEADER,
900 ev); 918 ev);
901 919
902 INF("created pipe emotion -> player: %d -> %d\n", pipe_out[1], pipe_out[0]); 920 INF("created pipe emotion -> player: %d -> %d", pipe_out[1], pipe_out[0]);
903 INF("created pipe player -> emotion: %d -> %d\n", pipe_in[1], pipe_in[0]); 921 INF("created pipe player -> emotion: %d -> %d", pipe_in[1], pipe_in[0]);
904 922
905 close(pipe_in[1]); 923 close(pipe_in[1]);
906 close(pipe_out[0]); 924 close(pipe_out[0]);
@@ -1239,12 +1257,21 @@ static int
1239em_bgra_data_get(void *data, unsigned char **bgra_data) 1257em_bgra_data_get(void *data, unsigned char **bgra_data)
1240{ 1258{
1241 Emotion_Generic_Video *ev = data; 1259 Emotion_Generic_Video *ev = data;
1260#ifdef _WIN32
1261 DWORD res;
1262#endif
1242 1263
1243 if (!ev || !ev->file_ready) 1264 if (!ev || !ev->file_ready)
1244 return 0; 1265 return 0;
1245 1266
1246 // lock frame here 1267 // lock frame here
1268#ifdef _WIN32
1269 res = WaitForSingleObject(ev->shared->lock, 0L);
1270 if (res != WAIT_OBJECT_0)
1271 return 0;
1272#else
1247 sem_wait(&ev->shared->lock); 1273 sem_wait(&ev->shared->lock);
1274#endif
1248 1275
1249 // send current frame to emotion 1276 // send current frame to emotion
1250 if (ev->shared->frame.emotion != ev->shared->frame.last) 1277 if (ev->shared->frame.emotion != ev->shared->frame.last)
@@ -1259,7 +1286,11 @@ em_bgra_data_get(void *data, unsigned char **bgra_data)
1259 ev->shared->frame_drop = 0; 1286 ev->shared->frame_drop = 0;
1260 1287
1261 // unlock frame here 1288 // unlock frame here
1289#ifdef _WIN32
1290 ReleaseSemaphore(ev->shared->lock, 1, NULL);
1291#else
1262 sem_post(&ev->shared->lock); 1292 sem_post(&ev->shared->lock);
1293#endif
1263 ev->drop = 0; 1294 ev->drop = 0;
1264 1295
1265 return 1; 1296 return 1;
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_alloc.c b/legacy/emotion/src/modules/gstreamer/emotion_alloc.c
index aad5430a4c..70922a06f9 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_alloc.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_alloc.c
@@ -1,10 +1,17 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <Eina.h>
6#include <Evas.h>
7#include <Ecore.h>
8
1#include <glib.h> 9#include <glib.h>
2#include <gst/gst.h> 10#include <gst/gst.h>
3#include <gst/video/video.h> 11#include <gst/video/video.h>
4#include <gst/video/gstvideosink.h> 12#include <gst/video/gstvideosink.h>
5 13
6#include <Ecore.h> 14#include "Emotion.h"
7
8#include "emotion_gstreamer.h" 15#include "emotion_gstreamer.h"
9 16
10Emotion_Gstreamer_Buffer * 17Emotion_Gstreamer_Buffer *
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_convert.c b/legacy/emotion/src/modules/gstreamer/emotion_convert.c
index c3d5d7233a..0b366879d5 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_convert.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_convert.c
@@ -1,3 +1,16 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <Eina.h>
6#include <Evas.h>
7
8#include <glib.h>
9#include <gst/gst.h>
10#include <gst/video/video.h>
11#include <gst/video/gstvideosink.h>
12
13#include "Emotion.h"
1#include "emotion_gstreamer.h" 14#include "emotion_gstreamer.h"
2 15
3static inline void 16static inline void
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_fakeeos.c b/legacy/emotion/src/modules/gstreamer/emotion_fakeeos.c
index 6ff20d2592..a2f3595094 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_fakeeos.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_fakeeos.c
@@ -1,3 +1,16 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <Eina.h>
6#include <Evas.h>
7
8#include <glib.h>
9#include <gst/gst.h>
10#include <gst/video/video.h>
11#include <gst/video/gstvideosink.h>
12
13#include "Emotion.h"
1#include "emotion_gstreamer.h" 14#include "emotion_gstreamer.h"
2 15
3typedef struct _FakeEOSBin 16typedef struct _FakeEOSBin
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
index 7296cbb656..9f0051b7c0 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
@@ -1,11 +1,35 @@
1#include <unistd.h> 1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#ifdef HAVE_UNISTD_H
6# include <unistd.h>
7#endif
2#include <fcntl.h> 8#include <fcntl.h>
3 9
4#include <Eina.h> 10#include <Eina.h>
11#include <Evas.h>
12#include <Ecore.h>
13
14#define HTTP_STREAM 0
15#define RTSP_STREAM 1
16#include <glib.h>
17#include <gst/gst.h>
18#include <glib-object.h>
19#include <gst/video/gstvideosink.h>
20#include <gst/video/video.h>
5 21
22#ifdef HAVE_ECORE_X
23# include <Ecore_X.h>
24# include <Ecore_Evas.h>
25# ifdef HAVE_XOVERLAY_H
26# include <gst/interfaces/xoverlay.h>
27# endif
28#endif
29
30#include "Emotion.h"
6#include "emotion_private.h" 31#include "emotion_private.h"
7#include "emotion_gstreamer.h" 32#include "emotion_gstreamer.h"
8#include "Emotion.h"
9 33
10Eina_Bool window_manager_video = EINA_FALSE; 34Eina_Bool window_manager_video = EINA_FALSE;
11int _emotion_gstreamer_log_domain = -1; 35int _emotion_gstreamer_log_domain = -1;
@@ -400,9 +424,11 @@ em_cleanup(Emotion_Gstreamer_Video *ev)
400 if (ev->xvpad) gst_object_unref(ev->xvpad); 424 if (ev->xvpad) gst_object_unref(ev->xvpad);
401 ev->xvpad = NULL; 425 ev->xvpad = NULL;
402 426
427#ifdef HAVE_ECORE_X
403 fprintf(stderr, "destroying window: %i\n", ev->win); 428 fprintf(stderr, "destroying window: %i\n", ev->win);
404 if (ev->win) ecore_x_window_free(ev->win); 429 if (ev->win) ecore_x_window_free(ev->win);
405 ev->win = 0; 430 ev->win = 0;
431#endif
406 } 432 }
407 433
408 EINA_LIST_FREE(ev->audio_streams, astream) 434 EINA_LIST_FREE(ev->audio_streams, astream)
@@ -1231,6 +1257,7 @@ em_priority_get(void *video)
1231 return ev->stream; 1257 return ev->stream;
1232} 1258}
1233 1259
1260#ifdef HAVE_ECORE_X
1234static Eina_Bool 1261static Eina_Bool
1235_ecore_event_x_destroy(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) 1262_ecore_event_x_destroy(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
1236{ 1263{
@@ -1240,6 +1267,7 @@ _ecore_event_x_destroy(void *data __UNUSED__, int type __UNUSED__, void *event _
1240 1267
1241 return EINA_TRUE; 1268 return EINA_TRUE;
1242} 1269}
1270#endif
1243 1271
1244static Eina_Bool 1272static Eina_Bool
1245module_open(Evas_Object *obj, 1273module_open(Evas_Object *obj,
@@ -1271,7 +1299,9 @@ module_open(Evas_Object *obj,
1271 if (!em_module.init(obj, video, opt)) 1299 if (!em_module.init(obj, video, opt))
1272 return EINA_FALSE; 1300 return EINA_FALSE;
1273 1301
1302#ifdef HAVE_ECORE_X
1274 ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _ecore_event_x_destroy, NULL); 1303 ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _ecore_event_x_destroy, NULL);
1304#endif
1275 1305
1276 if (getenv("EMOTION_FPS_DEBUG")) debug_fps = EINA_TRUE; 1306 if (getenv("EMOTION_FPS_DEBUG")) debug_fps = EINA_TRUE;
1277 1307
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
index e69f30d486..25a718076c 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
@@ -1,31 +1,6 @@
1#ifndef __EMOTION_GSTREAMER_H__ 1#ifndef __EMOTION_GSTREAMER_H__
2#define __EMOTION_GSTREAMER_H__ 2#define __EMOTION_GSTREAMER_H__
3 3
4#ifdef HAVE_CONFIG_H
5# include "config.h"
6#endif
7
8#include <Evas.h>
9#include <Ecore.h>
10
11#ifdef HAVE_ECORE_X
12# include <Ecore_X.h>
13# include <Ecore_Evas.h>
14# ifdef HAVE_XOVERLAY_H
15# include <gst/interfaces/xoverlay.h>
16# endif
17#endif
18
19#define HTTP_STREAM 0
20#define RTSP_STREAM 1
21#include <glib.h>
22#include <gst/gst.h>
23#include <glib-object.h>
24#include <gst/video/gstvideosink.h>
25#include <gst/video/video.h>
26
27#include "emotion_private.h"
28
29typedef void (*Evas_Video_Convert_Cb)(unsigned char *evas_data, 4typedef void (*Evas_Video_Convert_Cb)(unsigned char *evas_data,
30 const unsigned char *gst_data, 5 const unsigned char *gst_data,
31 unsigned int w, 6 unsigned int w,
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_sink.c b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
index 339a36c2a1..1e8b05098b 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_sink.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
@@ -1,3 +1,21 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <Eina.h>
6#include <Evas.h>
7#include <Ecore.h>
8
9#define HTTP_STREAM 0
10#define RTSP_STREAM 1
11#include <glib.h>
12#include <gst/gst.h>
13#include <glib-object.h>
14#include <gst/video/gstvideosink.h>
15#include <gst/video/video.h>
16
17#include "Emotion.h"
18#include "emotion_private.h"
1#include "emotion_gstreamer.h" 19#include "emotion_gstreamer.h"
2 20
3static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE("sink", 21static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE("sink",
@@ -831,9 +849,9 @@ static void
831_video_resize(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__, 849_video_resize(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__,
832 Evas_Coord w, Evas_Coord h) 850 Evas_Coord w, Evas_Coord h)
833{ 851{
852#ifdef HAVE_ECORE_X
834 Emotion_Gstreamer_Video *ev = data; 853 Emotion_Gstreamer_Video *ev = data;
835 854
836#ifdef HAVE_ECORE_X
837 ecore_x_window_resize(ev->win, w, h); 855 ecore_x_window_resize(ev->win, w, h);
838#endif 856#endif
839 fprintf(stderr, "resize: %i, %i\n", w, h); 857 fprintf(stderr, "resize: %i, %i\n", w, h);
@@ -843,8 +861,8 @@ static void
843_video_move(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__, 861_video_move(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__,
844 Evas_Coord x, Evas_Coord y) 862 Evas_Coord x, Evas_Coord y)
845{ 863{
846 Emotion_Gstreamer_Video *ev = data;
847#ifdef HAVE_ECORE_X 864#ifdef HAVE_ECORE_X
865 Emotion_Gstreamer_Video *ev = data;
848 unsigned int pos[2]; 866 unsigned int pos[2];
849 867
850 fprintf(stderr, "move: %i, %i\n", x, y); 868 fprintf(stderr, "move: %i, %i\n", x, y);
@@ -890,10 +908,10 @@ _block_pad_link_cb(GstPad *pad, gboolean blocked, gpointer user_data)
890static void 908static void
891_video_show(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__) 909_video_show(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__)
892{ 910{
911#ifdef HAVE_ECORE_X
893 Emotion_Gstreamer_Video *ev = data; 912 Emotion_Gstreamer_Video *ev = data;
894 913
895 fprintf(stderr, "show xv\n"); 914 fprintf(stderr, "show xv\n");
896#ifdef HAVE_ECORE_X
897 ecore_x_window_show(ev->win); 915 ecore_x_window_show(ev->win);
898#endif 916#endif
899 /* gst_pad_set_blocked_async(ev->teepad, TRUE, _block_pad_link_cb, ev); */ 917 /* gst_pad_set_blocked_async(ev->teepad, TRUE, _block_pad_link_cb, ev); */
@@ -902,10 +920,10 @@ _video_show(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *s
902static void 920static void
903_video_hide(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__) 921_video_hide(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__)
904{ 922{
923#ifdef HAVE_ECORE_X
905 Emotion_Gstreamer_Video *ev = data; 924 Emotion_Gstreamer_Video *ev = data;
906 925
907 fprintf(stderr, "hide xv\n"); 926 fprintf(stderr, "hide xv\n");
908#ifdef HAVE_ECORE_X
909 ecore_x_window_hide(ev->win); 927 ecore_x_window_hide(ev->win);
910#endif 928#endif
911 /* gst_pad_set_blocked_async(ev->teepad, TRUE, _block_pad_unlink_cb, ev); */ 929 /* gst_pad_set_blocked_async(ev->teepad, TRUE, _block_pad_unlink_cb, ev); */