summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--gst/librfb/gstrfbsrc.c19
-rw-r--r--gst/librfb/gstrfbsrc.h1
3 files changed, 27 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 575d188b..08b8120e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-08 Thijs Vermeir <thijsvermeir@gmail.com>
+
+ patch by: Ilja Pavkovic <illsen@gumblfarz.de>
+
+ * gst/librfb/gstrfbsrc.c:
+ * gst/librfb/gstrfbsrc.h:
+ Add view-only property to ignore the navigation events
+
2008-07-08 Michael Smith <msmith@songbirdnest.com>
* sys/dshowdecwrapper/gstdshowaudiodec.c:
diff --git a/gst/librfb/gstrfbsrc.c b/gst/librfb/gstrfbsrc.c
index 376d901d..fdb03625 100644
--- a/gst/librfb/gstrfbsrc.c
+++ b/gst/librfb/gstrfbsrc.c
@@ -44,7 +44,8 @@ enum
ARG_HEIGHT,
ARG_INCREMENTAL,
ARG_USE_COPYRECT,
- ARG_SHARED
+ ARG_SHARED,
+ ARG_VIEWONLY
};
GST_DEBUG_CATEGORY_STATIC (rfbsrc_debug);
@@ -152,6 +153,9 @@ gst_rfb_src_class_init (GstRfbSrcClass * klass)
g_object_class_install_property (gobject_class, ARG_SHARED,
g_param_spec_boolean ("shared", "Share desktop with other clients",
"Share desktop with other clients", TRUE, G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, ARG_VIEWONLY,
+ g_param_spec_boolean ("view-only", "Only view the desktop",
+ "only view the desktop", FALSE, G_PARAM_READWRITE));
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_rfb_src_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_rfb_src_stop);
gstbasesrc_class->event = GST_DEBUG_FUNCPTR (gst_rfb_src_event);
@@ -174,6 +178,8 @@ gst_rfb_src_init (GstRfbSrc * src, GstRfbSrcClass * klass)
src->incremental_update = TRUE;
+ src->view_only = FALSE;
+
src->decoder = rfb_decoder_new ();
}
@@ -280,6 +286,9 @@ gst_rfb_src_set_property (GObject * object, guint prop_id,
case ARG_SHARED:
src->decoder->shared_flag = g_value_get_boolean (value);
break;
+ case ARG_VIEWONLY:
+ src->view_only = g_value_get_boolean (value);
+ break;
default:
break;
}
@@ -325,6 +334,9 @@ gst_rfb_src_get_property (GObject * object, guint prop_id,
case ARG_SHARED:
g_value_set_boolean (value, src->decoder->shared_flag);
break;
+ case ARG_VIEWONLY:
+ g_value_set_boolean (value, src->view_only);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -453,6 +465,11 @@ gst_rfb_src_event (GstBaseSrc * bsrc, GstEvent * event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_NAVIGATION:
+
+ /* if in view_only mode ignore the navigation event */
+ if (src->view_only)
+ break;
+
structure = event->structure;
event_type = gst_structure_get_string (structure, "event");
gst_structure_get_double (structure, "pointer_x", &x);
diff --git a/gst/librfb/gstrfbsrc.h b/gst/librfb/gstrfbsrc.h
index 72af58cb..3fcb4141 100644
--- a/gst/librfb/gstrfbsrc.h
+++ b/gst/librfb/gstrfbsrc.h
@@ -55,6 +55,7 @@ struct _GstRfbSrc
RfbDecoder *decoder;
gboolean go;
gboolean incremental_update;
+ gboolean view_only;
guint button_mask;