1 /* -*- Mode: C; c-basic-offset: 4 -*- */
4 /* include any required headers here */
5 #define NO_IMPORT_PYGOBJECT
12 /* Boonky define that allows for backwards compatibility with Python 2.4 */
13 #if PY_VERSION_HEX < 0x02050000
14 #define Py_ssize_t int
17 #include <gst/rtsp-server/rtsp-server.h>
21 GMainContext *context;
25 import gobject.GObject as PyGObject_Type
26 import gobject.MainContext as PyGMainContext_Type
29 override gst_rtsp_server_attach kwargs
31 _wrap_gst_rtsp_server_attach (PyGObject *self,
32 PyObject *args, PyObject *keywords)
34 static char *kwlist[] = {"context", NULL};
35 PyGMainContext *py_context = NULL;
36 GMainContext *context = NULL;
39 if (!PyArg_ParseTupleAndKeywords (args, keywords,
40 "|O!:GstRTSPServer.__init__", kwlist,
41 &PyGMainContext_Type, &py_context))
45 context = py_context->context;
47 pyg_begin_allow_threads;
48 res = gst_rtsp_server_attach (GST_RTSP_SERVER (self->obj), context);
49 pyg_end_allow_threads;
51 return PyLong_FromLong (res);