summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2005-11-10 13:03:14 +0000
committerEdward Hervey <bilboed@bilboed.com>2005-11-10 13:03:14 +0000
commit3076c7c22ebe8cdec4e86e2ce81c1e88e27680bf (patch)
treeacac4dc041f18118b24d9fa949c1c578571036d1
parente3beb3ed78d191c78399503b8462d1acc9140b28 (diff)
gst/gsttaglist.override: put the gst.TagList.keys() method back.
Original commit message from CVS: * gst/gsttaglist.override: put the gst.TagList.keys() method back.
-rw-r--r--ChangeLog5
-rw-r--r--gst/gsttaglist.override28
2 files changed, 33 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 13cb73d..80a0be0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-11-10 Edward Hervey <edward@fluendo.com>
+ * gst/gsttaglist.override:
+ put the gst.TagList.keys() method back.
+
+2005-11-10 Edward Hervey <edward@fluendo.com>
+
* gst/gstmodule.c: (init_gst):
Added GST_TAG_* string constants
* gst/gstpad.override:
diff --git a/gst/gsttaglist.override b/gst/gsttaglist.override
index 2c0ca14..0df2706 100644
--- a/gst/gsttaglist.override
+++ b/gst/gsttaglist.override
@@ -33,6 +33,34 @@ ignore
gst_tag_list_remove_tag
gst_tag_list_foreach
%%
+define GstTagList.keys noargs
+static void
+tag_foreach_func_list (const GstTagList *list,
+ const gchar *tag,
+ PyObject *py_list)
+{
+ int count;
+
+ count = gst_tag_list_get_tag_size(GST_TAG_LIST(list), tag);
+ if (count == 0)
+ PyErr_SetString(PyExc_KeyError, tag);
+ else if (count == 1)
+ PyList_Append(py_list, PyString_FromString(tag));
+}
+
+static PyObject*
+_wrap_gst_tag_list_keys(PyGObject *self)
+{
+ PyObject *dict;
+
+ dict = PyList_New(0);
+
+ gst_tag_list_foreach(GST_TAG_LIST(self->obj),
+ (GstTagForeachFunc)tag_foreach_func_list,
+ (gpointer)dict);
+ return dict;
+}
+%%
override-slot GstTagList.tp_as_mapping
static int
_wrap_gst_tag_list_length(PyGObject *self)