[Player-dev] CR: Add expose API to helix dbus server

[Player-dev] CR: Add expose API to helix dbus server

Rusty Lynch rusty.lynch at intel.com
Mon Mar 24 14:35:45 PDT 2008


Description
----------------------------------
This changeset will add a new method for remote clients to explicitly
ask the media infrastructure to process an expose event.

By extending the API in this fashion, the application force expose
events in corner cases where the remote dbus server tends to not detect
the need to expose.

Files Modified
----------------------------------
player/kit/dbus-server/pub/hxplayer.h
player/kit/dbus-server/src/helix-dbus-server.cpp
player/kit/dbus-server/src/hxplayer.cpp

Branches
---------------------------------
HEAD only (for now)


Index: pub/hxplayer.h
===================================================================
RCS file: /cvsroot/player/kit/dbus-server/pub/hxplayer.h,v
retrieving revision 1.2.2.12
diff -u -w -r1.2.2.12 hxplayer.h
--- pub/hxplayer.h	27 Feb 2008 05:28:55 -0000	1.2.2.12
+++ pub/hxplayer.h	24 Mar 2008 21:31:03 -0000
@@ -58,6 +58,7 @@
 bool hxplayer_pump(HxPlayer *hxplayer);
 void hxplayer_pump_begin(HxPlayer *hxplayer);
 void hxplayer_pump_end(HxPlayer *hxplayer);
+void hxplayer_expose(HxPlayer *hxplayer);
 gboolean hxplayer_resize_window( HxPlayer* hxplayer, int* p_width, int*
p_height, int* p_pos_x, int* p_pos_y, int video_size_mode);
 void hxplayer_get_plugin_list(HxPlayer* hxplayer, char* StrOfPlugin,
gint StrOfPluginLen);
 
Index: src/helix-dbus-server.cpp
===================================================================
RCS file: /cvsroot/player/kit/dbus-server/src/helix-dbus-server.cpp,v
retrieving revision 1.2.2.24
diff -u -w -r1.2.2.24 helix-dbus-server.cpp
--- src/helix-dbus-server.cpp	13 Mar 2008 01:51:45 -0000	1.2.2.24
+++ src/helix-dbus-server.cpp	24 Mar 2008 21:31:03 -0000
@@ -81,6 +81,7 @@
 // private static members
 
 METHOD_HANDLER_DEFINE(helix_dbus_server_handle_ping);
+METHOD_HANDLER_DEFINE(helix_dbus_server_handle_expose);
 METHOD_HANDLER_DEFINE(helix_dbus_server_handle_open_uri);
 METHOD_HANDLER_DEFINE(helix_dbus_server_handle_play);
 METHOD_HANDLER_DEFINE(helix_dbus_server_handle_pause);
@@ -115,6 +116,7 @@
 METHOD_HANDLER_DEFINE(helix_dbus_server_handle_stop_pump); 
 static HelixDbusMethodVTable method_handler_vtable [] = {
     { "Ping",            DBUS_TYPE_INVALID,
helix_dbus_server_handle_ping },
+    { "Expose",          DBUS_TYPE_INVALID,
helix_dbus_server_handle_expose },
     { "OpenUri",         DBUS_TYPE_BOOLEAN,
helix_dbus_server_handle_open_uri },
     { "Play",            DBUS_TYPE_INVALID,
helix_dbus_server_handle_play },
     { "Pause",           DBUS_TYPE_INVALID,
helix_dbus_server_handle_pause },
@@ -462,6 +464,14 @@
     server->last_ping = time(NULL);
 }
 
+static void 
+helix_dbus_server_handle_expose(HelixDbusServer *server, DBusMessage
*message, 
+				void **return_value)
+{
+    if (server->player)
+	hxplayer_expose(server->player);
+}
+
 #define MAX_PATH_LEN (1024)
 #define DEFAULT_VIDEO_WIDTH (400)
 #define DEFAULT_VIDEO_HEIGHT (300)
Index: src/hxplayer.cpp
===================================================================
RCS file: /cvsroot/player/kit/dbus-server/src/hxplayer.cpp,v
retrieving revision 1.2.2.21
diff -u -w -r1.2.2.21 hxplayer.cpp
--- src/hxplayer.cpp	28 Feb 2008 01:50:45 -0000	1.2.2.21
+++ src/hxplayer.cpp	24 Mar 2008 21:31:03 -0000
@@ -44,7 +44,6 @@
 #include "hxplayer.h"
 #include "hxmessage.h"
 #include "hxmessagesegment.h"
-
 #include "hxpref.h"
 #include "CHXClientUnknown.h"
 #include "HXClientCOMAccess.h"
@@ -627,6 +626,23 @@
     return TRUE;
 }
 
+void hxplayer_expose(HxPlayer* hxplayer)
+{
+    if (!hxplayer ||
+	!hxplayer->bInitialized)
+	return;
+    
+    XEvent tmp_xev;
+    XEvent *pXev = &tmp_xev;
+    memset(pXev,0,sizeof(XEvent));
+    pXev->type = 12;
+    pXev->xany.window = hxplayer->window->window;
+    pXev->xany.display = hxplayer->window->display;
+
+    ClientEngineProcessXEvent(pXev);
+    XSync((Display*)hxplayer->window->display, false);
+}
+
 gboolean hxplayer_resize_window( HxPlayer* hxplayer, int* p_width, int*
p_height, int* p_pos_x, int* p_pos_y, int video_size_mode)
 {
 




More information about the Player-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.