gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
/* -*- Mode: C; ; c-file-style: "python" -*- */
|
|
|
|
/* gst-python
|
|
|
|
* Copyright (C) 2005 Edward Hervey
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Author: Johan Dahlin <johan@gnome.org>
|
|
|
|
*/
|
|
|
|
|
2005-10-18 10:02:41 +00:00
|
|
|
%%
|
|
|
|
override-slot GstMessage.tp_repr
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_tp_repr (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstMessage *msg;
|
2005-10-18 10:17:06 +00:00
|
|
|
gchar *repr, *structure_str, *src_str;
|
2005-10-18 10:02:41 +00:00
|
|
|
PyObject *ret;
|
|
|
|
|
|
|
|
g_assert (self);
|
|
|
|
msg = GST_MESSAGE (self->obj);
|
|
|
|
g_assert (msg);
|
|
|
|
|
2005-10-18 10:17:06 +00:00
|
|
|
structure_str = msg->structure ? gst_structure_to_string (msg->structure)
|
|
|
|
: g_strdup ("(none)");
|
2009-04-18 15:39:42 +00:00
|
|
|
if (msg->src) {
|
|
|
|
pyg_begin_allow_threads;
|
|
|
|
src_str = gst_object_get_name (msg->src);
|
|
|
|
pyg_end_allow_threads;
|
|
|
|
} else {
|
|
|
|
src_str = g_strdup ("(no src)");
|
|
|
|
}
|
2005-10-18 10:17:06 +00:00
|
|
|
|
|
|
|
repr = g_strdup_printf ("<gst.Message %s from %s at %p>",
|
|
|
|
structure_str, src_str, msg);
|
|
|
|
g_free (src_str);
|
|
|
|
g_free (structure_str);
|
|
|
|
|
2005-10-18 10:02:41 +00:00
|
|
|
ret = PyString_FromStringAndSize(repr, strlen (repr));
|
|
|
|
g_free (repr);
|
2005-10-18 10:17:06 +00:00
|
|
|
|
2005-10-18 10:02:41 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
%%
|
|
|
|
override gst_message_parse_state_changed noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_state_changed (PyGstMiniObject *self)
|
|
|
|
{
|
2005-09-02 16:21:45 +00:00
|
|
|
GstState old;
|
|
|
|
GstState new;
|
2005-10-09 13:55:59 +00:00
|
|
|
GstState pen;
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
|
|
|
|
/* Should raise an exception if it's not a state-changed message */
|
|
|
|
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_STATE_CHANGED) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not a state-changed message");
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-10-09 13:55:59 +00:00
|
|
|
gst_message_parse_state_changed (GST_MESSAGE(self->obj), &old, &new, &pen);
|
2006-07-03 09:01:18 +00:00
|
|
|
|
2006-07-03 09:31:26 +00:00
|
|
|
return Py_BuildValue("[OOO]",
|
2006-07-03 09:01:18 +00:00
|
|
|
pyg_enum_from_gtype(GST_TYPE_STATE, old),
|
|
|
|
pyg_enum_from_gtype(GST_TYPE_STATE, new),
|
|
|
|
pyg_enum_from_gtype(GST_TYPE_STATE, pen));
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
}
|
|
|
|
%%
|
2005-07-21 12:03:23 +00:00
|
|
|
override gst_message_parse_segment_start noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_segment_start (PyGstMiniObject *self)
|
|
|
|
{
|
2005-10-19 11:45:34 +00:00
|
|
|
gint64 position;
|
|
|
|
GstFormat format;
|
2005-07-21 12:03:23 +00:00
|
|
|
|
|
|
|
/* Should raise an exception if it's not a segment start message */
|
|
|
|
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_SEGMENT_START) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not a segment start message");
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-10-19 11:45:34 +00:00
|
|
|
gst_message_parse_segment_start (GST_MESSAGE(self->obj), &format, &position);
|
|
|
|
|
2006-07-03 09:01:18 +00:00
|
|
|
return Py_BuildValue("(OL)",
|
|
|
|
pyg_enum_from_gtype(GST_TYPE_FORMAT, format),
|
2006-07-03 14:44:20 +00:00
|
|
|
position);
|
2005-07-21 12:03:23 +00:00
|
|
|
}
|
2005-10-19 11:45:34 +00:00
|
|
|
|
2005-07-21 12:03:23 +00:00
|
|
|
%%
|
|
|
|
override gst_message_parse_segment_done noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_segment_done (PyGstMiniObject *self)
|
|
|
|
{
|
2005-10-19 11:45:34 +00:00
|
|
|
gint64 position;
|
|
|
|
GstFormat format;
|
2005-07-21 12:03:23 +00:00
|
|
|
|
2005-10-19 11:45:34 +00:00
|
|
|
/* Should raise an exception if it's not a segment done message */
|
2005-07-21 12:03:23 +00:00
|
|
|
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_SEGMENT_DONE) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not a segment done message");
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-10-19 11:45:34 +00:00
|
|
|
gst_message_parse_segment_done (GST_MESSAGE(self->obj), &format, &position);
|
|
|
|
|
2006-07-03 09:01:18 +00:00
|
|
|
return Py_BuildValue("(OL)",
|
|
|
|
pyg_enum_from_gtype(GST_TYPE_FORMAT, format),
|
2006-07-03 14:44:20 +00:00
|
|
|
position);
|
2005-07-21 12:03:23 +00:00
|
|
|
}
|
2005-10-19 11:45:34 +00:00
|
|
|
|
2005-07-21 12:03:23 +00:00
|
|
|
%%
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
override gst_message_parse_error noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_error (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
PyObject *ret;
|
2005-12-07 14:41:37 +00:00
|
|
|
GError *error = NULL;
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
gchar *debug;
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_ERROR) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an error message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_error (GST_MESSAGE(self->obj), &error, &debug);
|
|
|
|
|
2005-10-19 15:41:31 +00:00
|
|
|
ret = PyList_New(2);
|
|
|
|
PyList_SetItem(ret, 0, pyg_boxed_new (GST_TYPE_G_ERROR, error, TRUE, TRUE));
|
2005-12-07 14:41:37 +00:00
|
|
|
if (error)
|
|
|
|
g_error_free (error);
|
2005-08-03 12:48:40 +00:00
|
|
|
if (debug != NULL) {
|
2005-10-19 15:41:31 +00:00
|
|
|
PyList_SetItem(ret, 1, PyString_FromString(debug));
|
2005-08-03 12:48:40 +00:00
|
|
|
} else {
|
|
|
|
Py_INCREF (Py_None);
|
2005-10-19 15:41:31 +00:00
|
|
|
PyList_SetItem(ret, 1, Py_None);
|
2005-08-03 12:48:40 +00:00
|
|
|
}
|
2005-12-07 14:41:37 +00:00
|
|
|
g_free(debug);
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_warning noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_warning (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
PyObject *ret;
|
2007-06-08 15:16:08 +00:00
|
|
|
GError *warning = NULL;
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
gchar *debug;
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_WARNING) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an warning message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_warning (GST_MESSAGE(self->obj), &warning, &debug);
|
|
|
|
|
2007-06-08 15:16:08 +00:00
|
|
|
ret = PyList_New(2);
|
2005-10-19 15:41:31 +00:00
|
|
|
PyList_SetItem(ret, 0, pyg_boxed_new (GST_TYPE_G_ERROR, warning, TRUE, TRUE));
|
2007-06-08 15:16:08 +00:00
|
|
|
if (warning)
|
|
|
|
g_error_free (warning);
|
|
|
|
if (debug != NULL) {
|
|
|
|
PyList_SetItem(ret, 1, PyString_FromString(debug));
|
|
|
|
} else {
|
|
|
|
Py_INCREF (Py_None);
|
|
|
|
PyList_SetItem(ret, 1, Py_None);
|
|
|
|
}
|
|
|
|
g_free(debug);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_info noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_info (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
PyObject *ret;
|
|
|
|
GError *info = NULL;
|
|
|
|
gchar *debug;
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_INFO) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an info message");
|
|
|
|
return NULL;
|
|
|
|
}
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
|
2007-06-08 15:16:08 +00:00
|
|
|
gst_message_parse_info (GST_MESSAGE(self->obj), &info, &debug);
|
|
|
|
|
|
|
|
ret = PyList_New(2);
|
|
|
|
PyList_SetItem(ret, 0, pyg_boxed_new (GST_TYPE_G_ERROR, info, TRUE, TRUE));
|
|
|
|
if (info)
|
|
|
|
g_error_free (info);
|
|
|
|
if (debug != NULL) {
|
|
|
|
PyList_SetItem(ret, 1, PyString_FromString(debug));
|
|
|
|
} else {
|
|
|
|
Py_INCREF (Py_None);
|
|
|
|
PyList_SetItem(ret, 1, Py_None);
|
|
|
|
}
|
|
|
|
g_free(debug);
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_tag noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_tag (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
PyObject *ret;
|
|
|
|
GstTagList *taglist;
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_TAG) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an Tag message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_tag (GST_MESSAGE(self->obj), &taglist);
|
|
|
|
|
2005-07-12 10:13:53 +00:00
|
|
|
ret = pyg_boxed_new (GST_TYPE_TAG_LIST, taglist, TRUE, TRUE);
|
2005-11-02 13:54:21 +00:00
|
|
|
gst_tag_list_free (taglist);
|
gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00
|
|
|
return ret;
|
|
|
|
}
|
2005-10-19 15:41:31 +00:00
|
|
|
%%
|
|
|
|
override gst_message_parse_clock_provide noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_clock_provide (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstClock *clock;
|
|
|
|
gboolean ready;
|
|
|
|
|
|
|
|
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_CLOCK_PROVIDE) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not a 'clock provide' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_clock_provide (GST_MESSAGE(self->obj), &clock, &ready);
|
|
|
|
|
2006-07-03 09:01:18 +00:00
|
|
|
return Py_BuildValue("(OO)",
|
|
|
|
pygobject_new(G_OBJECT (clock)),
|
|
|
|
PyBool_FromLong(ready));
|
2005-10-19 15:41:31 +00:00
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_clock_lost noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_clock_lost (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstClock *clock;
|
|
|
|
|
|
|
|
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_CLOCK_LOST) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not a 'clock lost' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_clock_lost (GST_MESSAGE(self->obj), &clock);
|
|
|
|
|
2006-07-02 15:25:04 +00:00
|
|
|
return pygobject_new(G_OBJECT(clock));
|
2005-10-19 15:41:31 +00:00
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_new_clock noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_new_clock (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstClock *clock;
|
|
|
|
|
|
|
|
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_NEW_CLOCK) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not a 'new clock' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_new_clock (GST_MESSAGE(self->obj), &clock);
|
|
|
|
|
2006-07-02 15:25:04 +00:00
|
|
|
return pygobject_new(G_OBJECT(clock));
|
2005-10-19 15:41:31 +00:00
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_duration noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_duration (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstFormat format;
|
|
|
|
gint64 duration;
|
|
|
|
|
|
|
|
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_DURATION) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not a 'duration' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_duration (GST_MESSAGE(self->obj), &format, &duration);
|
|
|
|
|
2006-07-03 09:01:18 +00:00
|
|
|
return Py_BuildValue("(OL)",
|
|
|
|
pyg_enum_from_gtype (GST_TYPE_FORMAT, format),
|
2006-07-03 14:44:20 +00:00
|
|
|
duration);
|
2005-10-19 15:41:31 +00:00
|
|
|
}
|
2007-06-08 15:16:08 +00:00
|
|
|
%%
|
|
|
|
override gst_message_parse_async_start noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_async_start (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
gboolean res = FALSE;
|
|
|
|
|
|
|
|
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_ASYNC_START) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an 'async-start' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_async_start (GST_MESSAGE(self->obj), &res);
|
|
|
|
|
|
|
|
return PyBool_FromLong (res);
|
|
|
|
}
|
2007-07-28 14:26:54 +00:00
|
|
|
%%
|
|
|
|
override gst_message_parse_buffering noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_buffering (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
gint percent;
|
|
|
|
|
|
|
|
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_BUFFERING) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not a 'buffering' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_buffering (GST_MESSAGE(self->obj), &percent);
|
|
|
|
|
|
|
|
return Py_BuildValue("i", percent);
|
|
|
|
}
|
2009-07-01 10:29:22 +00:00
|
|
|
%%
|
|
|
|
override gst_message_parse_tag_full noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_tag_full (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstPad *pad;
|
|
|
|
GstTagList *taglist;
|
|
|
|
PyObject *ptlist;
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_TAG) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an Tag message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_tag_full (GST_MESSAGE (self->obj), &pad, &taglist);
|
|
|
|
ptlist = pyg_boxed_new (GST_TYPE_TAG_LIST, taglist, TRUE, TRUE);
|
|
|
|
gst_tag_list_free (taglist);
|
|
|
|
|
|
|
|
return Py_BuildValue("(OO)",
|
|
|
|
pygobject_new((GObject*) pad),
|
|
|
|
ptlist);
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_step_done noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_step_done (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstFormat format;
|
|
|
|
guint64 amount, duration;
|
|
|
|
gdouble rate;
|
|
|
|
gboolean flush, intermediate, eos;
|
|
|
|
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_STEP_DONE) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an 'step-done' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_step_done (GST_MESSAGE (self->obj), &format, &amount, &rate,
|
|
|
|
&flush, &intermediate, &duration, &eos);
|
|
|
|
|
|
|
|
return Py_BuildValue("OKdOOKO",
|
|
|
|
pyg_enum_from_gtype (GST_TYPE_FORMAT, format),
|
|
|
|
amount, rate,
|
|
|
|
PyBool_FromLong(flush),
|
|
|
|
PyBool_FromLong(intermediate),
|
|
|
|
duration,
|
|
|
|
PyBool_FromLong(eos));
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_step_start noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_step_start (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstFormat format;
|
|
|
|
guint64 amount;
|
|
|
|
gdouble rate;
|
|
|
|
gboolean active, flush, intermediate;
|
|
|
|
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_STEP_START) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an 'step-start' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_step_start (GST_MESSAGE (self->obj), &active, &format,
|
|
|
|
&amount, &rate, &flush, &intermediate);
|
|
|
|
|
|
|
|
return Py_BuildValue("OOKdOO",
|
|
|
|
PyBool_FromLong(active),
|
|
|
|
pyg_enum_from_gtype (GST_TYPE_FORMAT, format),
|
|
|
|
amount, rate,
|
|
|
|
PyBool_FromLong(flush),
|
|
|
|
PyBool_FromLong(intermediate));
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_stream_status noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_stream_status (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstStreamStatusType type;
|
|
|
|
GstElement *owner;
|
|
|
|
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_STREAM_STATUS) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an 'stream-status' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_stream_status (GST_MESSAGE (self->obj), &type, &owner);
|
|
|
|
|
|
|
|
return Py_BuildValue("OO",
|
|
|
|
pyg_enum_from_gtype (GST_TYPE_STREAM_STATUS_TYPE, type),
|
|
|
|
pygobject_new((GObject*) owner));
|
|
|
|
}
|
2009-07-01 11:54:57 +00:00
|
|
|
%%
|
|
|
|
override gst_message_parse_structure_change noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_structure_change (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstStructureChangeType type;
|
|
|
|
GstElement *owner;
|
|
|
|
gboolean busy;
|
|
|
|
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_STRUCTURE_CHANGE) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an 'structure_change' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_structure_change (GST_MESSAGE (self->obj), &type, &owner, &busy);
|
|
|
|
|
|
|
|
return Py_BuildValue("OOO",
|
|
|
|
pyg_enum_from_gtype (GST_TYPE_STRUCTURE_CHANGE_TYPE, type),
|
|
|
|
pygobject_new((GObject*) owner),
|
|
|
|
PyBool_FromLong(busy));
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_request_state noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_request_state (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstState state;
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_REQUEST_STATE) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an 'request_state' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_request_state (GST_MESSAGE (self->obj), &state);
|
|
|
|
|
|
|
|
return pyg_enum_from_gtype(GST_TYPE_STATE, state);
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override gst_message_parse_buffering_stats noargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_message_parse_buffering_stats (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstBufferingMode mode;
|
|
|
|
gint avg_in, avg_out;
|
|
|
|
gint64 buffering_left;
|
|
|
|
|
|
|
|
if (GST_MESSAGE_TYPE(self->obj) != GST_MESSAGE_BUFFERING) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Message is not an 'buffering' message");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_message_parse_buffering_stats (GST_MESSAGE (self->obj), &mode, &avg_in, &avg_out,
|
|
|
|
&buffering_left);
|
|
|
|
|
|
|
|
return Py_BuildValue("OiiL",
|
|
|
|
pyg_enum_from_gtype (GST_TYPE_BUFFERING_MODE, mode),
|
|
|
|
avg_in, avg_out, buffering_left);
|
|
|
|
}
|