diff --git a/ChangeLog b/ChangeLog index 87e1ec042b..744721e663 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2004-01-07 Jan Schmidt + + * 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 * ext/shout/gstshout.c: (gst_icecastsend_base_init), diff --git a/gst-libs/gst/interfaces/navigation.c b/gst-libs/gst/interfaces/navigation.c index feb84dfa8f..e3333cbad3 100644 --- a/gst-libs/gst/interfaces/navigation.c +++ b/gst-libs/gst/interfaces/navigation.c @@ -71,19 +71,23 @@ gst_navigation_send_event (GstNavigation *navigation, GstStructure *structure) } 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)); } diff --git a/gst-libs/gst/interfaces/navigation.h b/gst-libs/gst/interfaces/navigation.h index faa5b809f7..5ccaf74898 100644 --- a/gst-libs/gst/interfaces/navigation.h +++ b/gst-libs/gst/interfaces/navigation.h @@ -52,9 +52,10 @@ GType gst_navigation_get_type (void); /* 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 diff --git a/gst-libs/gst/navigation/navigation.c b/gst-libs/gst/navigation/navigation.c index feb84dfa8f..e3333cbad3 100644 --- a/gst-libs/gst/navigation/navigation.c +++ b/gst-libs/gst/navigation/navigation.c @@ -71,19 +71,23 @@ gst_navigation_send_event (GstNavigation *navigation, GstStructure *structure) } 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)); } diff --git a/gst-libs/gst/navigation/navigation.h b/gst-libs/gst/navigation/navigation.h index faa5b809f7..5ccaf74898 100644 --- a/gst-libs/gst/navigation/navigation.h +++ b/gst-libs/gst/navigation/navigation.h @@ -52,9 +52,10 @@ GType gst_navigation_get_type (void); /* 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 diff --git a/gst/sine/gstsinesrc.c b/gst/sine/gstsinesrc.c index 36f7244af7..bed9ab9cd1 100644 --- a/gst/sine/gstsinesrc.c +++ b/gst/sine/gstsinesrc.c @@ -221,8 +221,10 @@ gst_sinesrc_src_fixate (GstPad *pad, const GstCaps *caps) 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; diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index f9a7fe2589..f5f8f1fb17 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -201,12 +201,10 @@ gst_videotestsrc_src_fixate (GstPad * pad, const GstCaps * caps) /* 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; diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index b9eb7504c5..e0dc80cbce 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -352,16 +352,27 @@ gst_ximagesink_handle_xevents (GstXImageSink *ximagesink, GstPad *pad) 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: - 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", 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-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 release over window at %d,%d", + e.xbutton.button, e.xbutton.x, e.xbutton.x); + gst_navigation_send_mouse_event (GST_NAVIGATION (ximagesink), + "mouse-button-release", + e.xbutton.button, + e.xbutton.x, e.xbutton.y); break; case KeyPress: case KeyRelease: @@ -371,11 +382,19 @@ gst_ximagesink_handle_xevents (GstXImageSink *ximagesink, GstPad *pad) 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); diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 27de14cd4b..7c3da91ef2 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -313,15 +313,27 @@ gst_xvimagesink_handle_xevents (GstXvImageSink *xvimagesink, GstPad *pad) 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: @@ -332,8 +344,18 @@ gst_xvimagesink_handle_xevents (GstXvImageSink *xvimagesink, GstPad *pad) 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);