From 56ef4054eea31e296e5894ca46ffb0a55c05c2ef Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 12 Sep 2012 15:08:01 +0200 Subject: [PATCH] dvbsuboverlay: Use default query handlers where needed And fixup getcaps handler while I'm at it --- gst/dvbsuboverlay/gstdvbsuboverlay.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gst/dvbsuboverlay/gstdvbsuboverlay.c b/gst/dvbsuboverlay/gstdvbsuboverlay.c index 3c904a4134..5a63a7a9f8 100644 --- a/gst/dvbsuboverlay/gstdvbsuboverlay.c +++ b/gst/dvbsuboverlay/gstdvbsuboverlay.c @@ -99,7 +99,8 @@ static GstStateChangeReturn gst_dvbsub_overlay_change_state (GstElement * #define gst_dvbsub_overlay_parent_class parent_class G_DEFINE_TYPE (GstDVBSubOverlay, gst_dvbsub_overlay, GST_TYPE_ELEMENT); -static GstCaps *gst_dvbsub_overlay_getcaps (GstPad * pad, GstCaps * filter); +static GstCaps *gst_dvbsub_overlay_getcaps (GstDVBSubOverlay * render, + GstPad * pad, GstCaps * filter); static GstFlowReturn gst_dvbsub_overlay_chain_video (GstPad * pad, GstObject * parent, GstBuffer * buf); @@ -368,14 +369,14 @@ gst_dvbsub_overlay_query_src (GstPad * pad, GstObject * parent, GstCaps *filter, *caps; gst_query_parse_caps (query, &filter); - caps = gst_dvbsub_overlay_getcaps (pad, filter); + caps = gst_dvbsub_overlay_getcaps (render, pad, filter); gst_query_set_caps_result (query, caps); gst_caps_unref (caps); ret = TRUE; break; } default: - ret = gst_pad_peer_query (render->video_sinkpad, query); + ret = gst_pad_query_default (pad, parent, query); break; } @@ -424,9 +425,9 @@ gst_dvbsub_overlay_event_src (GstPad * pad, GstObject * parent, } static GstCaps * -gst_dvbsub_overlay_getcaps (GstPad * pad, GstCaps * filter) +gst_dvbsub_overlay_getcaps (GstDVBSubOverlay * render, GstPad * pad, + GstCaps * filter) { - GstDVBSubOverlay *render = GST_DVBSUB_OVERLAY (gst_pad_get_parent (pad)); GstPad *otherpad; GstCaps *caps, *templ; @@ -453,8 +454,6 @@ gst_dvbsub_overlay_getcaps (GstPad * pad, GstCaps * filter) caps = templ; } - gst_object_unref (render); - return caps; } @@ -921,6 +920,7 @@ static gboolean gst_dvbsub_overlay_query_video (GstPad * pad, GstObject * parent, GstQuery * query) { + GstDVBSubOverlay *render = (GstDVBSubOverlay *) parent; gboolean ret; switch (GST_QUERY_TYPE (query)) { @@ -929,7 +929,7 @@ gst_dvbsub_overlay_query_video (GstPad * pad, GstObject * parent, GstCaps *filter, *caps; gst_query_parse_caps (query, &filter); - caps = gst_dvbsub_overlay_getcaps (pad, filter); + caps = gst_dvbsub_overlay_getcaps (render, pad, filter); gst_query_set_caps_result (query, caps); gst_caps_unref (caps); ret = TRUE;