summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-10-21 15:00:41 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-10-21 15:00:41 +0000
commit321cbb17e9be81f790ee48be7a3f5a5f23d4c0c1 (patch)
tree962e227d19a9d6ee72bc35e947f734f71476ee96 /legacy/emotion
parent0acd0ff1003893d1271b162685b0673558e822e0 (diff)
emotion: disable direct rendering path if window manager doesn't handle it.
SVN revision: 64256
Diffstat (limited to 'legacy/emotion')
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c54
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h1
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_sink.c85
3 files changed, 99 insertions, 41 deletions
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
index 1e9a40fd58..b9ba0dac63 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
@@ -7,6 +7,7 @@
7#include "emotion_gstreamer.h" 7#include "emotion_gstreamer.h"
8#include "Emotion.h" 8#include "Emotion.h"
9 9
10Eina_Bool window_manager_video = EINA_FALSE;
10int _emotion_gstreamer_log_domain = -1; 11int _emotion_gstreamer_log_domain = -1;
11Eina_Bool debug_fps = EINA_FALSE; 12Eina_Bool debug_fps = EINA_FALSE;
12 13
@@ -1259,6 +1260,11 @@ module_open(Evas_Object *obj,
1259 void **video, 1260 void **video,
1260 Emotion_Module_Options *opt) 1261 Emotion_Module_Options *opt)
1261{ 1262{
1263#ifdef HAVE_ECORE_X
1264 Ecore_X_Window *roots;
1265 int num;
1266#endif
1267
1262 if (!module) 1268 if (!module)
1263 return EINA_FALSE; 1269 return EINA_FALSE;
1264 1270
@@ -1284,6 +1290,54 @@ module_open(Evas_Object *obj,
1284 1290
1285 eina_threads_init(); 1291 eina_threads_init();
1286 1292
1293#ifdef HAVE_ECORE_X
1294 /* Check if the window manager is able to handle our special Xv window. */
1295 roots = ecore_x_window_root_list(&num);
1296 if (roots && num > 0)
1297 {
1298 Ecore_X_Window win, twin;
1299 int nwins;
1300
1301 nwins = ecore_x_window_prop_window_get(roots[0],
1302 ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
1303 &win, 1);
1304 if (nwins > 0)
1305 {
1306 nwins = ecore_x_window_prop_window_get(win,
1307 ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
1308 &twin, 1);
1309 if (nwins > 0 && twin == win)
1310 {
1311 Ecore_X_Atom *supported;
1312 int supported_num;
1313 int i;
1314
1315 if (ecore_x_netwm_supported_get(roots[0], &supported, &supported_num))
1316 {
1317 Eina_Bool parent = EINA_FALSE;
1318 Eina_Bool video_position = EINA_FALSE;
1319
1320 for (i = 0; i < supported_num; ++i)
1321 {
1322 if (supported[i] == ECORE_X_ATOM_E_VIDEO_PARENT)
1323 parent = EINA_TRUE;
1324 else if (supported[i] == ECORE_X_ATOM_E_VIDEO_POSITION)
1325 video_position = EINA_TRUE;
1326 if (parent && video_position)
1327 break;
1328 }
1329
1330 if (parent && video_position)
1331 {
1332 window_manager_video = EINA_TRUE;
1333 }
1334 }
1335 }
1336 }
1337 }
1338 free(roots);
1339#endif
1340
1287 *module = &em_module; 1341 *module = &em_module;
1288 return EINA_TRUE; 1342 return EINA_TRUE;
1289} 1343}
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
index 51e728106e..517ff4fc25 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
@@ -206,6 +206,7 @@ struct _Emotion_Gstreamer_Message
206 GstMessage *msg; 206 GstMessage *msg;
207}; 207};
208 208
209extern Eina_Bool window_manager_video;
209extern Eina_Bool debug_fps; 210extern Eina_Bool debug_fps;
210extern int _emotion_gstreamer_log_domain; 211extern int _emotion_gstreamer_log_domain;
211#define DBG(...) EINA_LOG_DOM_DBG(_emotion_gstreamer_log_domain, __VA_ARGS__) 212#define DBG(...) EINA_LOG_DOM_DBG(_emotion_gstreamer_log_domain, __VA_ARGS__)
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_sink.c b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
index 623bb5ea5f..3e71d8fe1c 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_sink.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
@@ -1173,59 +1173,62 @@ gstreamer_video_sink_new(Emotion_Gstreamer_Video *ev,
1173 } 1173 }
1174 1174
1175#if defined HAVE_ECORE_X && defined HAVE_XOVERLAY_H 1175#if defined HAVE_ECORE_X && defined HAVE_XOVERLAY_H
1176 engines = evas_render_method_list(); 1176 if (window_manager_video)
1177 {
1178 engines = evas_render_method_list();
1177 1179
1178 engine = eina_list_nth(engines, evas_output_method_get(evas_object_evas_get(obj)) - 1); 1180 engine = eina_list_nth(engines, evas_output_method_get(evas_object_evas_get(obj)) - 1);
1179 1181
1180 if (ev->priority && engine && strstr(engine, "_x11") != NULL) 1182 if (ev->priority && engine && strstr(engine, "_x11") != NULL)
1181 { 1183 {
1182 Ecore_Evas *ee; 1184 Ecore_Evas *ee;
1183 Evas_Coord x, y, w, h; 1185 Evas_Coord x, y, w, h;
1184 Ecore_X_Window win; 1186 Ecore_X_Window win;
1185 Ecore_X_Window parent; 1187 Ecore_X_Window parent;
1186 1188
1187 evas_object_geometry_get(obj, &x, &y, &w, &h); 1189 evas_object_geometry_get(obj, &x, &y, &w, &h);
1188 1190
1189 ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); 1191 ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
1190 1192
1191 if (w < 4) w = 4; 1193 if (w < 4) w = 4;
1192 if (h < 2) h = 2; 1194 if (h < 2) h = 2;
1193 1195
1194 /* Here we really need to have the help of the window manager, this code will change when we update E17. */ 1196 /* Here we really need to have the help of the window manager, this code will change when we update E17. */
1195 parent = (Ecore_X_Window) ecore_evas_window_get(ee); 1197 parent = (Ecore_X_Window) ecore_evas_window_get(ee);
1196 fprintf(stderr, "parent: %x\n", parent); 1198 fprintf(stderr, "parent: %x\n", parent);
1197 1199
1198 win = ecore_x_window_new(0, x, y, w, h); 1200 win = ecore_x_window_new(0, x, y, w, h);
1199 fprintf(stderr, "creating window: %x [%i, %i, %i, %i]\n", win, x, y, w, h); 1201 fprintf(stderr, "creating window: %x [%i, %i, %i, %i]\n", win, x, y, w, h);
1200 if (win) 1202 if (win)
1201 { 1203 {
1202 ecore_x_mwm_borderless_set(win, EINA_TRUE); 1204 /* ecore_x_mwm_borderless_set(win, EINA_TRUE); */
1203 ecore_x_window_show(win); 1205 ecore_x_window_hide(win);
1204 xvsink = gst_element_factory_make("xvimagesink", NULL); 1206 xvsink = gst_element_factory_make("xvimagesink", NULL);
1205 if (xvsink) 1207 if (xvsink)
1206 { 1208 {
1207 unsigned int pos[2]; 1209 unsigned int pos[2];
1208 1210
1209#ifdef HAVE_X_OVERLAY_SET 1211#ifdef HAVE_X_OVERLAY_SET
1210 gst_x_overlay_set_window_handle(GST_X_OVERLAY(xvsink), win); 1212 gst_x_overlay_set_window_handle(GST_X_OVERLAY(xvsink), win);
1211#else 1213#else
1212 gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvsink), win); 1214 gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvsink), win);
1213#endif 1215#endif
1214 ev->win = win; 1216 ev->win = win;
1215 1217
1216 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIDEO_PARENT, &parent, 1); 1218 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIDEO_PARENT, &parent, 1);
1217 1219
1218 pos[0] = x; pos[1] = y; 1220 pos[0] = x; pos[1] = y;
1219 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIDEO_POSITION, pos, 2); 1221 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIDEO_POSITION, pos, 2);
1220 } 1222 }
1221 else 1223 else
1222 { 1224 {
1223 fprintf(stderr, "destroying win: %x\n", win); 1225 fprintf(stderr, "destroying win: %x\n", win);
1224 ecore_x_window_free(win); 1226 ecore_x_window_free(win);
1225 } 1227 }
1226 } 1228 }
1229 }
1230 evas_render_method_list_free(engines);
1227 } 1231 }
1228 evas_render_method_list_free(engines);
1229#else 1232#else
1230# warning "no ecore_x or xoverlay" 1233# warning "no ecore_x or xoverlay"
1231#endif 1234#endif