summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorIlja Pavkovic <illsen@gumblfarz.de>2008-07-08 21:20:27 +0000
committerThijs Vermeir <thijsvermeir@gmail.com>2008-07-08 21:20:27 +0000
commit18d3b8fb9601d4e7b6b7b9f0e6330f727ce17cc9 (patch)
treeff07077999dadaf61f06ccfc8c50ca3101eb79d4 /gst
parentc709e44f98158d64b46ec5545890d7343f67929f (diff)
downloadgst-plugins-bad-18d3b8fb9601d4e7b6b7b9f0e6330f727ce17cc9.tar.gz
gst-plugins-bad-18d3b8fb9601d4e7b6b7b9f0e6330f727ce17cc9.tar.bz2
gst-plugins-bad-18d3b8fb9601d4e7b6b7b9f0e6330f727ce17cc9.zip
gst/librfb/gstrfbsrc.*: Add view-only property to ignore the navigation events
Original commit message from CVS: patch by: Ilja Pavkovic <illsen@gumblfarz.de> * gst/librfb/gstrfbsrc.c: * gst/librfb/gstrfbsrc.h: Add view-only property to ignore the navigation events
Diffstat (limited to 'gst')
-rw-r--r--gst/librfb/gstrfbsrc.c19
-rw-r--r--gst/librfb/gstrfbsrc.h1
2 files changed, 19 insertions, 1 deletions
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;