mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
gst: run gst-indent all C files
We hadn't done it since the switch to git... whoops
This commit is contained in:
parent
ee647847f3
commit
ab46967800
9 changed files with 505 additions and 499 deletions
|
@ -30,29 +30,29 @@
|
|||
#include <gst/audio/gstbaseaudiosrc.h>
|
||||
#include "pygst.h"
|
||||
|
||||
void pyaudio_register_classes (PyObject *d);
|
||||
void pyaudio_add_constants(PyObject *module, const gchar *strip_prefix);
|
||||
|
||||
void pyaudio_register_classes (PyObject * d);
|
||||
void pyaudio_add_constants (PyObject * module, const gchar * strip_prefix);
|
||||
|
||||
extern PyMethodDef pyaudio_functions[];
|
||||
|
||||
GST_DEBUG_CATEGORY (pygst_debug); /* for python code */
|
||||
GST_DEBUG_CATEGORY (pygst_debug); /* for python code */
|
||||
|
||||
DL_EXPORT(void)
|
||||
DL_EXPORT (void)
|
||||
initaudio (void)
|
||||
{
|
||||
PyObject *m, *d;
|
||||
PyObject *m, *d;
|
||||
|
||||
init_pygobject ();
|
||||
pygst_init();
|
||||
init_pygobject ();
|
||||
pygst_init ();
|
||||
|
||||
m = Py_InitModule ("audio", pyaudio_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
m = Py_InitModule ("audio", pyaudio_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
|
||||
pyaudio_register_classes (d);
|
||||
pyaudio_add_constants (m, "GST_");
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.audio");
|
||||
}
|
||||
pyaudio_register_classes (d);
|
||||
pyaudio_add_constants (m, "GST_");
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.audio");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,32 +35,31 @@
|
|||
* and NULL is returned.
|
||||
*/
|
||||
GstCaps *
|
||||
pygst_caps_from_pyobject (PyObject *object, gboolean *copy)
|
||||
pygst_caps_from_pyobject (PyObject * object, gboolean * copy)
|
||||
{
|
||||
if (pyg_boxed_check(object, GST_TYPE_CAPS)) {
|
||||
GstCaps *caps = pyg_boxed_get(object, GstCaps);
|
||||
if (pyg_boxed_check (object, GST_TYPE_CAPS)) {
|
||||
GstCaps *caps = pyg_boxed_get (object, GstCaps);
|
||||
if (copy) {
|
||||
*copy = FALSE;
|
||||
return caps;
|
||||
} else {
|
||||
return gst_caps_copy (caps);
|
||||
}
|
||||
} else if (pyg_boxed_check(object, GST_TYPE_STRUCTURE)) {
|
||||
GstStructure *structure = pyg_boxed_get(object, GstStructure);
|
||||
} else if (pyg_boxed_check (object, GST_TYPE_STRUCTURE)) {
|
||||
GstStructure *structure = pyg_boxed_get (object, GstStructure);
|
||||
if (copy)
|
||||
*copy = TRUE;
|
||||
return gst_caps_new_full (gst_structure_copy (structure), NULL);
|
||||
} else if (PyString_Check (object)) {
|
||||
GstCaps *caps = gst_caps_from_string (PyString_AsString (object));
|
||||
if (!caps) {
|
||||
PyErr_SetString(PyExc_TypeError, "could not convert string to GstCaps");
|
||||
PyErr_SetString (PyExc_TypeError, "could not convert string to GstCaps");
|
||||
return NULL;
|
||||
}
|
||||
if (copy)
|
||||
*copy = TRUE;
|
||||
return caps;
|
||||
}
|
||||
PyErr_SetString(PyExc_TypeError, "could not convert to GstCaps");
|
||||
PyErr_SetString (PyExc_TypeError, "could not convert to GstCaps");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,27 +29,27 @@
|
|||
#include <gst/gst.h>
|
||||
#include "pygst.h"
|
||||
|
||||
void pyinterfaces_register_classes (PyObject *d);
|
||||
void pyinterfaces_add_constants(PyObject *module, const gchar *strip_prefix);
|
||||
|
||||
void pyinterfaces_register_classes (PyObject * d);
|
||||
void pyinterfaces_add_constants (PyObject * module, const gchar * strip_prefix);
|
||||
|
||||
extern PyMethodDef pyinterfaces_functions[];
|
||||
|
||||
DL_EXPORT(void)
|
||||
DL_EXPORT (void)
|
||||
initinterfaces (void)
|
||||
{
|
||||
PyObject *m, *d;
|
||||
PyObject *m, *d;
|
||||
|
||||
init_pygobject ();
|
||||
pygst_init();
|
||||
init_pygobject ();
|
||||
pygst_init ();
|
||||
|
||||
m = Py_InitModule ("interfaces", pyinterfaces_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
m = Py_InitModule ("interfaces", pyinterfaces_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
|
||||
pyinterfaces_register_classes (d);
|
||||
pyinterfaces_add_constants (m, "GST_");
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.interfaces");
|
||||
}
|
||||
pyinterfaces_register_classes (d);
|
||||
pyinterfaces_add_constants (m, "GST_");
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.interfaces");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,33 +28,33 @@
|
|||
#include <gst/pbutils/pbutils.h>
|
||||
#include "pygst.h"
|
||||
|
||||
void pypbutils_register_classes (PyObject *d);
|
||||
void pypbutils_add_constants(PyObject *module, const gchar *strip_prefix);
|
||||
|
||||
void pypbutils_register_classes (PyObject * d);
|
||||
void pypbutils_add_constants (PyObject * module, const gchar * strip_prefix);
|
||||
|
||||
extern PyMethodDef pypbutils_functions[];
|
||||
|
||||
GST_DEBUG_CATEGORY (pygst_debug); /* for python code */
|
||||
GST_DEBUG_CATEGORY (pygst_debug); /* for python code */
|
||||
|
||||
DL_EXPORT(void)
|
||||
DL_EXPORT (void)
|
||||
initpbutils (void)
|
||||
{
|
||||
PyObject *m, *d;
|
||||
PyObject *gst;
|
||||
PyObject *m, *d;
|
||||
PyObject *gst;
|
||||
|
||||
init_pygobject ();
|
||||
init_pygobject ();
|
||||
|
||||
/* Make sure gst module is loaded and ready */
|
||||
gst = pygst_init();
|
||||
gst_pb_utils_init ();
|
||||
|
||||
m = Py_InitModule ("pbutils", pypbutils_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
/* Make sure gst module is loaded and ready */
|
||||
gst = pygst_init ();
|
||||
gst_pb_utils_init ();
|
||||
|
||||
pypbutils_register_classes (d);
|
||||
pypbutils_add_constants (m, "GST_");
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.pbutils");
|
||||
}
|
||||
m = Py_InitModule ("pbutils", pypbutils_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
|
||||
pypbutils_register_classes (d);
|
||||
pypbutils_add_constants (m, "GST_");
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.pbutils");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,235 +33,237 @@ PyObject *PyGstExc_ElementNotFoundError = NULL;
|
|||
|
||||
|
||||
static PyObject *
|
||||
call_exception_init(PyObject *args)
|
||||
call_exception_init (PyObject * args)
|
||||
{
|
||||
PyObject *parent_init = NULL;
|
||||
PyObject *res = NULL;
|
||||
PyObject *parent_init = NULL;
|
||||
PyObject *res = NULL;
|
||||
|
||||
/* get Exception.__init__ */
|
||||
parent_init = PyObject_GetAttrString(PyExc_Exception, "__init__");
|
||||
if (parent_init == NULL)
|
||||
goto exception;
|
||||
|
||||
/* call Exception.__init__. This will set self.args */
|
||||
res = PyObject_CallObject(parent_init, args);
|
||||
if (res == NULL)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF(parent_init);
|
||||
|
||||
return res;
|
||||
/* get Exception.__init__ */
|
||||
parent_init = PyObject_GetAttrString (PyExc_Exception, "__init__");
|
||||
if (parent_init == NULL)
|
||||
goto exception;
|
||||
|
||||
/* call Exception.__init__. This will set self.args */
|
||||
res = PyObject_CallObject (parent_init, args);
|
||||
if (res == NULL)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF (parent_init);
|
||||
|
||||
return res;
|
||||
|
||||
exception:
|
||||
Py_XDECREF(parent_init);
|
||||
Py_XDECREF(res);
|
||||
|
||||
return NULL;
|
||||
Py_XDECREF (parent_init);
|
||||
Py_XDECREF (res);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
add_method(PyObject *klass, PyObject *dict, PyMethodDef *method) {
|
||||
PyObject *module = NULL;
|
||||
PyObject *func = NULL;
|
||||
PyObject *meth = NULL;
|
||||
add_method (PyObject * klass, PyObject * dict, PyMethodDef * method)
|
||||
{
|
||||
PyObject *module = NULL;
|
||||
PyObject *func = NULL;
|
||||
PyObject *meth = NULL;
|
||||
|
||||
module = PyString_FromString ("gst");
|
||||
if (module == NULL)
|
||||
goto exception;
|
||||
|
||||
func = PyCFunction_NewEx (method, NULL, module);
|
||||
if (func == NULL)
|
||||
goto exception;
|
||||
Py_DECREF (module);
|
||||
|
||||
meth = PyMethod_New (func, NULL, klass);
|
||||
if (meth == NULL)
|
||||
goto exception;
|
||||
Py_DECREF (func);
|
||||
|
||||
if (PyDict_SetItemString (dict, method->ml_name, meth) < 0)
|
||||
goto exception;
|
||||
Py_DECREF (meth);
|
||||
|
||||
return 0;
|
||||
|
||||
module = PyString_FromString("gst");
|
||||
if (module == NULL)
|
||||
goto exception;
|
||||
|
||||
func = PyCFunction_NewEx(method, NULL, module);
|
||||
if (func == NULL)
|
||||
goto exception;
|
||||
Py_DECREF(module);
|
||||
|
||||
meth = PyMethod_New(func, NULL, klass);
|
||||
if (meth == NULL)
|
||||
goto exception;
|
||||
Py_DECREF(func);
|
||||
|
||||
if (PyDict_SetItemString(dict, method->ml_name, meth) < 0)
|
||||
goto exception;
|
||||
Py_DECREF(meth);
|
||||
|
||||
return 0;
|
||||
|
||||
exception:
|
||||
Py_XDECREF(module);
|
||||
Py_XDECREF(func);
|
||||
Py_XDECREF(meth);
|
||||
Py_XDECREF (module);
|
||||
Py_XDECREF (func);
|
||||
Py_XDECREF (meth);
|
||||
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
link_error_init(PyObject *self, PyObject *args)
|
||||
link_error_init (PyObject * self, PyObject * args)
|
||||
{
|
||||
PyObject *err_type = NULL;
|
||||
int status;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O|O:__init__", &self, &err_type))
|
||||
return NULL;
|
||||
|
||||
if (err_type == NULL)
|
||||
err_type = Py_None;
|
||||
Py_INCREF(err_type);
|
||||
|
||||
/* set self.error */
|
||||
status = PyObject_SetAttrString(self, "error", err_type);
|
||||
Py_DECREF(err_type);
|
||||
if (status < 0)
|
||||
return NULL;
|
||||
|
||||
return call_exception_init(args);
|
||||
PyObject *err_type = NULL;
|
||||
int status;
|
||||
|
||||
if (!PyArg_ParseTuple (args, "O|O:__init__", &self, &err_type))
|
||||
return NULL;
|
||||
|
||||
if (err_type == NULL)
|
||||
err_type = Py_None;
|
||||
Py_INCREF (err_type);
|
||||
|
||||
/* set self.error */
|
||||
status = PyObject_SetAttrString (self, "error", err_type);
|
||||
Py_DECREF (err_type);
|
||||
if (status < 0)
|
||||
return NULL;
|
||||
|
||||
return call_exception_init (args);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
element_not_found_error_init(PyObject *self, PyObject *args)
|
||||
element_not_found_error_init (PyObject * self, PyObject * args)
|
||||
{
|
||||
PyObject *element_name = NULL;
|
||||
int status;
|
||||
PyObject *element_name = NULL;
|
||||
int status;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O|O:__init__", &self, &element_name))
|
||||
return NULL;
|
||||
if (!PyArg_ParseTuple (args, "O|O:__init__", &self, &element_name))
|
||||
return NULL;
|
||||
|
||||
if (element_name == NULL)
|
||||
element_name = Py_None;
|
||||
Py_INCREF(element_name);
|
||||
|
||||
/* set self.name */
|
||||
status = PyObject_SetAttrString(self, "name", element_name);
|
||||
Py_DECREF(element_name);
|
||||
if (status < 0)
|
||||
return NULL;
|
||||
if (element_name == NULL)
|
||||
element_name = Py_None;
|
||||
Py_INCREF (element_name);
|
||||
|
||||
return call_exception_init(args);
|
||||
/* set self.name */
|
||||
status = PyObject_SetAttrString (self, "name", element_name);
|
||||
Py_DECREF (element_name);
|
||||
if (status < 0)
|
||||
return NULL;
|
||||
|
||||
return call_exception_init (args);
|
||||
}
|
||||
|
||||
static PyMethodDef link_error_init_method = {"__init__",
|
||||
link_error_init, METH_VARARGS
|
||||
static PyMethodDef link_error_init_method = { "__init__",
|
||||
link_error_init, METH_VARARGS
|
||||
};
|
||||
|
||||
static PyMethodDef element_not_found_error_init_method = {"__init__",
|
||||
element_not_found_error_init, METH_VARARGS
|
||||
static PyMethodDef element_not_found_error_init_method = { "__init__",
|
||||
element_not_found_error_init, METH_VARARGS
|
||||
};
|
||||
|
||||
void
|
||||
pygst_exceptions_register_classes(PyObject *d)
|
||||
pygst_exceptions_register_classes (PyObject * d)
|
||||
{
|
||||
PyObject *dict = NULL;
|
||||
|
||||
/* register gst.LinkError */
|
||||
dict = PyDict_New();
|
||||
if (dict == NULL)
|
||||
goto exception;
|
||||
|
||||
PyGstExc_LinkError = PyErr_NewException("gst.LinkError",
|
||||
PyExc_Exception, dict);
|
||||
if (PyGstExc_LinkError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (add_method(PyGstExc_LinkError, dict, &link_error_init_method) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF(dict);
|
||||
|
||||
if (PyDict_SetItemString(d, "LinkError", PyGstExc_LinkError) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF(PyGstExc_LinkError);
|
||||
|
||||
/* register gst.AddError */
|
||||
PyGstExc_AddError = PyErr_NewException("gst.AddError",
|
||||
PyExc_Exception, NULL);
|
||||
if (PyGstExc_AddError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (PyDict_SetItemString(d, "AddError", PyGstExc_AddError) < 0)
|
||||
goto exception;
|
||||
PyObject *dict = NULL;
|
||||
|
||||
Py_DECREF(PyGstExc_AddError);
|
||||
|
||||
/* register gst.RemoveError */
|
||||
PyGstExc_RemoveError = PyErr_NewException("gst.RemoveError",
|
||||
PyExc_Exception, NULL);
|
||||
if (PyGstExc_RemoveError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (PyDict_SetItemString(d, "RemoveError", PyGstExc_RemoveError) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF(PyGstExc_RemoveError);
|
||||
/* register gst.LinkError */
|
||||
dict = PyDict_New ();
|
||||
if (dict == NULL)
|
||||
goto exception;
|
||||
|
||||
PyGstExc_LinkError = PyErr_NewException ("gst.LinkError",
|
||||
PyExc_Exception, dict);
|
||||
if (PyGstExc_LinkError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (add_method (PyGstExc_LinkError, dict, &link_error_init_method) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF (dict);
|
||||
|
||||
if (PyDict_SetItemString (d, "LinkError", PyGstExc_LinkError) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF (PyGstExc_LinkError);
|
||||
|
||||
/* register gst.AddError */
|
||||
PyGstExc_AddError = PyErr_NewException ("gst.AddError",
|
||||
PyExc_Exception, NULL);
|
||||
if (PyGstExc_AddError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (PyDict_SetItemString (d, "AddError", PyGstExc_AddError) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF (PyGstExc_AddError);
|
||||
|
||||
/* register gst.RemoveError */
|
||||
PyGstExc_RemoveError = PyErr_NewException ("gst.RemoveError",
|
||||
PyExc_Exception, NULL);
|
||||
if (PyGstExc_RemoveError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (PyDict_SetItemString (d, "RemoveError", PyGstExc_RemoveError) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF (PyGstExc_RemoveError);
|
||||
|
||||
/* register gst.QueryError */
|
||||
PyGstExc_QueryError = PyErr_NewException ("gst.QueryError",
|
||||
PyExc_Exception, NULL);
|
||||
if (PyGstExc_QueryError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (PyDict_SetItemString (d, "QueryError", PyGstExc_QueryError) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF (PyGstExc_QueryError);
|
||||
|
||||
/* register gst.QueryError */
|
||||
PyGstExc_QueryError = PyErr_NewException("gst.QueryError",
|
||||
PyExc_Exception, NULL);
|
||||
if (PyGstExc_QueryError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (PyDict_SetItemString(d, "QueryError", PyGstExc_QueryError) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF(PyGstExc_QueryError);
|
||||
|
||||
/* FIXME: remove this method in 0.11; element_factory_make deals with element
|
||||
factories, not plug-ins */
|
||||
|
||||
/* register gst.PluginNotFoundError */
|
||||
dict = PyDict_New();
|
||||
if (dict == NULL)
|
||||
goto exception;
|
||||
|
||||
PyGstExc_PluginNotFoundError = \
|
||||
PyErr_NewException("gst.PluginNotFoundError", PyExc_Exception, dict);
|
||||
if (PyGstExc_PluginNotFoundError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (add_method(PyGstExc_PluginNotFoundError,
|
||||
dict, &element_not_found_error_init_method) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF(dict);
|
||||
|
||||
if (PyDict_SetItemString(d, "PluginNotFoundError",
|
||||
PyGstExc_PluginNotFoundError) < 0)
|
||||
goto exception;
|
||||
/* register gst.PluginNotFoundError */
|
||||
dict = PyDict_New ();
|
||||
if (dict == NULL)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF(PyGstExc_PluginNotFoundError);
|
||||
PyGstExc_PluginNotFoundError =
|
||||
PyErr_NewException ("gst.PluginNotFoundError", PyExc_Exception, dict);
|
||||
if (PyGstExc_PluginNotFoundError == NULL)
|
||||
goto exception;
|
||||
|
||||
/* register gst.ElementNotFoundError */
|
||||
dict = PyDict_New();
|
||||
if (dict == NULL)
|
||||
goto exception;
|
||||
|
||||
PyGstExc_ElementNotFoundError = \
|
||||
PyErr_NewException("gst.ElementNotFoundError", PyGstExc_PluginNotFoundError, dict);
|
||||
if (PyGstExc_ElementNotFoundError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (add_method(PyGstExc_ElementNotFoundError,
|
||||
dict, &element_not_found_error_init_method) < 0)
|
||||
goto exception;
|
||||
if (add_method (PyGstExc_PluginNotFoundError,
|
||||
dict, &element_not_found_error_init_method) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF(dict);
|
||||
|
||||
if (PyDict_SetItemString(d, "ElementNotFoundError",
|
||||
PyGstExc_ElementNotFoundError) < 0)
|
||||
goto exception;
|
||||
Py_DECREF (dict);
|
||||
|
||||
if (PyDict_SetItemString (d, "PluginNotFoundError",
|
||||
PyGstExc_PluginNotFoundError) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF (PyGstExc_PluginNotFoundError);
|
||||
|
||||
/* register gst.ElementNotFoundError */
|
||||
dict = PyDict_New ();
|
||||
if (dict == NULL)
|
||||
goto exception;
|
||||
|
||||
PyGstExc_ElementNotFoundError =
|
||||
PyErr_NewException ("gst.ElementNotFoundError",
|
||||
PyGstExc_PluginNotFoundError, dict);
|
||||
if (PyGstExc_ElementNotFoundError == NULL)
|
||||
goto exception;
|
||||
|
||||
if (add_method (PyGstExc_ElementNotFoundError,
|
||||
dict, &element_not_found_error_init_method) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF (dict);
|
||||
|
||||
if (PyDict_SetItemString (d, "ElementNotFoundError",
|
||||
PyGstExc_ElementNotFoundError) < 0)
|
||||
goto exception;
|
||||
|
||||
Py_DECREF (PyGstExc_ElementNotFoundError);
|
||||
|
||||
return;
|
||||
|
||||
return;
|
||||
|
||||
Py_DECREF(PyGstExc_ElementNotFoundError);
|
||||
|
||||
return;
|
||||
|
||||
return;
|
||||
|
||||
exception:
|
||||
Py_XDECREF(dict);
|
||||
Py_XDECREF(PyGstExc_LinkError);
|
||||
Py_XDECREF(PyGstExc_AddError);
|
||||
Py_XDECREF(PyGstExc_RemoveError);
|
||||
Py_XDECREF(PyGstExc_QueryError);
|
||||
Py_XDECREF(PyGstExc_PluginNotFoundError);
|
||||
Py_XDECREF(PyGstExc_ElementNotFoundError);
|
||||
Py_XDECREF (dict);
|
||||
Py_XDECREF (PyGstExc_LinkError);
|
||||
Py_XDECREF (PyGstExc_AddError);
|
||||
Py_XDECREF (PyGstExc_RemoveError);
|
||||
Py_XDECREF (PyGstExc_QueryError);
|
||||
Py_XDECREF (PyGstExc_PluginNotFoundError);
|
||||
Py_XDECREF (PyGstExc_ElementNotFoundError);
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -148,8 +148,8 @@ pygst_iterator_new (GstIterator * iter)
|
|||
PyGstIterator *self;
|
||||
|
||||
if (iter == NULL) {
|
||||
PyErr_SetString (PyExc_TypeError, "Invalid GstIterator (NULL)");
|
||||
return NULL;
|
||||
PyErr_SetString (PyExc_TypeError, "Invalid GstIterator (NULL)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
self = PyObject_NEW (PyGstIterator, &PyGstIterator_Type);
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
#include "pygstminiobject.h"
|
||||
#include <gst/gst.h>
|
||||
|
||||
static const gchar pygstminiobject_class_id[] = "PyGstMiniObject::class";
|
||||
static GQuark pygstminiobject_class_key = 0;
|
||||
static const gchar pygstminiobject_class_id[] = "PyGstMiniObject::class";
|
||||
static GQuark pygstminiobject_class_key = 0;
|
||||
/* static const gchar pygstminiobject_wrapper_id[] = "PyGstMiniObject::wrapper"; */
|
||||
/* static GQuark pygstminiobject_wrapper_key = 0; */
|
||||
|
||||
static void pygstminiobject_dealloc(PyGstMiniObject *self);
|
||||
static void pygstminiobject_dealloc (PyGstMiniObject * self);
|
||||
/* static int pygstminiobject_traverse(PyGstMiniObject *self, visitproc visit, void *arg); */
|
||||
/* static int pygstminiobject_clear(PyGstMiniObject *self); */
|
||||
|
||||
|
@ -49,19 +49,19 @@ GST_DEBUG_CATEGORY_EXTERN (pygst_debug);
|
|||
* GType has no registered type and a new type couldn't be created
|
||||
*/
|
||||
PyTypeObject *
|
||||
pygstminiobject_lookup_class(GType gtype)
|
||||
pygstminiobject_lookup_class (GType gtype)
|
||||
{
|
||||
PyTypeObject *py_type = NULL;
|
||||
GType ctype = gtype;
|
||||
PyTypeObject *py_type = NULL;
|
||||
GType ctype = gtype;
|
||||
|
||||
while (!py_type && ctype) {
|
||||
py_type = g_type_get_qdata(ctype, pygstminiobject_class_key);
|
||||
ctype = g_type_parent(ctype);
|
||||
}
|
||||
if (!ctype)
|
||||
g_error ("Couldn't find a good base type!!");
|
||||
|
||||
return py_type;
|
||||
while (!py_type && ctype) {
|
||||
py_type = g_type_get_qdata (ctype, pygstminiobject_class_key);
|
||||
ctype = g_type_parent (ctype);
|
||||
}
|
||||
if (!ctype)
|
||||
g_error ("Couldn't find a good base type!!");
|
||||
|
||||
return py_type;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,49 +78,49 @@ pygstminiobject_lookup_class(GType gtype)
|
|||
* which simplifies initialisation.
|
||||
*/
|
||||
void
|
||||
pygstminiobject_register_class(PyObject *dict, const gchar *type_name,
|
||||
GType gtype, PyTypeObject *type,
|
||||
PyObject *bases)
|
||||
pygstminiobject_register_class (PyObject * dict, const gchar * type_name,
|
||||
GType gtype, PyTypeObject * type, PyObject * bases)
|
||||
{
|
||||
PyObject *o;
|
||||
const char *class_name, *s;
|
||||
PyObject *o;
|
||||
const char *class_name, *s;
|
||||
|
||||
if (!pygstminiobject_class_key)
|
||||
pygstminiobject_class_key = g_quark_from_static_string(pygstminiobject_class_id);
|
||||
if (!pygstminiobject_class_key)
|
||||
pygstminiobject_class_key =
|
||||
g_quark_from_static_string (pygstminiobject_class_id);
|
||||
|
||||
class_name = type->tp_name;
|
||||
s = strrchr(class_name, '.');
|
||||
if (s != NULL)
|
||||
class_name = s + 1;
|
||||
|
||||
type->ob_type = &PyType_Type;
|
||||
type->tp_alloc = PyType_GenericAlloc;
|
||||
type->tp_new = PyType_GenericNew;
|
||||
if (bases) {
|
||||
type->tp_bases = bases;
|
||||
type->tp_base = (PyTypeObject *)PyTuple_GetItem(bases, 0);
|
||||
}
|
||||
class_name = type->tp_name;
|
||||
s = strrchr (class_name, '.');
|
||||
if (s != NULL)
|
||||
class_name = s + 1;
|
||||
|
||||
if (PyType_Ready(type) < 0) {
|
||||
g_warning ("couldn't make the type `%s' ready", type->tp_name);
|
||||
return;
|
||||
}
|
||||
type->ob_type = &PyType_Type;
|
||||
type->tp_alloc = PyType_GenericAlloc;
|
||||
type->tp_new = PyType_GenericNew;
|
||||
if (bases) {
|
||||
type->tp_bases = bases;
|
||||
type->tp_base = (PyTypeObject *) PyTuple_GetItem (bases, 0);
|
||||
}
|
||||
|
||||
if (gtype) {
|
||||
o = pyg_type_wrapper_new(gtype);
|
||||
PyDict_SetItemString(type->tp_dict, "__gtype__", o);
|
||||
Py_DECREF(o);
|
||||
if (PyType_Ready (type) < 0) {
|
||||
g_warning ("couldn't make the type `%s' ready", type->tp_name);
|
||||
return;
|
||||
}
|
||||
|
||||
/* stash a pointer to the python class with the GType */
|
||||
Py_INCREF(type);
|
||||
g_type_set_qdata(gtype, pygstminiobject_class_key, type);
|
||||
}
|
||||
if (gtype) {
|
||||
o = pyg_type_wrapper_new (gtype);
|
||||
PyDict_SetItemString (type->tp_dict, "__gtype__", o);
|
||||
Py_DECREF (o);
|
||||
|
||||
PyDict_SetItemString(dict, (char *)class_name, (PyObject *)type);
|
||||
/* stash a pointer to the python class with the GType */
|
||||
Py_INCREF (type);
|
||||
g_type_set_qdata (gtype, pygstminiobject_class_key, type);
|
||||
}
|
||||
|
||||
PyDict_SetItemString (dict, (char *) class_name, (PyObject *) type);
|
||||
}
|
||||
|
||||
void
|
||||
pygstminiobject_register_wrapper (PyObject *self)
|
||||
pygstminiobject_register_wrapper (PyObject * self)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -135,239 +135,244 @@ pygstminiobject_register_wrapper (PyObject *self)
|
|||
* Returns: a reference to the wrapper for the GstMiniObject.
|
||||
*/
|
||||
PyObject *
|
||||
pygstminiobject_new (GstMiniObject *obj)
|
||||
pygstminiobject_new (GstMiniObject * obj)
|
||||
{
|
||||
PyGstMiniObject *self = NULL;
|
||||
PyGILState_STATE state;
|
||||
PyTypeObject *tp = NULL;
|
||||
PyGstMiniObject *self = NULL;
|
||||
PyGILState_STATE state;
|
||||
PyTypeObject *tp = NULL;
|
||||
|
||||
if (obj == NULL) {
|
||||
Py_INCREF (Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
if (obj == NULL) {
|
||||
Py_INCREF (Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
/* since mini objects cannot notify us when they get destroyed, we
|
||||
* can't use a global hash to map GMO to PyO, and have to create a new
|
||||
* Python object every time we see it */
|
||||
tp = pygstminiobject_lookup_class (G_OBJECT_TYPE (obj));
|
||||
GST_DEBUG ("have to create wrapper for object %p", obj);
|
||||
if (!tp)
|
||||
g_warning ("Couldn't get class for type object : %p", obj);
|
||||
if (tp->tp_flags & Py_TPFLAGS_HEAPTYPE) {
|
||||
GST_INFO ("Increment refcount %p", tp);
|
||||
Py_INCREF (tp);
|
||||
}
|
||||
state = pyg_gil_state_ensure();
|
||||
self = PyObject_New (PyGstMiniObject, tp);
|
||||
pyg_gil_state_release(state);
|
||||
/* since mini objects cannot notify us when they get destroyed, we
|
||||
* can't use a global hash to map GMO to PyO, and have to create a new
|
||||
* Python object every time we see it */
|
||||
tp = pygstminiobject_lookup_class (G_OBJECT_TYPE (obj));
|
||||
GST_DEBUG ("have to create wrapper for object %p", obj);
|
||||
if (!tp)
|
||||
g_warning ("Couldn't get class for type object : %p", obj);
|
||||
if (tp->tp_flags & Py_TPFLAGS_HEAPTYPE) {
|
||||
GST_INFO ("Increment refcount %p", tp);
|
||||
Py_INCREF (tp);
|
||||
}
|
||||
state = pyg_gil_state_ensure ();
|
||||
self = PyObject_New (PyGstMiniObject, tp);
|
||||
pyg_gil_state_release (state);
|
||||
|
||||
if (self == NULL)
|
||||
return NULL;
|
||||
self->obj = gst_mini_object_ref (obj);
|
||||
if (self == NULL)
|
||||
return NULL;
|
||||
self->obj = gst_mini_object_ref (obj);
|
||||
|
||||
self->inst_dict = NULL;
|
||||
self->weakreflist = NULL;
|
||||
self->inst_dict = NULL;
|
||||
self->weakreflist = NULL;
|
||||
|
||||
GST_DEBUG ("created Python object %p for GstMiniObject %p [ref:%d]",
|
||||
self, obj, GST_MINI_OBJECT_REFCOUNT_VALUE (obj));
|
||||
return (PyObject *) self;
|
||||
GST_DEBUG ("created Python object %p for GstMiniObject %p [ref:%d]",
|
||||
self, obj, GST_MINI_OBJECT_REFCOUNT_VALUE (obj));
|
||||
return (PyObject *) self;
|
||||
}
|
||||
|
||||
static void
|
||||
pygstminiobject_dealloc(PyGstMiniObject *self)
|
||||
pygstminiobject_dealloc (PyGstMiniObject * self)
|
||||
{
|
||||
PyGILState_STATE state;
|
||||
PyGILState_STATE state;
|
||||
|
||||
g_return_if_fail (self != NULL);
|
||||
g_return_if_fail (self != NULL);
|
||||
|
||||
GST_DEBUG ("At the beginning %p", self);
|
||||
state = pyg_gil_state_ensure();
|
||||
GST_DEBUG ("At the beginning %p", self);
|
||||
state = pyg_gil_state_ensure ();
|
||||
|
||||
if (self->obj) {
|
||||
GST_DEBUG ("PyO %p unreffing GstMiniObject %p [ref:%d]", self,
|
||||
self->obj, GST_MINI_OBJECT_REFCOUNT_VALUE (self->obj));
|
||||
gst_mini_object_unref(self->obj);
|
||||
GST_DEBUG ("setting self %p -> obj to NULL", self);
|
||||
self->obj = NULL;
|
||||
}
|
||||
if (self->obj) {
|
||||
GST_DEBUG ("PyO %p unreffing GstMiniObject %p [ref:%d]", self,
|
||||
self->obj, GST_MINI_OBJECT_REFCOUNT_VALUE (self->obj));
|
||||
gst_mini_object_unref (self->obj);
|
||||
GST_DEBUG ("setting self %p -> obj to NULL", self);
|
||||
self->obj = NULL;
|
||||
}
|
||||
|
||||
if (self->inst_dict) {
|
||||
Py_DECREF(self->inst_dict);
|
||||
self->inst_dict = NULL;
|
||||
}
|
||||
if (self->inst_dict) {
|
||||
Py_DECREF (self->inst_dict);
|
||||
self->inst_dict = NULL;
|
||||
}
|
||||
|
||||
self->ob_type->tp_free((PyObject *) self);
|
||||
pyg_gil_state_release(state);
|
||||
GST_DEBUG ("At the end %p", self);
|
||||
self->ob_type->tp_free ((PyObject *) self);
|
||||
pyg_gil_state_release (state);
|
||||
GST_DEBUG ("At the end %p", self);
|
||||
}
|
||||
|
||||
static int
|
||||
pygstminiobject_compare(PyGstMiniObject *self, PyGstMiniObject *v)
|
||||
pygstminiobject_compare (PyGstMiniObject * self, PyGstMiniObject * v)
|
||||
{
|
||||
if (self->obj == v->obj) return 0;
|
||||
if (self->obj > v->obj) return -1;
|
||||
return 1;
|
||||
if (self->obj == v->obj)
|
||||
return 0;
|
||||
if (self->obj > v->obj)
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static long
|
||||
pygstminiobject_hash(PyGstMiniObject *self)
|
||||
pygstminiobject_hash (PyGstMiniObject * self)
|
||||
{
|
||||
return (long)self->obj;
|
||||
return (long) self->obj;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
pygstminiobject_repr(PyGstMiniObject *self)
|
||||
pygstminiobject_repr (PyGstMiniObject * self)
|
||||
{
|
||||
gchar buf[256];
|
||||
gchar buf[256];
|
||||
|
||||
g_snprintf(buf, sizeof(buf),
|
||||
"<%s mini-object (%s) at 0x%lx>",
|
||||
self->ob_type->tp_name,
|
||||
self->obj ? G_OBJECT_TYPE_NAME(self->obj) : "uninitialized",
|
||||
(long)self);
|
||||
return PyString_FromString(buf);
|
||||
g_snprintf (buf, sizeof (buf),
|
||||
"<%s mini-object (%s) at 0x%lx>",
|
||||
self->ob_type->tp_name,
|
||||
self->obj ? G_OBJECT_TYPE_NAME (self->obj) : "uninitialized",
|
||||
(long) self);
|
||||
return PyString_FromString (buf);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
pygstminiobject_free(PyObject *op)
|
||||
pygstminiobject_free (PyObject * op)
|
||||
{
|
||||
PyObject_FREE(op);
|
||||
PyObject_FREE (op);
|
||||
}
|
||||
|
||||
|
||||
/* ---------------- PyGstMiniObject methods ----------------- */
|
||||
|
||||
static int
|
||||
pygstminiobject_init(PyGstMiniObject *self, PyObject *args, PyObject *kwargs)
|
||||
pygstminiobject_init (PyGstMiniObject * self, PyObject * args,
|
||||
PyObject * kwargs)
|
||||
{
|
||||
GType object_type;
|
||||
GstMiniObjectClass *class;
|
||||
GType object_type;
|
||||
GstMiniObjectClass *class;
|
||||
|
||||
if (!PyArg_ParseTuple(args, ":GstMiniObject.__init__", &object_type))
|
||||
return -1;
|
||||
if (!PyArg_ParseTuple (args, ":GstMiniObject.__init__", &object_type))
|
||||
return -1;
|
||||
|
||||
object_type = pyg_type_from_object((PyObject *)self);
|
||||
if (!object_type)
|
||||
return -1;
|
||||
object_type = pyg_type_from_object ((PyObject *) self);
|
||||
if (!object_type)
|
||||
return -1;
|
||||
|
||||
if (G_TYPE_IS_ABSTRACT(object_type)) {
|
||||
PyErr_Format(PyExc_TypeError, "cannot create instance of abstract "
|
||||
"(non-instantiable) type `%s'", g_type_name(object_type));
|
||||
return -1;
|
||||
}
|
||||
if (G_TYPE_IS_ABSTRACT (object_type)) {
|
||||
PyErr_Format (PyExc_TypeError, "cannot create instance of abstract "
|
||||
"(non-instantiable) type `%s'", g_type_name (object_type));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((class = g_type_class_ref (object_type)) == NULL) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"could not get a reference to type class");
|
||||
return -1;
|
||||
}
|
||||
if ((class = g_type_class_ref (object_type)) == NULL) {
|
||||
PyErr_SetString (PyExc_TypeError,
|
||||
"could not get a reference to type class");
|
||||
return -1;
|
||||
}
|
||||
|
||||
self->obj = gst_mini_object_new(object_type);
|
||||
if (self->obj == NULL)
|
||||
PyErr_SetString (PyExc_RuntimeError, "could not create object");
|
||||
|
||||
g_type_class_unref(class);
|
||||
|
||||
return (self->obj) ? 0 : -1;
|
||||
self->obj = gst_mini_object_new (object_type);
|
||||
if (self->obj == NULL)
|
||||
PyErr_SetString (PyExc_RuntimeError, "could not create object");
|
||||
|
||||
g_type_class_unref (class);
|
||||
|
||||
return (self->obj) ? 0 : -1;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
pygstminiobject__gstminiobject_init__(PyGstMiniObject *self, PyObject *args, PyObject *kwargs)
|
||||
pygstminiobject__gstminiobject_init__ (PyGstMiniObject * self, PyObject * args,
|
||||
PyObject * kwargs)
|
||||
{
|
||||
if (pygstminiobject_init(self, args, kwargs) < 0)
|
||||
return NULL;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
if (pygstminiobject_init (self, args, kwargs) < 0)
|
||||
return NULL;
|
||||
Py_INCREF (Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
pygstminiobject_copy(PyGstMiniObject *self, PyObject *args)
|
||||
pygstminiobject_copy (PyGstMiniObject * self, PyObject * args)
|
||||
{
|
||||
return pygstminiobject_new(gst_mini_object_copy(self->obj));
|
||||
return pygstminiobject_new (gst_mini_object_copy (self->obj));
|
||||
}
|
||||
|
||||
static PyMethodDef pygstminiobject_methods[] = {
|
||||
{ "__gstminiobject_init__", (PyCFunction)pygstminiobject__gstminiobject_init__,
|
||||
METH_VARARGS|METH_KEYWORDS },
|
||||
{ "copy", (PyCFunction)pygstminiobject_copy, METH_VARARGS, "Copies the miniobject"},
|
||||
{ NULL, NULL, 0 }
|
||||
{"__gstminiobject_init__",
|
||||
(PyCFunction) pygstminiobject__gstminiobject_init__,
|
||||
METH_VARARGS | METH_KEYWORDS},
|
||||
{"copy", (PyCFunction) pygstminiobject_copy, METH_VARARGS,
|
||||
"Copies the miniobject"},
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
static PyObject *
|
||||
pygstminiobject_get_dict(PyGstMiniObject *self, void *closure)
|
||||
pygstminiobject_get_dict (PyGstMiniObject * self, void *closure)
|
||||
{
|
||||
if (self->inst_dict == NULL) {
|
||||
self->inst_dict = PyDict_New();
|
||||
if (self->inst_dict == NULL)
|
||||
return NULL;
|
||||
}
|
||||
Py_INCREF(self->inst_dict);
|
||||
return self->inst_dict;
|
||||
if (self->inst_dict == NULL) {
|
||||
self->inst_dict = PyDict_New ();
|
||||
if (self->inst_dict == NULL)
|
||||
return NULL;
|
||||
}
|
||||
Py_INCREF (self->inst_dict);
|
||||
return self->inst_dict;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
pygstminiobject_get_refcount(PyGstMiniObject *self, void *closure)
|
||||
pygstminiobject_get_refcount (PyGstMiniObject * self, void *closure)
|
||||
{
|
||||
return PyInt_FromLong(GST_MINI_OBJECT_REFCOUNT_VALUE(self->obj));
|
||||
return PyInt_FromLong (GST_MINI_OBJECT_REFCOUNT_VALUE (self->obj));
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
pygstminiobject_get_flags(PyGstMiniObject *self, void *closure)
|
||||
pygstminiobject_get_flags (PyGstMiniObject * self, void *closure)
|
||||
{
|
||||
return PyInt_FromLong(GST_MINI_OBJECT_FLAGS(self->obj));
|
||||
return PyInt_FromLong (GST_MINI_OBJECT_FLAGS (self->obj));
|
||||
}
|
||||
|
||||
static PyGetSetDef pygstminiobject_getsets[] = {
|
||||
{ "__dict__", (getter)pygstminiobject_get_dict, (setter)0 },
|
||||
{ "__grefcount__", (getter)pygstminiobject_get_refcount, (setter)0, },
|
||||
{ "flags", (getter)pygstminiobject_get_flags, (setter)0, },
|
||||
{ NULL, 0, 0 }
|
||||
{"__dict__", (getter) pygstminiobject_get_dict, (setter) 0},
|
||||
{"__grefcount__", (getter) pygstminiobject_get_refcount, (setter) 0,},
|
||||
{"flags", (getter) pygstminiobject_get_flags, (setter) 0,},
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
|
||||
PyTypeObject PyGstMiniObject_Type = {
|
||||
PyObject_HEAD_INIT(NULL)
|
||||
0, /* ob_size */
|
||||
"gst.MiniObject", /* tp_name */
|
||||
sizeof(PyGstMiniObject), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
/* methods */
|
||||
(destructor)pygstminiobject_dealloc, /* tp_dealloc */
|
||||
(printfunc)0, /* tp_print */
|
||||
(getattrfunc)0, /* tp_getattr */
|
||||
(setattrfunc)0, /* tp_setattr */
|
||||
(cmpfunc)pygstminiobject_compare, /* tp_compare */
|
||||
(reprfunc)pygstminiobject_repr, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
(hashfunc)pygstminiobject_hash, /* tp_hash */
|
||||
(ternaryfunc)0, /* tp_call */
|
||||
(reprfunc)0, /* tp_str */
|
||||
(getattrofunc)0, /* tp_getattro */
|
||||
(setattrofunc)0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
NULL, /* Documentation string */
|
||||
(traverseproc)0, /* tp_traverse */
|
||||
(inquiry)0, /* tp_clear */
|
||||
(richcmpfunc)0, /* tp_richcompare */
|
||||
offsetof(PyGstMiniObject, weakreflist), /* tp_weaklistoffset */
|
||||
(getiterfunc)0, /* tp_iter */
|
||||
(iternextfunc)0, /* tp_iternext */
|
||||
pygstminiobject_methods, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
pygstminiobject_getsets, /* tp_getset */
|
||||
(PyTypeObject *)0, /* tp_base */
|
||||
(PyObject *)0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
offsetof(PyGstMiniObject, inst_dict), /* tp_dictoffset */
|
||||
(initproc)pygstminiobject_init, /* tp_init */
|
||||
(allocfunc)0, /* tp_alloc */
|
||||
(newfunc)0, /* tp_new */
|
||||
(freefunc)pygstminiobject_free, /* tp_free */
|
||||
(inquiry)0, /* tp_is_gc */
|
||||
(PyObject *)0, /* tp_bases */
|
||||
PyObject_HEAD_INIT (NULL)
|
||||
0, /* ob_size */
|
||||
"gst.MiniObject", /* tp_name */
|
||||
sizeof (PyGstMiniObject), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
/* methods */
|
||||
(destructor) pygstminiobject_dealloc, /* tp_dealloc */
|
||||
(printfunc) 0, /* tp_print */
|
||||
(getattrfunc) 0, /* tp_getattr */
|
||||
(setattrfunc) 0, /* tp_setattr */
|
||||
(cmpfunc) pygstminiobject_compare, /* tp_compare */
|
||||
(reprfunc) pygstminiobject_repr, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
(hashfunc) pygstminiobject_hash, /* tp_hash */
|
||||
(ternaryfunc) 0, /* tp_call */
|
||||
(reprfunc) 0, /* tp_str */
|
||||
(getattrofunc) 0, /* tp_getattro */
|
||||
(setattrofunc) 0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
NULL, /* Documentation string */
|
||||
(traverseproc) 0, /* tp_traverse */
|
||||
(inquiry) 0, /* tp_clear */
|
||||
(richcmpfunc) 0, /* tp_richcompare */
|
||||
offsetof (PyGstMiniObject, weakreflist), /* tp_weaklistoffset */
|
||||
(getiterfunc) 0, /* tp_iter */
|
||||
(iternextfunc) 0, /* tp_iternext */
|
||||
pygstminiobject_methods, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
pygstminiobject_getsets, /* tp_getset */
|
||||
(PyTypeObject *) 0, /* tp_base */
|
||||
(PyObject *) 0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
offsetof (PyGstMiniObject, inst_dict), /* tp_dictoffset */
|
||||
(initproc) pygstminiobject_init, /* tp_init */
|
||||
(allocfunc) 0, /* tp_alloc */
|
||||
(newfunc) 0, /* tp_new */
|
||||
(freefunc) pygstminiobject_free, /* tp_free */
|
||||
(inquiry) 0, /* tp_is_gc */
|
||||
(PyObject *) 0, /* tp_bases */
|
||||
};
|
||||
|
||||
|
|
|
@ -28,31 +28,31 @@
|
|||
#include <gst/tag/tag.h>
|
||||
#include "pygst.h"
|
||||
|
||||
void pytag_register_classes (PyObject *d);
|
||||
void pytag_add_constants(PyObject *module, const gchar *strip_prefix);
|
||||
|
||||
void pytag_register_classes (PyObject * d);
|
||||
void pytag_add_constants (PyObject * module, const gchar * strip_prefix);
|
||||
|
||||
extern PyMethodDef pytag_functions[];
|
||||
|
||||
GST_DEBUG_CATEGORY (pygst_debug); /* for python code */
|
||||
GST_DEBUG_CATEGORY (pygst_debug); /* for python code */
|
||||
|
||||
DL_EXPORT(void)
|
||||
DL_EXPORT (void)
|
||||
inittag (void)
|
||||
{
|
||||
PyObject *m, *d;
|
||||
PyObject *m, *d;
|
||||
|
||||
init_pygobject ();
|
||||
pygst_init ();
|
||||
/* Initialize tag library */
|
||||
gst_tag_register_musicbrainz_tags ();
|
||||
|
||||
m = Py_InitModule ("tag", pytag_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
init_pygobject ();
|
||||
pygst_init ();
|
||||
/* Initialize tag library */
|
||||
gst_tag_register_musicbrainz_tags ();
|
||||
|
||||
pytag_register_classes (d);
|
||||
pytag_add_constants (m, "GST_");
|
||||
m = Py_InitModule ("tag", pytag_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.tag");
|
||||
}
|
||||
pytag_register_classes (d);
|
||||
pytag_add_constants (m, "GST_");
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.tag");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,29 +30,29 @@
|
|||
#include <gst/video/gstvideofilter.h>
|
||||
#include "pygst.h"
|
||||
|
||||
void pyvideo_register_classes (PyObject *d);
|
||||
void pyvideo_add_constants(PyObject *module, const gchar *strip_prefix);
|
||||
|
||||
void pyvideo_register_classes (PyObject * d);
|
||||
void pyvideo_add_constants (PyObject * module, const gchar * strip_prefix);
|
||||
|
||||
extern PyMethodDef pyvideo_functions[];
|
||||
|
||||
GST_DEBUG_CATEGORY (pygst_debug); /* for python code */
|
||||
GST_DEBUG_CATEGORY (pygst_debug); /* for python code */
|
||||
|
||||
DL_EXPORT(void)
|
||||
DL_EXPORT (void)
|
||||
initvideo (void)
|
||||
{
|
||||
PyObject *m, *d, *gst;
|
||||
PyObject *m, *d, *gst;
|
||||
|
||||
init_pygobject ();
|
||||
gst = pygst_init ();
|
||||
init_pygobject ();
|
||||
gst = pygst_init ();
|
||||
|
||||
m = Py_InitModule ("video", pyvideo_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
m = Py_InitModule ("video", pyvideo_functions);
|
||||
d = PyModule_GetDict (m);
|
||||
|
||||
pyvideo_register_classes (d);
|
||||
pyvideo_add_constants (m, "GST_");
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.video");
|
||||
}
|
||||
pyvideo_register_classes (d);
|
||||
pyvideo_add_constants (m, "GST_");
|
||||
|
||||
if (PyErr_Occurred ()) {
|
||||
PyErr_Print ();
|
||||
Py_FatalError ("can't initialize module gst.video");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue