+ if (!(pdo = g_try_malloc(sizeof(struct srd_pd_output)))) {
+ PyErr_SetString(PyExc_MemoryError, "struct srd_pd_output");
+ return NULL;
+ }
+
+ /* pdo_id is just a simple index, nothing is deleted from this list anyway. */
+ pdo->pdo_id = g_slist_length(di->pd_output);
+ pdo->output_type = output_type;
+ pdo->di = di;
+ pdo->proto_id = g_strdup(proto_id);
+
+ if (output_type == SRD_OUTPUT_META) {
+ pdo->meta_type = meta_type_gv;
+ pdo->meta_name = g_strdup(meta_name);
+ pdo->meta_descr = g_strdup(meta_descr);
+ }
+
+ di->pd_output = g_slist_append(di->pd_output, pdo);
+ py_new_output_id = Py_BuildValue("i", pdo->pdo_id);
+
+ return py_new_output_id;
+}
+
+/* TODO: this is just a stub that calls _register() until all PDs
+ * are changed to use the new register API. */
+static PyObject *Decoder_add(PyObject *self, PyObject *args)
+{
+ PyObject *py_keywords, *py_new_output_id;
+
+ py_keywords = PyDict_New();
+ py_new_output_id = Decoder_register(self, args, py_keywords);
+ Py_DecRef(py_keywords);
+
+ return py_new_output_id;