From 60a60a04522b187f3a06f0aa9429515e7775d631 Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Thu, 6 Nov 2003 22:17:37 +0000 Subject: [PATCH] Adding navigation interface. Original commit message from CVS: Adding navigation interface. Putting a define for USE_SHM waiting for bug #126401 to be fixed. --- sys/ximage/ximagesink.c | 33 ++++++++++++++++++++++++++++----- sys/ximage/ximagesink.h | 3 +++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 961afa8..c0b63b9 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -73,6 +73,29 @@ gst_ximagesink_interface_init (GstInterfaceClass *klass) klass->supported = gst_ximagesink_interface_supported; } +static void +gst_ximagesink_navigation_send_event (GstNavigation *navigation, GstCaps *caps) +{ + GstXImageSink *ximagesink = GST_XIMAGESINK (navigation); + GstEvent *event; + + event = gst_event_new (GST_EVENT_NAVIGATION); + /*GST_EVENT_TIMESTAMP (event) = 0;*/ + event->event_data.caps.caps = caps; + + /* FIXME + * Obviously, the pointer x,y coordinates need to be adjusted by the + * window size and relation to the bounding window. */ + + gst_pad_send_event (gst_pad_get_peer (ximagesink->sinkpad), event); +} + +static void +gst_ximagesink_navigation_init (GstNavigationInterface *iface) +{ + iface->send_event = gst_ximagesink_navigation_send_event; +} + /* X11 stuff */ static GstXImage * @@ -853,12 +876,12 @@ gst_ximagesink_get_type (void) NULL, NULL, }; - /*static const GInterfaceInfo navigation_info = { -` (GInterfaceInitFunc) gst_ximagesink_navigation_init, + static const GInterfaceInfo navigation_info = { + (GInterfaceInitFunc) gst_ximagesink_navigation_init, NULL, NULL, }; - static const GInterfaceInfo xoverlay_info = { + /*static const GInterfaceInfo xoverlay_info = { (GInterfaceInitFunc) gst_ximagesink_xoverlay_init, NULL, NULL, @@ -871,9 +894,9 @@ gst_ximagesink_get_type (void) g_type_add_interface_static (ximagesink_type, GST_TYPE_INTERFACE, &iface_info); - /*g_type_add_interface_static (xvimagesink_type, GST_TYPE_NAVIGATION, + g_type_add_interface_static (ximagesink_type, GST_TYPE_NAVIGATION, &navigation_info); - g_type_add_interface_static (ximagesink_type, GST_TYPE_X_OVERLAY, + /*g_type_add_interface_static (ximagesink_type, GST_TYPE_X_OVERLAY, &xoverlay_info);*/ } diff --git a/sys/ximage/ximagesink.h b/sys/ximage/ximagesink.h index 3d599ae..10314a3 100644 --- a/sys/ximage/ximagesink.h +++ b/sys/ximage/ximagesink.h @@ -22,6 +22,9 @@ #include +/* FIXME : We should have a configure test for shm support */ +#define USE_SHM + #ifdef USE_SHM #include #include -- 2.7.4