static gboolean gst_element_set_clock_func (GstElement * element,
GstClock * clock);
static void gst_element_set_bus_func (GstElement * element, GstBus * bus);
+static gboolean gst_element_post_message_default (GstElement * element,
+ GstMessage * message);
+
static gboolean gst_element_default_send_event (GstElement * element,
GstEvent * event);
klass->query = GST_DEBUG_FUNCPTR (gst_element_default_query);
klass->send_event = GST_DEBUG_FUNCPTR (gst_element_default_send_event);
klass->numpadtemplates = 0;
+ klass->post_message = GST_DEBUG_FUNCPTR (gst_element_post_message_default);
klass->elementfactory = NULL;
}
return result;
}
-/**
- * gst_element_post_message:
- * @element: a #GstElement posting the message
- * @message: (transfer full): a #GstMessage to post
- *
- * Post a message on the element's #GstBus. This function takes ownership of the
- * message; if you want to access the message after this call, you should add an
- * additional reference before calling.
- *
- * Returns: %TRUE if the message was successfully posted. The function returns
- * %FALSE if the element did not have a bus.
- *
- * MT safe.
- */
-gboolean
-gst_element_post_message (GstElement * element, GstMessage * message)
+static gboolean
+gst_element_post_message_default (GstElement * element, GstMessage * message)
{
GstBus *bus;
gboolean result = FALSE;
}
/**
+ * gst_element_post_message:
+ * @element: a #GstElement posting the message
+ * @message: (transfer full): a #GstMessage to post
+ *
+ * Post a message on the element's #GstBus. This function takes ownership of the
+ * message; if you want to access the message after this call, you should add an
+ * additional reference before calling.
+ *
+ * Returns: %TRUE if the message was successfully posted. The function returns
+ * %FALSE if the element did not have a bus.
+ *
+ * MT safe.
+ */
+gboolean
+gst_element_post_message (GstElement * element, GstMessage * message)
+{
+ GstElementClass *klass;
+
+ g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
+
+ klass = GST_ELEMENT_GET_CLASS (element);
+ if (klass->post_message)
+ return klass->post_message (element, message);
+
+ return FALSE;
+}
+
+/**
* _gst_element_error_printf:
* @format: the printf-like format to use, or %NULL
*
* @send_event: send a #GstEvent to the element
* @query: perform a #GstQuery on the element
* @state_changed: called immediately after a new state was set.
+ * @post_message: called when a message is posted on the element. Chain up to
+ * the parent class' handler to have it posted on the bus.
*
* GStreamer element class. Override the vmethods to implement the element
* functionality.
gboolean (*query) (GstElement *element, GstQuery *query);
+ gboolean (*post_message) (GstElement *element, GstMessage *message);
+
/*< private >*/
- gpointer _gst_reserved[GST_PADDING_LARGE];
+ gpointer _gst_reserved[GST_PADDING_LARGE-1];
};
/* element class pad templates */