diff --git a/subprojects/gst-plugins-base/ext/gl/gstglvideomixer.c b/subprojects/gst-plugins-base/ext/gl/gstglvideomixer.c index 9c3bbe50e4..1f1eb5ee34 100644 --- a/subprojects/gst-plugins-base/ext/gl/gstglvideomixer.c +++ b/subprojects/gst-plugins-base/ext/gl/gstglvideomixer.c @@ -1722,23 +1722,25 @@ src_pad_mouse_event (GstElement * element, GstPad * pad, gpointer user_data) { GstGLVideoMixer *mix = GST_GL_VIDEO_MIXER (element); GstGLVideoMixerPad *mix_pad = GST_GL_VIDEO_MIXER_PAD (pad); - GstCaps *caps = gst_pad_get_current_caps (pad); - GstStructure *event_st, *caps_st; - gint par_n = 1, par_d = 1; + GstVideoAggregatorPad *vagg_pad = GST_VIDEO_AGGREGATOR_PAD (mix_pad); + GstStructure *event_st; gdouble event_x, event_y; GstVideoRectangle rect; + if (!vagg_pad->info.finfo + || vagg_pad->info.finfo->format == GST_VIDEO_FORMAT_UNKNOWN) { + GST_DEBUG_OBJECT (mix_pad, "Have no caps yet"); + return TRUE; + } + event_st = gst_structure_copy (gst_event_get_structure (GST_EVENT_CAST (user_data))); - caps_st = gst_structure_copy (gst_caps_get_structure (caps, 0)); - gst_structure_get (event_st, "pointer_x", G_TYPE_DOUBLE, &event_x, "pointer_y", G_TYPE_DOUBLE, &event_y, NULL); /* Find output rectangle of this pad */ - gst_structure_get_fraction (caps_st, "pixel-aspect-ratio", &par_n, &par_d); - _mixer_pad_get_output_size (mix, mix_pad, par_n, par_d, &(rect.w), &(rect.h), - &(rect.x), &(rect.y)); + _mixer_pad_get_output_size (mix, mix_pad, vagg_pad->info.par_n, + vagg_pad->info.par_d, &(rect.w), &(rect.h), &(rect.x), &(rect.y)); rect.x += mix_pad->xpos; rect.y += mix_pad->ypos; @@ -1759,7 +1761,6 @@ src_pad_mouse_event (GstElement * element, GstPad * pad, gpointer user_data) gst_structure_free (event_st); } - gst_structure_free (caps_st); return TRUE; }