/usr/include/gstreamer-0.10/gst/pygst.h is in python-gst0.10-dev 0.10.22-3ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | /* -*- Mode: C; ; c-file-style: "python" -*- */
/* gst-python
* Copyright (C) 2010 Edward Hervey <bilboed@bilboed.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef _PYGST_H_
#define _PYGST_H_
#include <Python.h>
#include <glib.h>
#include <glib-object.h>
#include <gst/gst.h>
G_BEGIN_DECLS
struct _PyGst_Functions {
GstCaps* (*caps_from_pyobject) (PyObject *object, gboolean *copy);
PyObject* (*iterator_new) (GstIterator *iter);
PyObject* (*miniobject_new) (GstMiniObject *obj);
};
#define pygstminiobject_get(v) (((PyGstMiniObject *)(v))->obj)
#define pygstminiobject_check(v,base) (PyObject_TypeCheck(v,base))
typedef struct {
PyObject_HEAD
GstMiniObject *obj;
PyObject *inst_dict; /* the instance dictionary -- must be last */
PyObject *weakreflist; /* list of weak references */
} PyGstMiniObject;
#ifndef _INSIDE_PYGST_
#if defined(NO_IMPORT_PYGOBJECT)
extern struct _PyGst_Functions *_PyGst_API;
#else
struct _PyGst_Functions *_PyGst_API;
#endif
#define pygst_caps_from_pyobject (_PyGst_API->caps_from_pyobject)
#define pygst_iterator_new (_PyGst_API->iterator_new)
#define pygstminiobject_new (_PyGst_API->miniobject_new)
static inline PyObject *
pygst_init(void)
{
PyObject *gstobject, *cobject;
gstobject = PyImport_ImportModule("gst._gst");
if (!gstobject) {
if (PyErr_Occurred())
{
PyObject *type, *value, *traceback;
PyObject *py_orig_exc;
PyErr_Fetch(&type, &value, &traceback);
py_orig_exc = PyObject_Repr(value);
Py_XDECREF(type);
Py_XDECREF(value);
Py_XDECREF(traceback);
PyErr_Format(PyExc_ImportError,
"could not import gst (error was: %s)",
PyString_AsString(py_orig_exc));
Py_DECREF(py_orig_exc);
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gst (no error given)");
}
return NULL;
}
cobject = PyObject_GetAttrString(gstobject, "_PyGst_API");
if (!cobject) {
PyErr_SetString(PyExc_ImportError,
"could not import gst (getting _PyGst_API)");
return NULL;
}
_PyGst_API = (struct _PyGst_Functions *) PyCObject_AsVoidPtr(cobject);
return gstobject;
}
#endif /* _INSIDE_PYGST_ */
G_END_DECLS
#endif /* !_PYGST_H_ */
|