gstreamer/bindings/python/rtspserver.override

53 lines
1.1 KiB
Text
Raw Normal View History

2009-01-08 13:57:55 +00:00
/* -*- Mode: C; c-basic-offset: 4 -*- */
%%
headers
/* include any required headers here */
#define NO_IMPORT_PYGOBJECT
#include <pygobject.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/* Boonky define that allows for backwards compatibility with Python 2.4 */
#if PY_VERSION_HEX < 0x02050000
#define Py_ssize_t int
#endif
2009-01-24 13:34:35 +00:00
#include <gst/rtsp-server/rtsp-server.h>
2009-01-08 13:57:55 +00:00
typedef struct {
PyObject_HEAD
GMainContext *context;
} PyGMainContext;
%%
import gobject.GObject as PyGObject_Type
import gobject.MainContext as PyGMainContext_Type
%%
override gst_rtsp_server_attach kwargs
static PyObject *
_wrap_gst_rtsp_server_attach (PyGObject *self,
PyObject *args, PyObject *keywords)
{
static char *kwlist[] = {"context", NULL};
PyGMainContext *py_context = NULL;
GMainContext *context = NULL;
guint res;
if (!PyArg_ParseTupleAndKeywords (args, keywords,
"|O!:GstRTSPServer.__init__", kwlist,
&PyGMainContext_Type, &py_context))
return NULL;
if (py_context)
context = py_context->context;
pyg_begin_allow_threads;
res = gst_rtsp_server_attach (GST_RTSP_SERVER (self->obj), context);
pyg_end_allow_threads;
return PyLong_FromLong (res);
}