Commit e6ef7347 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

sys/xvimage/xvimagesink.c: Check whether peer pad exists before sending navigation events to it.

Original commit message from CVS:
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Check whether peer pad exists before sending navigation events
to it.
parent 0928b25a
2005-11-11 Tim-Philipp Müller <tim at centricular dot net>
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Check whether peer pad exists before sending navigation events
to it.
2005-11-11 Michael Smith <msmith@fluendo.com>
 
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_setup),
......
......@@ -1710,25 +1710,33 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
GstStructure * structure)
{
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (navigation);
GstEvent *event;
double x, y;
GstPad *peer;
event = gst_event_new_custom (GST_EVENT_NAVIGATION, structure);
if ((peer = gst_pad_get_peer (GST_VIDEO_SINK_PAD (xvimagesink)))) {
GstEvent *event;
gdouble x, y, xscale = 1.0, yscale = 1.0;
/* Converting pointer coordinates to the non scaled geometry */
if (gst_structure_get_double (structure, "pointer_x", &x)) {
x *= GST_VIDEO_SINK_WIDTH (xvimagesink);
x /= xvimagesink->xwindow->width;
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, x, NULL);
}
if (gst_structure_get_double (structure, "pointer_y", &y)) {
y *= GST_VIDEO_SINK_HEIGHT (xvimagesink);
y /= xvimagesink->xwindow->height;
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, y, NULL);
}
event = gst_event_new_custom (GST_EVENT_NAVIGATION, structure);
if (xvimagesink->xwindow) {
xscale = GST_VIDEO_SINK_WIDTH (xvimagesink) / xvimagesink->xwindow->width;
yscale =
GST_VIDEO_SINK_HEIGHT (xvimagesink) / xvimagesink->xwindow->height;
}
gst_pad_send_event (gst_pad_get_peer (GST_VIDEO_SINK_PAD (xvimagesink)),
event);
/* Converting pointer coordinates to the non scaled geometry */
if (gst_structure_get_double (structure, "pointer_x", &x)) {
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE,
(gdouble) x * xscale, NULL);
}
if (gst_structure_get_double (structure, "pointer_y", &y)) {
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE,
(gdouble) y * yscale, NULL);
}
gst_pad_send_event (peer, event);
gst_object_unref (peer);
}
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment