+2005-07-31 Tim-Philipp Müller <tim at centricular dot net>
+
+ * gst/gstpad.h:
+ Fix inline docs for GstPadLinkReturn.
+
+ * gst/gststructure.c: (gst_structure_has_name):
+ * gst/gststructure.h:
+ * docs/gst/gstreamer-sections.txt:
+ New API: gst_structure_has_name().
+
2005-07-30 Tim-Philipp Müller <tim at centricular dot net>
* configure.ac:
gst_structure_copy
gst_structure_free
gst_structure_get_name
+gst_structure_has_name
gst_structure_set_name
gst_structure_get_name_id
gst_structure_id_get_value
/**
* GstPadLinkReturn:
- * #GST_PAD_LINK_OK : link ok
- * #GST_PAD_LINK_WRONG_HIERARCHY: pads have no common grandparent
- * #GST_PAD_LINK_WAS_LINKED : pad was already linked
- * #GST_PAD_LINK_WRONG_DIRECTION: pads have wrong direction
- * #GST_PAD_LINK_NOFORMAT : pads do not have common format
- * #GST_PAD_LINK_NOSCHED : pads cannot cooperate in scheduling
- * #GST_PAD_LINK_REFUSED : refused for some reason
+ * @GST_PAD_LINK_OK : link ok
+ * @GST_PAD_LINK_WRONG_HIERARCHY: pads have no common grandparent
+ * @GST_PAD_LINK_WAS_LINKED : pad was already linked
+ * @GST_PAD_LINK_WRONG_DIRECTION: pads have wrong direction
+ * @GST_PAD_LINK_NOFORMAT : pads do not have common format
+ * @GST_PAD_LINK_NOSCHED : pads cannot cooperate in scheduling
+ * @GST_PAD_LINK_REFUSED : refused for some reason
*/
typedef enum {
GST_PAD_LINK_OK = 0,
}
/**
- * gst_structure_get_name:
+ * gst_structure_has_name:
+ * @structure: a #GstStructure
+ * @name: structure name to check for
+ *
+ * Returns: TRUE if @name matches the name of the structure.
+ */
+gboolean
+gst_structure_has_name (const GstStructure * structure, const gchar * name)
+{
+ const gchar *structure_name;
+
+ g_return_val_if_fail (structure != NULL, FALSE);
+ g_return_val_if_fail (name != NULL, FALSE);
+
+ structure_name = g_quark_to_string (structure->name);
+
+ return (structure_name && strcmp (structure_name, name) == 0);
+}
+
+/**
+ * gst_structure_get_name_id:
* @structure: a #GstStructure
*
* Accessor fuction.
G_CONST_RETURN gchar * gst_structure_get_name (const GstStructure *structure);
GQuark gst_structure_get_name_id (const GstStructure *structure);
+gboolean gst_structure_has_name (const GstStructure *structure,
+ const gchar *name);
void gst_structure_set_name (GstStructure *structure,
const gchar *name);