gst/gst.*: Probes are gone...

Original commit message from CVS:
* gst/gst.defs:
* gst/gst.override:
Probes are gone...
* Makefile.am:
* configure.ac:
* gst/Makefile.am:
* pygst.py.in:
Modifications to have parallel-installable gst-python
Works more or less in the same way as pygtk:
import pygst
pygst.require('0.9')
import gst
This commit is contained in:
Edward Hervey 2005-07-01 16:32:09 +00:00
parent f3ec338b76
commit fa5105c9f6
3 changed files with 23 additions and 222 deletions

View file

@ -1,5 +1,9 @@
2005-07-01 Edward Hervey <edward@fluendo.com>
* gst/gst.defs:
* gst/gst.override:
Probes are gone...
* Makefile.am:
* configure.ac:
* gst/Makefile.am:

View file

@ -3620,97 +3620,6 @@
(return-type "const-gchar*")
)
;; From ../gstreamer/gst/gstprobe.h
(define-function gst_probe_get_type
(c-name "gst_probe_get_type")
(return-type "GType")
)
(define-function gst_probe_new
(c-name "gst_probe_new")
(is-constructor-of "GstProbe")
(return-type "GstProbe*")
(parameters
'("gboolean" "single_shot")
'("GstProbeCallback" "callback")
'("gpointer" "user_data")
)
)
(define-method destroy
(of-object "GstProbe")
(c-name "gst_probe_destroy")
(return-type "none")
)
(define-method perform
(of-object "GstProbe")
(c-name "gst_probe_perform")
(return-type "gboolean")
(parameters
'("GstMiniObject**" "data")
)
)
(define-function probe_dispatcher_new
(c-name "gst_probe_dispatcher_new")
(is-constructor-of "GstProbeDispatcher")
(return-type "GstProbeDispatcher*")
)
(define-method destroy
(of-object "GstProbeDispatcher")
(c-name "gst_probe_dispatcher_destroy")
(return-type "none")
)
(define-method init
(of-object "GstProbeDispatcher")
(c-name "gst_probe_dispatcher_init")
(return-type "none")
)
(define-method set_active
(of-object "GstProbeDispatcher")
(c-name "gst_probe_dispatcher_set_active")
(return-type "none")
(parameters
'("gboolean" "active")
)
)
(define-method add_probe
(of-object "GstProbeDispatcher")
(c-name "gst_probe_dispatcher_add_probe")
(return-type "none")
(parameters
'("GstProbe*" "probe")
)
)
(define-method remove_probe
(of-object "GstProbeDispatcher")
(c-name "gst_probe_dispatcher_remove_probe")
(return-type "none")
(parameters
'("GstProbe*" "probe")
)
)
(define-method dispatch
(of-object "GstProbeDispatcher")
(c-name "gst_probe_dispatcher_dispatch")
(return-type "gboolean")
(parameters
'("GstMiniObject**" "data")
)
)
;; From ../gstreamer/gst/gstquery.h
(define-function gst_query_get_type
@ -5685,6 +5594,25 @@
)
)
(define-method can_src_caps
(of-object "GstElementFactory")
(c-name "gst_element_factory_can_src_caps")
(return-type "gboolean")
(parameters
'("const-GstCaps*" "caps")
)
)
(define-method can_sink_caps
(of-object "GstElementFactory")
(c-name "gst_element_factory_can_sink_caps")
(return-type "gboolean")
(parameters
'("const-GstCaps*" "caps")
)
)
(define-method query_position
(of-object "GstElement")
(c-name "gst_element_query_position")

View file

@ -38,7 +38,6 @@ headers
#include <gst/gsttypefind.h>
#include <gst/gsttag.h>
#include <gst/gsttaginterface.h>
#include <gst/gstprobe.h>
#include "pygstvalue.h"
#include "pygstminiobject.h"
@ -843,136 +842,6 @@ _wrap_gst_tag_setter_get_list(PyGObject *self)
/* pyg_boxed_new handles NULL checking */
return pyg_boxed_new(GST_TYPE_TAG_LIST, ret, TRUE, TRUE);
}
%%
override gst_probe_new args
static gboolean
probe_handler_marshal(GstProbe *probe, GstData **data, gpointer user_data)
{
PyGILState_STATE state;
PyObject *callback, *args;
PyObject *ret;
PyObject *py_data;
PyObject *py_user_data;
gboolean res;
gint len, i;
g_return_val_if_fail(user_data != NULL, FALSE);
state = pyg_gil_state_ensure();
py_user_data = (PyObject *) user_data;
if (GST_IS_BUFFER(*data))
py_data = pyg_boxed_new(GST_TYPE_BUFFER, *data, TRUE, TRUE);
else if (GST_IS_EVENT(*data))
py_data = pyg_boxed_new(GST_TYPE_EVENT, *data, TRUE, TRUE);
else
py_data = pyg_boxed_new(GST_TYPE_DATA, *data, TRUE, TRUE);
callback = PyTuple_GetItem(py_user_data, 0);
args = Py_BuildValue("(NN)",
pyg_boxed_new(GST_TYPE_PROBE, probe, TRUE, TRUE),
py_data);
len = PyTuple_Size(py_user_data);
for (i = 1; i < len; ++i) {
PyObject *tuple = args;
args = PySequence_Concat(tuple, PyTuple_GetItem(py_user_data, i));
Py_DECREF(tuple);
}
ret = PyObject_CallObject(callback, args);
if (!ret) {
PyErr_Print();
res = FALSE;
} else {
res = PyObject_IsTrue(ret);
Py_DECREF(ret);
}
Py_DECREF(args);
pyg_gil_state_release(state);
return res;
}
static int
_wrap_gst_probe_new(PyGBoxed *self, PyObject *args, PyObject *kwargs)
{
PyObject *first, *callback, *cbargs = NULL, *data;
gboolean single_shot;
gint len;
len = PyTuple_Size(args);
self->gtype = GST_TYPE_PROBE;
self->free_on_dealloc = FALSE;
if (len < 2) {
PyErr_SetString(PyExc_TypeError,
"Probe requires at least 2 args");
return -1;
}
first = PySequence_GetSlice(args, 0, 2);
if (!PyArg_ParseTuple(first, "iO:Probe", &single_shot, &callback)) {
Py_DECREF(first);
return -1;
}
Py_DECREF(first);
if (!PyCallable_Check(callback)) {
PyErr_SetString(PyExc_TypeError, "second argument not callable");
return -1;
}
cbargs = PySequence_GetSlice(args, 2, len);
if (cbargs == NULL)
return -1;
data = Py_BuildValue("(ON)", callback, cbargs);
if (data == NULL)
return -1;
self->boxed = gst_probe_new(single_shot, probe_handler_marshal, data);
return 0;
}
%%
override gst_probe_perform object
static PyObject *
_wrap_gst_probe_perform(PyGBoxed *self, PyObject *args, PyObject *kwargs)
{
PyObject *py_data;
GstData *data = NULL;
gint len;
len = PyTuple_Size(args);
if (len != 1) {
PyErr_SetString(PyExc_TypeError,
"perform requires 1 arg");
return NULL;
}
if (!PyArg_ParseTuple(args, "O:perform", &py_data)) {
return NULL;
}
/* FIXME: GstBuffer and GstEvent are not really "subclasses" so
we hardcode checks for them here by hand. Ugh. */
if (pyg_boxed_check(py_data, GST_TYPE_EVENT))
data = GST_DATA(pyg_boxed_get(py_data, GstEvent));
if (pyg_boxed_check(py_data, GST_TYPE_BUFFER))
data = GST_DATA(pyg_boxed_get(py_data, GstBuffer));
if (pyg_boxed_check(py_data, GST_TYPE_DATA))
data = pyg_boxed_get(py_data, GstData);
if (!data) {
PyErr_SetString(PyExc_TypeError, "arg 1 must be GstData");
return NULL;
}
return PyBool_FromLong(gst_probe_perform(self->boxed, &data));
}
%%
override gst_plugin_get_version noargs
static PyObject *