gstreamer/testsuite/testhelpermodule.c
Edward Hervey 32dbfea730 Remove old documentation system
Original commit message from CVS:
* README-docs:
* configure.ac:
* Makefile.am:
Remove old documentation system
* gst/gst.defs:
* gst/gst-types.defs:
Updating defs files
* gst/gst.override:
Wrapped gst_flow_get_name() for const-gchar *
* gst/gstelement.override:
I really should test everything on 32 AND 64 bits systems...
* gst/gstevent.override:
Updated gst_event_new_seek() wrapper
Added gst_event_get_structure() wrapper
* gst/gstmodule.c:
Changed definition of gst.CLOCK_TIME_NONE to wrap GST_CLOCK_TIME_NONE
* testsuite/testhelpermodule.c:
gst_event_new --> gst_event_new_custom
2005-08-01 09:59:55 +00:00

54 lines
1 KiB
C

#include <glib-object.h>
#include <gst/gst.h>
#include "pygobject.h"
#include "test-object.h"
static PyObject *
_wrap_get_object (PyObject * self)
{
GObject *obj;
obj = g_object_new (TEST_TYPE_OBJECT, NULL);
if (!obj) {
return NULL;
}
return pygobject_new(obj);
}
static PyObject *
_wrap_emit_event (PyObject * self, PyObject *args)
{
PyGObject *obj;
GstEventType event_type = GST_EVENT_UNKNOWN;
GstEvent *event;
if (!PyArg_ParseTuple(args, "O|i", &obj, &event_type))
return NULL;
event = gst_event_new_custom(event_type, NULL);
g_signal_emit_by_name(G_OBJECT(obj->obj), "event", event);
Py_INCREF(Py_None);
return Py_None;
}
static PyMethodDef testhelper_methods[] = {
{ "get_object", (PyCFunction)_wrap_get_object, METH_NOARGS },
{ "emit_event", (PyCFunction)_wrap_emit_event, METH_VARARGS },
{ NULL, NULL }
};
void
inittesthelper ()
{
PyObject *m, *d;
init_pygobject();
gst_init(NULL, NULL);
m = Py_InitModule ("testhelper", testhelper_methods);
d = PyModule_GetDict(m);
}