+2007-02-25 Michael Smith <msmith@fluendo.com>
+
+ * gst/pygstvalue.c: (pygst_value_init_for_pyobject),
+ (pygst_value_from_pyobject):
+ Make buffers-in-gvalues more generic: handle all miniobjects
+ * testsuite/test_caps.py:
+ Add a bit to one the test for buffers in caps.
+
2007-02-24 Michael Smith <msmith@fluendo.com>
* testsuite/test_caps.py:
static PyObject *gstfraction_class = NULL;
static PyObject *gstfractionrange_class = NULL;
-extern PyTypeObject PyGstBuffer_Type;
-
/**
* pygst_value_as_pyobject:
* @value: the GValue object.
PyErr_SetString(PyExc_TypeError, "Unexpected gst.Value instance");
return FALSE;
}
- } else if (PyObject_IsInstance (obj, (PyObject *)&PyGstBuffer_Type)) {
+ } else if (PyObject_IsInstance (obj, (PyObject *)&PyGstMiniObject_Type)) {
PyErr_Clear ();
- t = GST_TYPE_BUFFER;
+ t = GST_TYPE_MINI_OBJECT;
} else if (PyTuple_Check (obj)) {
PyErr_Clear ();
t = GST_TYPE_ARRAY;
return -1;
}
return 0;
- } else if (PyObject_IsInstance (obj, (PyObject *)&PyGstBuffer_Type)) {
- VALUE_TYPE_CHECK (value, GST_TYPE_BUFFER);
- gst_value_set_buffer (value, pygstminiobject_get(obj));
+ } else if (PyObject_IsInstance (obj, (PyObject *)&PyGstMiniObject_Type)) {
+ VALUE_TYPE_CHECK (value, GST_TYPE_MINI_OBJECT);
+ gst_value_set_mini_object (value, pygstminiobject_get(obj));
return 0;
} else if (PyTuple_Check (obj)) {
gint i, len;
def testCapsContainingMiniObjects(self):
# buffer contains hex encoding of ascii 'abcd'
caps = gst.Caps("video/x-raw-yuv, buf=(buffer)61626364")
- assert isinstance(caps[0]['buf'], gst.Buffer)
+ buf = caps[0]['buf']
+ assert isinstance(buf, gst.Buffer)
+ assert buf.data == "abcd"
buf = gst.Buffer("1234")
caps[0]['buf2'] = buf
buf2 = caps[0]['buf2']
assert buf2 == buf
-
def testCapsConstructEmpty(self):
caps = gst.Caps()
assert isinstance(caps, gst.Caps)