+2004-01-07 Jan Schmidt <thaytan@mad.scientist.com>
+
+ * ext/dv/gstdvdec.c: (gst_dvdec_loop):
+ Fix caps negotiation.
+
+ * ext/dvdnav/dvdnavsrc.c: (dvdnavsrc_class_init),
+ (dvdnavsrc_update_buttoninfo), (dvdnavsrc_get),
+ (dvdnavsrc_get_event_mask), (dvdnav_handle_navigation_event),
+ (dvdnavsrc_event):
+ * ext/mpeg2dec/gstmpeg2dec.c:
+ * gst-libs/gst/navigation/navigation.c:
+ (gst_navigation_send_key_event), (gst_navigation_send_mouse_event):
+ * gst-libs/gst/navigation/navigation.h:
+ * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_handle_src_event):
+ * sys/ximage/ximagesink.c: (gst_ximagesink_handle_xevents):
+ * sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents):
+ Super-simple first version of mouse and keyboard events. Clicking
+ on a DVD menu now works, although it may not take you where you
+ expected.
+
+ * gst/sine/gstsinesrc.c: (gst_sinesrc_src_fixate):
+ * gst/videotestsrc/gstvideotestsrc.c:
+ (gst_videotestsrc_src_fixate):
+ These fixate functions were broken - they never actually
+ fixated :)
+
2004-01-06 Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/shout/gstshout.c: (gst_icecastsend_base_init),
}
void
-gst_navigation_send_key_event (GstNavigation *navigation, const char *key)
+gst_navigation_send_key_event (GstNavigation *navigation, const char *event,
+ const char *key)
{
gst_navigation_send_event (navigation, gst_structure_new (
"application/x-gst-navigation",
+ "event", G_TYPE_STRING, event,
"key", G_TYPE_STRING, key, NULL));
}
void
-gst_navigation_send_mouse_event (GstNavigation *navigation, double x,
- double y)
+gst_navigation_send_mouse_event (GstNavigation *navigation, const char *event,
+ int button, double x, double y)
{
gst_navigation_send_event (navigation, gst_structure_new (
"application/x-gst-navigation",
+ "event", G_TYPE_STRING, event,
+ "button", G_TYPE_INT, button,
"pointer_x", G_TYPE_DOUBLE, x,
"pointer_y", G_TYPE_DOUBLE, y, NULL));
}
/* virtual class function wrappers */
void gst_navigation_send_event (GstNavigation *navigation, GstStructure *structure);
-void gst_navigation_send_key_event (GstNavigation *navigation, const char *key);
-void gst_navigation_send_mouse_event (GstNavigation *navigation, double x,
- double y);
+void gst_navigation_send_key_event (GstNavigation *navigation,
+ const char *event, const char *key);
+void gst_navigation_send_mouse_event (GstNavigation *navigation,
+ const char *event, int button, double x, double y);
G_END_DECLS
}
void
-gst_navigation_send_key_event (GstNavigation *navigation, const char *key)
+gst_navigation_send_key_event (GstNavigation *navigation, const char *event,
+ const char *key)
{
gst_navigation_send_event (navigation, gst_structure_new (
"application/x-gst-navigation",
+ "event", G_TYPE_STRING, event,
"key", G_TYPE_STRING, key, NULL));
}
void
-gst_navigation_send_mouse_event (GstNavigation *navigation, double x,
- double y)
+gst_navigation_send_mouse_event (GstNavigation *navigation, const char *event,
+ int button, double x, double y)
{
gst_navigation_send_event (navigation, gst_structure_new (
"application/x-gst-navigation",
+ "event", G_TYPE_STRING, event,
+ "button", G_TYPE_INT, button,
"pointer_x", G_TYPE_DOUBLE, x,
"pointer_y", G_TYPE_DOUBLE, y, NULL));
}
/* virtual class function wrappers */
void gst_navigation_send_event (GstNavigation *navigation, GstStructure *structure);
-void gst_navigation_send_key_event (GstNavigation *navigation, const char *key);
-void gst_navigation_send_mouse_event (GstNavigation *navigation, double x,
- double y);
+void gst_navigation_send_key_event (GstNavigation *navigation,
+ const char *event, const char *key);
+void gst_navigation_send_mouse_event (GstNavigation *navigation,
+ const char *event, int button, double x, double y);
G_END_DECLS
GstStructure *structure;
GstCaps *newcaps;
- structure = gst_structure_copy (gst_caps_get_structure (caps, 0));
- newcaps = gst_caps_new_full (structure, NULL);
+ if (gst_caps_get_size (caps) > 1) return NULL;
+
+ newcaps = gst_caps_copy (caps);
+ structure = gst_caps_get_structure (newcaps, 0);
if (gst_caps_structure_fixate_field_nearest_int (structure, "rate", 44100)) {
return newcaps;
/* FIXME this function isn't very intelligent in choosing "good" caps */
- structure = gst_structure_copy(gst_caps_get_structure (caps, 0));
- newcaps = gst_caps_new_full (structure, NULL);
+ if (gst_caps_get_size (caps) > 1) return NULL;
- if (gst_caps_get_size (caps) > 1) {
- return newcaps;
- }
+ newcaps = gst_caps_copy (caps);
+ structure = gst_caps_get_structure (newcaps, 0);
if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 320)) {
return newcaps;
GST_DEBUG ("ximagesink pointer moved over window at %d,%d",
e.xmotion.x, e.xmotion.y);
gst_navigation_send_mouse_event (GST_NAVIGATION (ximagesink),
+ "mouse-move",
+ 0,
e.xmotion.x, e.xmotion.y);
break;
case ButtonPress:
+ GST_DEBUG ("ximagesink button %d pressed over window at %d,%d",
+ e.xbutton.button, e.xbutton.x, e.xbutton.x);
+ gst_navigation_send_mouse_event (GST_NAVIGATION (ximagesink),
+ "mouse-button-press",
+ e.xbutton.button,
+ e.xbutton.x, e.xbutton.y);
+ break;
case ButtonRelease:
/* Mouse button pressed/released over our window. We send upstream
events for interactivity/navigation */
- GST_DEBUG ("ximagesink button %d pressed over window at %d,%d",
+ GST_DEBUG ("ximagesink button %d release over window at %d,%d",
e.xbutton.button, e.xbutton.x, e.xbutton.x);
gst_navigation_send_mouse_event (GST_NAVIGATION (ximagesink),
- e.xmotion.x, e.xmotion.y);
+ "mouse-button-release",
+ e.xbutton.button,
+ e.xbutton.x, e.xbutton.y);
break;
case KeyPress:
case KeyRelease:
e.xkey.keycode, e.xkey.x, e.xkey.x);
keysym = XKeycodeToKeysym (ximagesink->xcontext->disp,
e.xkey.keycode, 0);
- gst_navigation_send_key_event (GST_NAVIGATION (ximagesink),
- XKeysymToString (keysym));
- /* FIXME : What's that ? */
- gst_navigation_send_key_event (GST_NAVIGATION (ximagesink),
- "unknown");
+ if (keysym != NoSymbol) {
+ gst_navigation_send_key_event (GST_NAVIGATION (ximagesink),
+ e.type == KeyPress ?
+ "key-press" : "key-release",
+ XKeysymToString (keysym));
+ }
+ else {
+ /* FIXME : What's that ? */
+ gst_navigation_send_key_event (GST_NAVIGATION (ximagesink),
+ e.type == KeyPress ?
+ "key-press" : "key-release",
+ "unknown");
+ }
break;
default:
GST_DEBUG ("ximagesink unhandled X event (%d)", e.type);
GST_DEBUG ("xvimagesink pointer moved over window at %d,%d",
e.xmotion.x, e.xmotion.y);
gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
+ "mouse-move", 0,
e.xmotion.x, e.xmotion.y);
break;
case ButtonPress:
- case ButtonRelease:
- /* Mouse button pressed/released over our window. We send upstream
+ /* Mouse button pressed over our window. We send upstream
events for interactivity/navigation */
GST_DEBUG ("xvimagesink button %d pressed over window at %d,%d",
e.xbutton.button, e.xbutton.x, e.xbutton.y);
gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
+ "mouse-button-press",
+ e.xbutton.button,
+ e.xbutton.x, e.xbutton.y);
+ break;
+ case ButtonRelease:
+ /* Mouse button released over our window. We send upstream
+ events for interactivity/navigation */
+ GST_DEBUG ("xvimagesink button %d released over window at %d,%d",
+ e.xbutton.button, e.xbutton.x, e.xbutton.y);
+ gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
+ "mouse-button-release",
+ e.xbutton.button,
e.xbutton.x, e.xbutton.y);
break;
case KeyPress:
e.xkey.keycode, e.xkey.x, e.xkey.y);
keysym = XKeycodeToKeysym (xvimagesink->xcontext->disp,
e.xkey.keycode, 0);
- gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
- XKeysymToString (keysym));
+ if (keysym != NoSymbol) {
+ gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
+ e.type == KeyPress ?
+ "key-press" : "key-release",
+ XKeysymToString (keysym));
+ }
+ else {
+ gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
+ e.type == KeyPress ?
+ "key-press" : "key-release",
+ "unknown");
+ }
break;
default:
GST_DEBUG ("xvimagesink unhandled X event (%d)", e.type);