From: cedric Date: Wed, 28 Dec 2011 16:08:38 +0000 (+0000) Subject: emotion: properly test the existence of an X connection in gstreamer backend. X-Git-Tag: submit/2.0alpha-wayland/20121127.222018~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7509dcbda49ba9a40926eb8498a001f283638210;p=profile%2Fivi%2Femotion.git emotion: properly test the existence of an X connection in gstreamer backend. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/emotion@66606 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/modules/gstreamer/emotion_gstreamer.c b/src/modules/gstreamer/emotion_gstreamer.c index 4382a4e..7296cbb 100644 --- a/src/modules/gstreamer/emotion_gstreamer.c +++ b/src/modules/gstreamer/emotion_gstreamer.c @@ -10,6 +10,7 @@ Eina_Bool window_manager_video = EINA_FALSE; int _emotion_gstreamer_log_domain = -1; Eina_Bool debug_fps = EINA_FALSE; +Eina_Bool _ecore_x_available = EINA_FALSE; /* Callbacks to get the eos */ static void _for_each_tag (GstTagList const* list, gchar const* tag, void *data); @@ -1277,8 +1278,13 @@ module_open(Evas_Object *obj, eina_threads_init(); #ifdef HAVE_ECORE_X + if (ecore_x_init(NULL) > 0) + { + _ecore_x_available = EINA_TRUE; + } + /* Check if the window manager is able to handle our special Xv window. */ - roots = ecore_x_window_root_list(&num); + roots = _ecore_x_available ? ecore_x_window_root_list(&num) : NULL; if (roots && num > 0) { Ecore_X_Window win, twin; @@ -1334,6 +1340,13 @@ module_close(Emotion_Video_Module *module __UNUSED__, { em_module.shutdown(video); +#ifdef HAVE_ECORE_X + if (_ecore_x_available) + { + ecore_x_shutdown(); + } +#endif + eina_threads_shutdown(); } diff --git a/src/modules/gstreamer/emotion_gstreamer.h b/src/modules/gstreamer/emotion_gstreamer.h index 93a638d..e69f30d 100644 --- a/src/modules/gstreamer/emotion_gstreamer.h +++ b/src/modules/gstreamer/emotion_gstreamer.h @@ -209,6 +209,7 @@ struct _Emotion_Gstreamer_Message extern Eina_Bool window_manager_video; extern Eina_Bool debug_fps; extern int _emotion_gstreamer_log_domain; +extern Eina_Bool _ecore_x_available; #define DBG(...) EINA_LOG_DOM_DBG(_emotion_gstreamer_log_domain, __VA_ARGS__) #define INF(...) EINA_LOG_DOM_INFO(_emotion_gstreamer_log_domain, __VA_ARGS__) #define WRN(...) EINA_LOG_DOM_WARN(_emotion_gstreamer_log_domain, __VA_ARGS__)