mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-07 15:02:40 +00:00
gst/gstpad.override: Allow removing the negotiated pads of a cap by setting them to None.
Original commit message from CVS: reviewed by: Edward Hervey <edward@fluendo.com> * gst/gstpad.override: Allow removing the negotiated pads of a cap by setting them to None. * testsuite/test_pad.py: Added un-negotian of pads' caps to test above patch. Fixes #363795
This commit is contained in:
parent
935a94da54
commit
1856ed8de0
3 changed files with 24 additions and 4 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2007-02-04 Rene Stadler <mail@renestadler.de>
|
||||||
|
|
||||||
|
reviewed by: Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
* gst/gstpad.override:
|
||||||
|
Allow removing the negotiated pads of a cap by setting them to None.
|
||||||
|
* testsuite/test_pad.py:
|
||||||
|
Added un-negotian of pads' caps to test above patch.
|
||||||
|
Fixes #363795
|
||||||
|
|
||||||
2007-02-04 Edward Hervey <edward@fluendo.com>
|
2007-02-04 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
* gst/interfaces.override:
|
* gst/interfaces.override:
|
||||||
|
|
|
@ -1231,12 +1231,16 @@ _wrap_gst_pad_set_caps(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstPad.set_caps", kwlist, &py_caps))
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstPad.set_caps", kwlist, &py_caps))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
if (py_caps == Py_None) {
|
||||||
|
caps = NULL;
|
||||||
|
} else {
|
||||||
caps = pygst_caps_from_pyobject (py_caps, NULL);
|
caps = pygst_caps_from_pyobject (py_caps, NULL);
|
||||||
if (PyErr_Occurred())
|
if (PyErr_Occurred())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
pyg_begin_allow_threads;
|
pyg_begin_allow_threads;
|
||||||
ret = gst_pad_set_caps(GST_PAD(self->obj), caps);
|
ret = gst_pad_set_caps(GST_PAD(self->obj), caps);
|
||||||
if (ret)
|
if (ret && caps)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
pyg_end_allow_threads;
|
pyg_end_allow_threads;
|
||||||
return PyBool_FromLong(ret);
|
return PyBool_FromLong(ret);
|
||||||
|
|
|
@ -92,9 +92,11 @@ class PadPushLinkedTest(TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.assertEquals(sys.getrefcount(self.src), 3)
|
self.assertEquals(sys.getrefcount(self.src), 3)
|
||||||
self.assertEquals(self.src.__gstrefcount__, 1)
|
self.assertEquals(self.src.__gstrefcount__, 1)
|
||||||
|
self.src.set_caps(None)
|
||||||
del self.src
|
del self.src
|
||||||
self.assertEquals(sys.getrefcount(self.sink), 3)
|
self.assertEquals(sys.getrefcount(self.sink), 3)
|
||||||
self.assertEquals(self.sink.__gstrefcount__, 1)
|
self.assertEquals(self.sink.__gstrefcount__, 1)
|
||||||
|
self.sink.set_caps(None)
|
||||||
del self.sink
|
del self.sink
|
||||||
TestCase.tearDown(self)
|
TestCase.tearDown(self)
|
||||||
|
|
||||||
|
@ -171,9 +173,11 @@ class PadPushEventLinkedTest(TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.assertEquals(sys.getrefcount(self.src), 3)
|
self.assertEquals(sys.getrefcount(self.src), 3)
|
||||||
self.assertEquals(self.src.__gstrefcount__, 1)
|
self.assertEquals(self.src.__gstrefcount__, 1)
|
||||||
|
self.src.set_caps(None)
|
||||||
del self.src
|
del self.src
|
||||||
self.assertEquals(sys.getrefcount(self.sink), 3)
|
self.assertEquals(sys.getrefcount(self.sink), 3)
|
||||||
self.assertEquals(self.sink.__gstrefcount__, 1)
|
self.assertEquals(self.sink.__gstrefcount__, 1)
|
||||||
|
self.sink.set_caps(None)
|
||||||
del self.sink
|
del self.sink
|
||||||
TestCase.tearDown(self)
|
TestCase.tearDown(self)
|
||||||
|
|
||||||
|
@ -267,9 +271,11 @@ class PadPushProbeLinkTest(TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.assertEquals(sys.getrefcount(self.src), 3)
|
self.assertEquals(sys.getrefcount(self.src), 3)
|
||||||
self.assertEquals(self.src.__gstrefcount__, 1)
|
self.assertEquals(self.src.__gstrefcount__, 1)
|
||||||
|
self.src.set_caps(None)
|
||||||
del self.src
|
del self.src
|
||||||
self.assertEquals(sys.getrefcount(self.sink), 3)
|
self.assertEquals(sys.getrefcount(self.sink), 3)
|
||||||
self.assertEquals(self.sink.__gstrefcount__, 1)
|
self.assertEquals(self.sink.__gstrefcount__, 1)
|
||||||
|
self.sink.set_caps(None)
|
||||||
del self.sink
|
del self.sink
|
||||||
TestCase.tearDown(self)
|
TestCase.tearDown(self)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue