ext/dv/gstdvdec.c: Fix caps negotiation.

Original commit message from CVS:
* 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 :)
This commit is contained in:
Jan Schmidt 2004-01-06 16:42:10 +00:00
parent 491381bf8c
commit b22d0599b3
9 changed files with 109 additions and 32 deletions

View file

@ -1,3 +1,29 @@
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),

View file

@ -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));
}

View file

@ -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

View file

@ -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));
}

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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);