summaryrefslogtreecommitdiff
path: root/gst/gstevent.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-04-29 11:23:51 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-04-29 11:23:51 +0000
commitcf45b883495b4e1953af276c53b457483ecd9982 (patch)
tree60781ee62919d72e6bce702da0e23d7a9d22b3a0 /gst/gstevent.c
parent18c5c020d33da32e5e0b3be45444fd0149db2ac3 (diff)
Add method to conveniently check the name of a custom event with gst_event_has_name().
Original commit message from CVS: * docs/gst/gstreamer-sections.txt: * gst/gstevent.c: (gst_event_has_name): * gst/gstevent.h: * tests/check/gst/gstevent.c: (GST_START_TEST): Add method to conveniently check the name of a custom event with gst_event_has_name(). Reformat the event docs so that related methods are put together instead of the default alphabetical sort. Update unit test with new method. API: GstEvent::gst_event_has_name()
Diffstat (limited to 'gst/gstevent.c')
-rw-r--r--gst/gstevent.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gst/gstevent.c b/gst/gstevent.c
index 8ba71b0ad..adf8835ec 100644
--- a/gst/gstevent.c
+++ b/gst/gstevent.c
@@ -355,6 +355,29 @@ gst_event_get_structure (GstEvent * event)
}
/**
+ * gst_event_has_name:
+ * @event: The #GstEvent.
+ * @name: name to check
+ *
+ * Checks if @event has the given @name. This function is usually used to
+ * check the name of a custom event.
+ *
+ * Returns: %TRUE if @name matches the name of the event structure.
+ *
+ * Since: 0.10.20
+ */
+gboolean
+gst_event_has_name (GstEvent * event, const gchar * name)
+{
+ g_return_val_if_fail (GST_IS_EVENT (event), FALSE);
+
+ if (event->structure == NULL)
+ return FALSE;
+
+ return gst_structure_has_name (event->structure, name);
+}
+
+/**
* gst_event_new_flush_start:
*
* Allocate a new flush start event. The flush start event can be sent