From b45c206647f669d60c6e23cb03acb1c14882b9a3 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 17 Mar 2012 11:45:39 -0700 Subject: [PATCH] element-templates: chain query/event functions Chain up to parent class. This fix should be done to all of the templates. --- tools/element-templates/basesrc | 16 ++++++++++++++-- tools/element-templates/element | 12 +++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tools/element-templates/basesrc b/tools/element-templates/basesrc index 0b7e56f..1be325a 100644 --- a/tools/element-templates/basesrc +++ b/tools/element-templates/basesrc @@ -161,10 +161,16 @@ static gboolean gst_replace_event (GstBaseSrc * src, GstEvent * event) { GstReplace *replace = GST_REPLACE (src); + gboolean ret; GST_DEBUG_OBJECT (replace, "event"); - return TRUE; + switch (GST_EVENT_TYPE (event)) { + default: + ret = GST_BASE_SRC_CLASS (parent_class)->event (src, event); + } + + return ret; } static GstFlowReturn @@ -192,10 +198,16 @@ static gboolean gst_replace_query (GstBaseSrc * src, GstQuery * query) { GstReplace *replace = GST_REPLACE (src); + gboolean ret; GST_DEBUG_OBJECT (replace, "query"); - return TRUE; + switch (GST_QUERY_TYPE (query)) { + default: + ret = GST_BASE_SRC_CLASS (parent_class)->query (src, query); + } + + return ret; } static gboolean diff --git a/tools/element-templates/element b/tools/element-templates/element index ed025ee..f0d76eb 100644 --- a/tools/element-templates/element +++ b/tools/element-templates/element @@ -123,7 +123,17 @@ gst_replace_send_event (GstElement * element, GstEvent * event) static gboolean gst_replace_query (GstElement * element, GstQuery * query) { + GstReplace *replace = GST_REPLACE (element); + gboolean ret; - return FALSE; + GST_DEBUG_OBJECT (replace, "query"); + + switch (GST_QUERY_TYPE (query)) { + default: + ret = GST_ELEMENT_CLASS (parent_class)->query (element, query); + break; + } + + return ret; } % end -- 2.7.4