g_mutex_unlock (_gst_props_entries_chunk_lock);
}
-static GstProps*
-gst_props_alloc (void)
+/**
+ * gst_props_empty_new:
+ *
+ * Create a new empty property.
+ *
+ * Returns: the new property
+ */
+GstProps*
+gst_props_empty_new (void)
{
GstProps *props;
return props;
}
-static void
+/**
+ * gst_props_add_entry:
+ * @props: the property to add the entry to
+ * @entry: the entry to add
+ *
+ * Addes the given propsentry to the props
+ */
+void
gst_props_add_entry (GstProps *props, GstPropsEntry *entry)
{
g_return_if_fail (props);
return g_list_prepend (entries, newentry);
}
+static GstPropsEntry*
+gst_props_entry_newv (const gchar *name, va_list var_args)
+{
+ GstPropsEntry *entry;
+
+ entry = gst_props_alloc_entry ();
+ entry->propid = g_quark_from_string (name);
+ GST_PROPS_ENTRY_FILL (entry, var_args);
+
+ return entry;
+}
+
+/**
+ * gst_props_entry_new:
+ * @name: the name of the props entry
+ * @...: the value of the entry
+ *
+ * Create a new property entry with the given key/value.
+ *
+ * Returns: the new entry.
+ */
+GstPropsEntry*
+gst_props_entry_new (const gchar *name, ...)
+{
+ va_list var_args;
+ GstPropsEntry *entry;
+
+ va_start (var_args, name);
+ entry = gst_props_entry_newv (name, var_args);
+ va_end (var_args);
+
+ return entry;
+}
+
/**
* gst_props_newv:
* @firstname: the first property name
if (firstname == NULL)
return NULL;
- props = gst_props_alloc ();
+ props = gst_props_empty_new ();
prop_name = firstname;
GQuark quark;
GList *lentry;
va_list var_args;
+
+ g_return_val_if_fail (props != NULL, NULL);
quark = g_quark_from_string (name);
return props;
}
+
/**
* gst_props_unref:
* @props: the props to unref
if (props == NULL)
return NULL;
- new = gst_props_alloc ();
+ new = gst_props_empty_new ();
new->properties = gst_props_list_copy (props->properties);
new->fixed = props->fixed;
GList *leftovers;
GstPropsEntry *iprops = NULL;
- intersection = gst_props_alloc ();
+ intersection = gst_props_empty_new ();
intersection->fixed = TRUE;
g_return_val_if_fail (props1 != NULL, NULL);
GstProps *newprops;
GList *lentry;
- newprops = gst_props_alloc ();
+ newprops = gst_props_empty_new ();
newprops->properties = gst_props_list_copy (props->properties);
lentry = g_list_find_custom (newprops->properties, GINT_TO_POINTER (list_entry->propid), props_find_func);
if (lentry) {
xmlNodePtr field = parent->xmlChildrenNode;
gchar *prop;
- props = gst_props_alloc ();
+ props = gst_props_empty_new ();
while (field) {
if (!strcmp (field->name, "list")) {
GstProps* gst_props_new (const gchar *firstname, ...);
GstProps* gst_props_newv (const gchar *firstname, va_list var_args);
+GstProps* gst_props_empty_new (void);
void gst_props_unref (GstProps *props);
void gst_props_ref (GstProps *props);
gboolean gst_props_has_property_typed (GstProps *props, const gchar *name, GstPropsType type);
gboolean gst_props_has_fixed_property (GstProps *props, const gchar *name);
+const GstPropsEntry* gst_props_get_entry (GstProps *props, const gchar *name);
+void gst_props_add_entry (GstProps *props, GstPropsEntry *entry);
/* working with props entries */
-const GstPropsEntry* gst_props_get_entry (GstProps *props, const gchar *name);
+GstPropsEntry* gst_props_entry_new (const gchar *name, ...);
+
GstPropsType gst_props_entry_get_type (const GstPropsEntry *entry);
const gchar* gst_props_entry_get_name (const GstPropsEntry *entry);
gboolean gst_props_entry_is_fixed (const GstPropsEntry *entry);