From: <tve...@ke...> - 2008-11-06 22:54:56
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: tvermeir Date: Thu Nov 06 2008 22:54:53 UTC Log message: * configure.ac: * gst/librfb/Makefile.am: * gst/librfb/gstrfbsrc.c: Fix basic navigation events Modified files: . : ChangeLog configure.ac gst/librfb : Makefile.am gstrfbsrc.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3682&r2=1.3683 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/configure.ac.diff?r1=1.905&r2=1.906 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/librfb/Makefile.am.diff?r1=1.8&r2=1.9 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/librfb/gstrfbsrc.c.diff?r1=1.29&r2=1.30 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.3682 retrieving revision 1.3683 diff -u -d -r1.3682 -r1.3683 --- ChangeLog 6 Nov 2008 14:05:54 -0000 1.3682 +++ ChangeLog 6 Nov 2008 22:54:36 -0000 1.3683 @@ -1,3 +1,10 @@ +2008-11-06 Thijs Vermeir <thi...@gm...> + + * configure.ac: + * gst/librfb/Makefile.am: + * gst/librfb/gstrfbsrc.c: + Fix basic navigation events 2008-11-06 Wim Taymans <wim...@co...> * gst/deinterlace2/gstdeinterlace2.c: Index: configure.ac RCS file: /cvs/gstreamer/gst-plugins-bad/configure.ac,v retrieving revision 1.905 retrieving revision 1.906 diff -u -d -r1.905 -r1.906 --- configure.ac 31 Oct 2008 18:39:37 -0000 1.905 +++ configure.ac 6 Nov 2008 22:54:38 -0000 1.906 @@ -201,6 +201,17 @@ AC_SUBST(HAVE_GLADE) AM_CONDITIONAL(HAVE_GLADE, test "x$HAVE_GLADE" = "xyes") +dnl x11 is optional for librfb +HAVE_X11=NO +PKG_CHECK_MODULES(X11, x11, HAVE_X11=yes, HAVE_X11=no) +AC_SUBST(X11_LIBS) +AC_SUBST(X11_CFLAGS) +AC_SUBST(HAVE_X11) +AM_CONDITIONAL(HAVE_X11, test "x$HAVE_X11" = "xyes") +if test "x$HAVE_X11" = "xyes"; then + AC_DEFINE(HAVE_X11, 1, [Define if you have X11 library]) +fi dnl set license and copyright notice GST_LICENSE="LGPL" AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license]) Index: Makefile.am RCS file: /cvs/gstreamer/gst-plugins-bad/gst/librfb/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.am 4 Nov 2008 12:42:12 -0000 1.8 +++ Makefile.am 6 Nov 2008 22:54:38 -0000 1.9 @@ -4,8 +4,8 @@ plugin_LTLIBRARIES = libgstrfbsrc.la libgstrfbsrc_la_SOURCES = gstrfbsrc.c -libgstrfbsrc_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) -I$(srcdir)/.. -libgstrfbsrc_la_LIBADD = $(GST_BASE_LIBS) librfb.la +libgstrfbsrc_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(X11_CFLAGS) -I$(srcdir)/.. +libgstrfbsrc_la_LIBADD = $(GST_BASE_LIBS) $(X11_LIBS) librfb.la libgstrfbsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstrfbsrc_la_LIBTOOLFLAGS = --tag=disable-static Index: gstrfbsrc.c RCS file: /cvs/gstreamer/gst-plugins-bad/gst/librfb/gstrfbsrc.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- gstrfbsrc.c 5 Nov 2008 23:31:41 -0000 1.29 +++ gstrfbsrc.c 6 Nov 2008 22:54:39 -0000 1.30 @@ -30,6 +30,9 @@ #include <string.h> #include <stdlib.h> +#ifdef HAVE_X11 +#include <X11/Xlib.h> +#endif enum { @@ -462,6 +465,9 @@ gint button; GstStructure *structure; const gchar *event_type; + gboolean key_event, key_press; + key_event = FALSE; switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NAVIGATION: @@ -472,33 +478,49 @@ structure = event->structure; event_type = gst_structure_get_string (structure, "event"); + if (strcmp (event_type, "key-press") == 0) { + key_event = key_press = TRUE; + } else if (strcmp (event_type, "key-release") == 0) { + key_event = TRUE; + key_press = FALSE; + } + if (key_event) { + const gchar *key; + KeySym key_sym; + key = gst_structure_get_string (structure, "key"); + key_sym = XStringToKeysym (key); + if (key_sym != NoSymbol) + rfb_decoder_send_key_event (src->decoder, key_sym, key_press); + break; gst_structure_get_double (structure, "pointer_x", &x); gst_structure_get_double (structure, "pointer_y", &y); - button = 0; + gst_structure_get_int (structure, "button", &button); /* we need to take care of the offset's */ x += src->decoder->offset_x; y += src->decoder->offset_y; - if (strcmp (event_type, "key-press") == 0) { - const gchar *key = gst_structure_get_string (structure, "key"); - - GST_LOG_OBJECT (src, "sending key event for key %d", key[0]); - rfb_decoder_send_key_event (src->decoder, key[0], 1); - rfb_decoder_send_key_event (src->decoder, key[0], 0); - } else if (strcmp (event_type, "mouse-move") == 0) { + if (strcmp (event_type, "mouse-move") == 0) { GST_LOG_OBJECT (src, "sending mouse-move event " "button_mask=%d, x=%d, y=%d", src->button_mask, (gint) x, (gint) y); rfb_decoder_send_pointer_event (src->decoder, src->button_mask, (gint) x, (gint) y); } else if (strcmp (event_type, "mouse-button-release") == 0) { - src->button_mask &= ~(1 << button); + src->button_mask &= ~(1 << (button - 1)); GST_LOG_OBJECT (src, "sending mouse-button-release event " } else if (strcmp (event_type, "mouse-button-press") == 0) { - src->button_mask |= (1 << button); + src->button_mask |= (1 << (button - 1)); GST_LOG_OBJECT (src, "sending mouse-button-press event " |