diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-11-17 15:25:58 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-11-17 15:25:58 +0100 |
commit | 2679b9432a732f8ce35a8aa7b7c8f6a2798150e1 (patch) | |
tree | f5f3b41914771b1764449d3e3aa7621582f168a4 /gst/dvdsub | |
parent | ee240c1ac073f3f7e34c614d1dcaeb461e17b5ce (diff) |
add parent to pad functions
Diffstat (limited to 'gst/dvdsub')
-rw-r--r-- | gst/dvdsub/gstdvdsubdec.c | 32 | ||||
-rw-r--r-- | gst/dvdsub/gstdvdsubparse.c | 17 |
2 files changed, 25 insertions, 24 deletions
diff --git a/gst/dvdsub/gstdvdsubdec.c b/gst/dvdsub/gstdvdsubdec.c index 9a20dd99..1b8d830e 100644 --- a/gst/dvdsub/gstdvdsubdec.c +++ b/gst/dvdsub/gstdvdsubdec.c @@ -31,8 +31,10 @@ #define gst_dvd_sub_dec_parent_class parent_class G_DEFINE_TYPE (GstDvdSubDec, gst_dvd_sub_dec, GST_TYPE_ELEMENT); -static gboolean gst_dvd_sub_dec_src_event (GstPad * srcpad, GstEvent * event); -static GstFlowReturn gst_dvd_sub_dec_chain (GstPad * pad, GstBuffer * buf); +static gboolean gst_dvd_sub_dec_src_event (GstPad * srcpad, GstObject * parent, + GstEvent * event); +static GstFlowReturn gst_dvd_sub_dec_chain (GstPad * pad, GstObject * parent, + GstBuffer * buf); static gboolean gst_dvd_sub_dec_handle_dvd_event (GstDvdSubDec * dec, GstEvent * event); @@ -41,7 +43,8 @@ static void gst_setup_palette (GstDvdSubDec * dec); static void gst_dvd_sub_dec_merge_title (GstDvdSubDec * dec, GstVideoFrame * frame); static GstClockTime gst_dvd_sub_dec_get_event_delay (GstDvdSubDec * dec); -static gboolean gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event); +static gboolean gst_dvd_sub_dec_sink_event (GstPad * pad, GstObject * parent, + GstEvent * event); static gboolean gst_dvd_sub_dec_sink_setcaps (GstPad * pad, GstCaps * caps); static GstFlowReturn gst_send_subtitle_frame (GstDvdSubDec * dec, @@ -177,18 +180,16 @@ gst_dvd_sub_dec_finalize (GObject * gobject) } static gboolean -gst_dvd_sub_dec_src_event (GstPad * pad, GstEvent * event) +gst_dvd_sub_dec_src_event (GstPad * pad, GstObject * parent, GstEvent * event) { - GstDvdSubDec *dec = GST_DVD_SUB_DEC (gst_pad_get_parent (pad)); gboolean res = FALSE; switch (GST_EVENT_TYPE (event)) { default: - res = gst_pad_event_default (pad, event); + res = gst_pad_event_default (pad, parent, event); break; } - gst_object_unref (dec); return res; } @@ -797,14 +798,14 @@ gst_dvd_sub_dec_advance_time (GstDvdSubDec * dec, GstClockTime new_ts) } static GstFlowReturn -gst_dvd_sub_dec_chain (GstPad * pad, GstBuffer * buf) +gst_dvd_sub_dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) { GstFlowReturn ret = GST_FLOW_OK; GstDvdSubDec *dec; guint8 *data; glong size = 0; - dec = GST_DVD_SUB_DEC (GST_PAD_PARENT (pad)); + dec = GST_DVD_SUB_DEC (parent); GST_DEBUG_OBJECT (dec, "Have buffer of size %d, ts %" GST_TIME_FORMAT ", dur %" G_GINT64_FORMAT, gst_buffer_get_size (buf), @@ -938,9 +939,9 @@ beach: } static gboolean -gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event) +gst_dvd_sub_dec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) { - GstDvdSubDec *dec = GST_DVD_SUB_DEC (gst_pad_get_parent (pad)); + GstDvdSubDec *dec = GST_DVD_SUB_DEC (parent); gboolean ret = FALSE; GST_LOG_OBJECT (dec, "%s event", GST_EVENT_TYPE_NAME (event)); @@ -970,7 +971,7 @@ gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event) } } - ret = gst_pad_event_default (pad, event); + ret = gst_pad_event_default (pad, parent, event); break; } case GST_EVENT_SEGMENT: @@ -1017,7 +1018,7 @@ gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event) GST_DEBUG_OBJECT (dec, "Got newsegment, new time = %" GST_TIME_FORMAT, GST_TIME_ARGS (dec->next_ts)); - ret = gst_pad_event_default (pad, event); + ret = gst_pad_event_default (pad, parent, event); } break; } @@ -1033,15 +1034,14 @@ gst_dvd_sub_dec_sink_event (GstPad * pad, GstEvent * event) dec->have_title = FALSE; } - ret = gst_pad_event_default (pad, event); + ret = gst_pad_event_default (pad, parent, event); break; } default:{ - ret = gst_pad_event_default (pad, event); + ret = gst_pad_event_default (pad, parent, event); break; } } - gst_object_unref (dec); return ret; } diff --git a/gst/dvdsub/gstdvdsubparse.c b/gst/dvdsub/gstdvdsubparse.c index adf3a6aa..e48cc83c 100644 --- a/gst/dvdsub/gstdvdsubparse.c +++ b/gst/dvdsub/gstdvdsubparse.c @@ -44,8 +44,10 @@ static void gst_dvd_sub_parse_finalize (GObject * object); static void gst_dvd_sub_parse_reset (GstDvdSubParse * parse); -static gboolean gst_dvd_sub_parse_event (GstPad * pad, GstEvent * event); -static GstFlowReturn gst_dvd_sub_parse_chain (GstPad * pad, GstBuffer * buf); +static gboolean gst_dvd_sub_parse_event (GstPad * pad, GstObject * parent, + GstEvent * event); +static GstFlowReturn gst_dvd_sub_parse_chain (GstPad * pad, GstObject * parent, + GstBuffer * buf); static GstStateChangeReturn gst_dvd_sub_parse_change_state (GstElement * element, GstStateChange transition); @@ -121,12 +123,12 @@ gst_dvd_sub_parse_reset (GstDvdSubParse * parse) } static gboolean -gst_dvd_sub_parse_event (GstPad * pad, GstEvent * event) +gst_dvd_sub_parse_event (GstPad * pad, GstObject * parent, GstEvent * event) { GstDvdSubParse *parse; gboolean ret; - parse = GST_DVD_SUB_PARSE (gst_pad_get_parent (pad)); + parse = GST_DVD_SUB_PARSE (parent); switch GST_EVENT_TYPE (event) { @@ -134,19 +136,18 @@ gst_dvd_sub_parse_event (GstPad * pad, GstEvent * event) gst_dvd_sub_parse_reset (parse); /* fall-through */ default: - ret = gst_pad_event_default (pad, event); + ret = gst_pad_event_default (pad, parent, event); break; } - gst_object_unref (parse); return ret; } static GstFlowReturn -gst_dvd_sub_parse_chain (GstPad * pad, GstBuffer * buf) +gst_dvd_sub_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) { - GstDvdSubParse *parse = GST_DVD_SUB_PARSE (GST_PAD_PARENT (pad)); + GstDvdSubParse *parse = GST_DVD_SUB_PARSE (parent); GstAdapter *adapter; GstBuffer *outbuf = NULL; GstFlowReturn ret = GST_FLOW_OK; |