2004-05-04 14:20:28 +00:00
|
|
|
/* -*- Mode: C; ; c-file-style: "python" -*- */
|
|
|
|
/* gst-python
|
|
|
|
* Copyright (C) 2002 David I. Lehn
|
|
|
|
* Copyright (C) 2004 Johan Dahlin
|
|
|
|
*
|
|
|
|
* 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>
|
|
|
|
*/
|
|
|
|
%%
|
|
|
|
headers
|
|
|
|
|
2005-06-26 12:35:07 +00:00
|
|
|
static int gst_buffer_getreadbuffer (PyGstMiniObject *self,
|
2004-05-04 14:20:28 +00:00
|
|
|
int index,
|
|
|
|
const void **ptr);
|
2005-06-26 12:35:07 +00:00
|
|
|
static int gst_buffer_getwritebuf (PyGstMiniObject *self,
|
2004-05-04 14:20:28 +00:00
|
|
|
int index,
|
|
|
|
const void **ptr);
|
2005-06-26 12:35:07 +00:00
|
|
|
static int gst_buffer_getsegcount (PyGstMiniObject *self,
|
2004-05-04 14:20:28 +00:00
|
|
|
int *lenp);
|
2005-06-26 12:35:07 +00:00
|
|
|
static int gst_buffer_getcharbuf (PyGstMiniObject *self,
|
2004-05-04 14:20:28 +00:00
|
|
|
int index,
|
|
|
|
const char **ptr);
|
|
|
|
%%
|
|
|
|
override gst_buffer_new kwargs
|
|
|
|
static int
|
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
|
|
|
_wrap_gst_buffer_new(PyGstMiniObject *self, PyObject *args, PyObject *kwargs)
|
2004-05-04 14:20:28 +00:00
|
|
|
{
|
|
|
|
static char *kwlist[] = { "data", "buffer_size", NULL };
|
|
|
|
char *data = NULL;
|
2005-06-17 10:59:47 +00:00
|
|
|
int size = 0;
|
2004-05-04 14:20:28 +00:00
|
|
|
int buf_size = -1;
|
|
|
|
|
2005-10-06 13:51:31 +00:00
|
|
|
GST_INFO("self:%p", self);
|
2004-05-04 14:20:28 +00:00
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|z#i:GstBuffer.__init__", kwlist,
|
|
|
|
&data, &size, &buf_size))
|
|
|
|
return -1;
|
|
|
|
|
2005-04-25 02:36:27 +00:00
|
|
|
if (size < 0) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "buffer size must be >= 0");
|
|
|
|
return -1;
|
|
|
|
}
|
2005-06-17 10:59:47 +00:00
|
|
|
if (buf_size < 0)
|
|
|
|
buf_size = size;
|
|
|
|
if (buf_size < size) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "buffer size must be >= data size");
|
|
|
|
return -1;
|
|
|
|
}
|
2004-05-04 14:20:28 +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
|
|
|
self->obj = GST_MINI_OBJECT(gst_buffer_new_and_alloc(buf_size));
|
2005-10-06 13:51:31 +00:00
|
|
|
GST_INFO ("pyo:%p pyr:%d minio:%p minir:%d",
|
|
|
|
self, ((PyObject*)self)->ob_refcnt,
|
|
|
|
self->obj, GST_MINI_OBJECT_REFCOUNT_VALUE(self->obj));
|
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
|
|
|
if (!self->obj) {
|
2004-05-04 14:20:28 +00:00
|
|
|
PyErr_SetString(PyExc_RuntimeError, "could not create GstBuffer object");
|
|
|
|
return -1;
|
|
|
|
}
|
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
|
|
|
pygstminiobject_register_wrapper((PyObject *) self);
|
2004-05-04 14:20:28 +00:00
|
|
|
|
|
|
|
if (data == NULL)
|
|
|
|
return 0;
|
|
|
|
|
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
|
|
|
memcpy (GST_BUFFER_DATA (self->obj), data, size);
|
|
|
|
GST_BUFFER_SIZE (self->obj) = size;
|
2004-05-04 14:20:28 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2004-06-21 08:36:08 +00:00
|
|
|
%%
|
2004-05-04 14:20:28 +00:00
|
|
|
override-slot GstBuffer.tp_str
|
|
|
|
static PyObject *
|
2005-09-01 14:41:28 +00:00
|
|
|
_wrap_gst_buffer_tp_str (PyGstMiniObject *self)
|
2004-05-04 14:20:28 +00:00
|
|
|
{
|
2005-09-01 14:41:28 +00:00
|
|
|
GstBuffer *buf;
|
|
|
|
|
|
|
|
g_assert (self);
|
|
|
|
buf = pyg_boxed_get (self, GstBuffer);
|
|
|
|
g_assert (buf);
|
2005-06-17 10:59:47 +00:00
|
|
|
|
|
|
|
return PyString_FromStringAndSize((const gchar*) GST_BUFFER_DATA(buf),
|
|
|
|
(gint) GST_BUFFER_SIZE(buf));
|
2004-05-04 14:20:28 +00:00
|
|
|
}
|
2005-09-01 14:41:28 +00:00
|
|
|
|
|
|
|
%%
|
|
|
|
override-slot GstBuffer.tp_repr
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_buffer_tp_repr (PyGstMiniObject *self)
|
|
|
|
{
|
|
|
|
GstBuffer *buf;
|
|
|
|
guchar *data;
|
|
|
|
gchar *repr;
|
|
|
|
gint size = 0;
|
|
|
|
PyObject *ret;
|
|
|
|
|
|
|
|
g_assert (self);
|
2005-10-05 14:26:24 +00:00
|
|
|
buf = GST_BUFFER(self->obj);
|
2005-09-01 14:41:28 +00:00
|
|
|
g_assert (buf);
|
|
|
|
|
|
|
|
size = GST_BUFFER_SIZE (buf);
|
|
|
|
|
|
|
|
if (size == 0) {
|
|
|
|
repr = g_strdup_printf ("<gst.Buffer %p of size %d>", buf, size);
|
|
|
|
} else {
|
|
|
|
data = GST_BUFFER_DATA (buf);
|
|
|
|
repr = g_strdup_printf (
|
|
|
|
"<gst.Buffer %p of size %d and data 0x%02x%02x%02x%02x>", buf, size,
|
|
|
|
*data,
|
|
|
|
size > 0 ? *(data + 1) : 0,
|
|
|
|
size > 1 ? *(data + 2) : 0,
|
|
|
|
size > 2 ? *(data + 3) : 0
|
|
|
|
);
|
|
|
|
}
|
|
|
|
ret = PyString_FromStringAndSize(repr, strlen (repr));
|
|
|
|
g_free (repr);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2004-05-04 14:20:28 +00:00
|
|
|
%%
|
|
|
|
override-slot GstBuffer.tp_as_buffer
|
|
|
|
static PyBufferProcs _wrap_gst_buffer_tp_as_buffer = {
|
|
|
|
(getreadbufferproc)gst_buffer_getreadbuffer, /* bf_getreadbuffer */
|
|
|
|
(getwritebufferproc)gst_buffer_getwritebuf, /* bf_getwritebuffer */
|
|
|
|
(getsegcountproc)gst_buffer_getsegcount, /* bf_getsegcount */
|
|
|
|
(getcharbufferproc)gst_buffer_getcharbuf, /* bf_getcharbuffer */
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2005-06-26 12:35:07 +00:00
|
|
|
gst_buffer_getreadbuffer(PyGstMiniObject *self, int index, const void **ptr)
|
2004-05-04 14:20:28 +00:00
|
|
|
{
|
2005-06-17 10:59:47 +00:00
|
|
|
GstBuffer *buf = pyg_boxed_get(self, GstBuffer);
|
|
|
|
|
2004-05-04 14:20:28 +00:00
|
|
|
if ( index != 0 ) {
|
|
|
|
PyErr_SetString(PyExc_SystemError,
|
|
|
|
"accessing non-existent GstBuffer segment");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2005-06-17 10:59:47 +00:00
|
|
|
*ptr = GST_BUFFER_DATA(buf);
|
|
|
|
return GST_BUFFER_SIZE(buf);
|
2004-05-04 14:20:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-06-26 12:35:07 +00:00
|
|
|
gst_buffer_getsegcount(PyGstMiniObject *self, int *lenp)
|
2004-05-04 14:20:28 +00:00
|
|
|
{
|
2005-06-17 10:59:47 +00:00
|
|
|
GstBuffer *buf = pyg_boxed_get(self, GstBuffer);
|
|
|
|
|
2004-05-04 14:20:28 +00:00
|
|
|
if (lenp)
|
2005-06-17 10:59:47 +00:00
|
|
|
*lenp = GST_BUFFER_SIZE(buf);
|
2004-05-04 14:20:28 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-06-26 12:35:07 +00:00
|
|
|
gst_buffer_getcharbuf(PyGstMiniObject *self, int index, const char **ptr)
|
2004-05-04 14:20:28 +00:00
|
|
|
{
|
2005-06-17 10:59:47 +00:00
|
|
|
return gst_buffer_getreadbuffer (self, index, (const void **) ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-06-26 12:35:07 +00:00
|
|
|
gst_buffer_getwritebuf(PyGstMiniObject *self, int index, const void **ptr)
|
2005-06-17 10:59:47 +00:00
|
|
|
{
|
|
|
|
GstBuffer *buf = pyg_boxed_get(self, GstBuffer);
|
|
|
|
|
2004-05-04 14:20:28 +00:00
|
|
|
if ( index != 0 ) {
|
|
|
|
PyErr_SetString(PyExc_SystemError,
|
|
|
|
"accessing non-existent GstBuffer segment");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2005-06-17 10:59:47 +00:00
|
|
|
if (!gst_buffer_is_writable (buf)) {
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
"buffer is not writable");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ptr = GST_BUFFER_DATA(buf);
|
|
|
|
return GST_BUFFER_SIZE(buf);
|
2004-05-04 14:20:28 +00:00
|
|
|
}
|
|
|
|
|
2005-06-17 10:59:47 +00:00
|
|
|
%%
|
|
|
|
override-slot GstBuffer.tp_as_sequence
|
|
|
|
/* FIXME: should buffer parts be buffers or strings? */
|
|
|
|
|
2004-05-04 14:20:28 +00:00
|
|
|
static int
|
2005-06-17 10:59:47 +00:00
|
|
|
pygst_buffer_length(PyObject *self)
|
2004-05-04 14:20:28 +00:00
|
|
|
{
|
2005-06-17 10:59:47 +00:00
|
|
|
return GST_BUFFER_SIZE(pygobject_get (self));
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
pygst_buffer_slice(PyObject *self, int start, int end)
|
|
|
|
{
|
|
|
|
GstBuffer *buf = GST_BUFFER (pygobject_get (self));
|
|
|
|
if (start < 0)
|
|
|
|
start = 0;
|
|
|
|
if (end < 0)
|
|
|
|
end = 0;
|
|
|
|
if (end > GST_BUFFER_SIZE(buf))
|
|
|
|
end = GST_BUFFER_SIZE(buf);
|
|
|
|
|
|
|
|
if (end <= start) {
|
|
|
|
PyErr_SetString(PyExc_IndexError, "buffer index out of range");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return PyString_FromStringAndSize((gchar *) GST_BUFFER_DATA (buf) + start, end - start);
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
pygst_buffer_item(PyObject *self, int index)
|
|
|
|
{
|
|
|
|
return pygst_buffer_slice (self, index, index + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
pygst_buffer_ass_slice (PyObject *self, int start, int end, PyObject *val)
|
|
|
|
{
|
|
|
|
GstBuffer *buf = GST_BUFFER (pygobject_get (self));
|
|
|
|
const void *data;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
if (!gst_buffer_is_writable (buf)) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "buffer is not writable");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
/* FIXME: policy? */
|
|
|
|
if (start < 0 || end <= start || end > GST_BUFFER_SIZE (buf)) {
|
|
|
|
PyErr_SetString(PyExc_IndexError, "buffer index out of range");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
end -= start;
|
|
|
|
if (PyObject_AsReadBuffer(val, &data, &len))
|
|
|
|
return -1;
|
|
|
|
if (len > end)
|
|
|
|
len = end;
|
|
|
|
memcpy (GST_BUFFER_DATA (buf) + start, data, len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
pygst_buffer_ass_item (PyObject *self, int index, PyObject *val)
|
|
|
|
{
|
|
|
|
GstBuffer *buf = GST_BUFFER (pygobject_get (self));
|
|
|
|
const void *data;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
if (!gst_buffer_is_writable (buf)) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "buffer is not writable");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (index < 0 || index > GST_BUFFER_SIZE (buf)) {
|
|
|
|
PyErr_SetString(PyExc_IndexError, "buffer index out of range");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (PyObject_AsReadBuffer(val, &data, &len))
|
|
|
|
return -1;
|
|
|
|
/* FIXME: how do we handle this? */
|
|
|
|
if (len > GST_BUFFER_SIZE (buf) - index)
|
|
|
|
len = GST_BUFFER_SIZE (buf) - index;
|
|
|
|
memcpy (GST_BUFFER_DATA (buf) + index, data, len);
|
|
|
|
return 0;
|
2004-05-04 14:20:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static PySequenceMethods _wrap_gst_buffer_tp_as_sequence = {
|
2005-06-17 10:59:47 +00:00
|
|
|
pygst_buffer_length, /* sq_length */
|
2004-05-04 14:20:28 +00:00
|
|
|
NULL, /* sq_concat */
|
|
|
|
NULL, /* sq_repeat */
|
2005-06-17 10:59:47 +00:00
|
|
|
pygst_buffer_item, /* sq_item */
|
|
|
|
pygst_buffer_slice, /* sq_slice */
|
|
|
|
pygst_buffer_ass_item, /* sq_ass_item */
|
|
|
|
pygst_buffer_ass_slice, /* sq_ass_slice */
|
2004-05-04 14:20:28 +00:00
|
|
|
NULL, /* sq_contains */
|
|
|
|
NULL, /* sq_inplace_concat */
|
|
|
|
NULL, /* sq_inplace_repeat */
|
|
|
|
};
|
2005-06-17 10:59:47 +00:00
|
|
|
%%
|
|
|
|
define GstBuffer.copy_on_write
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_buffer_copy_on_write (PyObject *self)
|
2004-05-04 14:20:28 +00:00
|
|
|
{
|
2005-06-17 10:59:47 +00:00
|
|
|
GstBuffer *buf = pyg_boxed_get(self, GstBuffer);
|
|
|
|
|
2005-10-06 13:51:31 +00:00
|
|
|
GST_INFO("INCREF");
|
2005-06-17 10:59:47 +00:00
|
|
|
if (gst_buffer_is_writable (buf)) {
|
|
|
|
Py_INCREF (self);
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
buf = gst_buffer_copy (buf);
|
|
|
|
self = pyg_boxed_new (GST_TYPE_BUFFER, buf, FALSE, TRUE);
|
|
|
|
return self;
|
2004-05-04 14:20:28 +00:00
|
|
|
}
|
2004-06-09 13:40:27 +00:00
|
|
|
%%
|
|
|
|
define GstBuffer.flag_is_set
|
|
|
|
static PyObject *
|
2004-06-21 08:36:08 +00:00
|
|
|
_wrap_gst_buffer_flag_is_set(PyObject *self, PyObject *args)
|
2004-06-09 13:40:27 +00:00
|
|
|
{
|
|
|
|
int flag;
|
|
|
|
PyObject *retval;
|
2004-06-21 08:36:08 +00:00
|
|
|
GstBuffer *buf;
|
2004-06-09 13:40:27 +00:00
|
|
|
|
|
|
|
if (!PyArg_ParseTuple(args, "i:GstBuffer.flag_is_set", &flag))
|
|
|
|
return NULL;
|
|
|
|
|
2004-06-21 08:36:08 +00:00
|
|
|
buf = pyg_boxed_get(self, GstBuffer);
|
|
|
|
g_assert(GST_IS_BUFFER(buf));
|
|
|
|
|
|
|
|
retval = GST_BUFFER_FLAG_IS_SET(buf, flag) ? Py_True : Py_False;
|
2004-06-09 13:40:27 +00:00
|
|
|
Py_INCREF(retval);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
define GstBuffer.flag_set
|
|
|
|
static PyObject *
|
2004-06-21 08:36:08 +00:00
|
|
|
_wrap_gst_buffer_flag_set(PyObject *self, PyObject *args)
|
2004-06-09 13:40:27 +00:00
|
|
|
{
|
|
|
|
int flag;
|
2004-06-21 08:36:08 +00:00
|
|
|
GstBuffer *buf;
|
2004-06-09 13:40:27 +00:00
|
|
|
|
|
|
|
if (!PyArg_ParseTuple(args, "i:GstBuffer.set", &flag))
|
|
|
|
return NULL;
|
|
|
|
|
2004-06-21 08:36:08 +00:00
|
|
|
buf = pyg_boxed_get(self, GstBuffer);
|
|
|
|
g_assert(GST_IS_BUFFER(buf));
|
|
|
|
GST_BUFFER_FLAG_SET(buf, flag);
|
2004-06-09 13:40:27 +00:00
|
|
|
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
define GstBuffer.flag_unset
|
|
|
|
static PyObject *
|
2004-06-21 08:36:08 +00:00
|
|
|
_wrap_gst_buffer_flag_unset(PyObject *self, PyObject *args)
|
2004-06-09 13:40:27 +00:00
|
|
|
{
|
|
|
|
int flag;
|
2004-06-21 08:36:08 +00:00
|
|
|
GstBuffer *buf;
|
2004-06-09 13:40:27 +00:00
|
|
|
|
|
|
|
if (!PyArg_ParseTuple(args, "i:GstBuffer.unset", &flag))
|
|
|
|
return NULL;
|
|
|
|
|
2004-06-21 08:36:08 +00:00
|
|
|
buf = pyg_boxed_get(self, GstBuffer);
|
|
|
|
g_assert(GST_IS_BUFFER(buf));
|
|
|
|
GST_BUFFER_FLAG_UNSET(buf, flag);
|
2004-06-09 13:40:27 +00:00
|
|
|
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
|
|
|
}
|
2005-09-01 14:41:28 +00:00
|
|
|
|
2005-09-01 14:50:01 +00:00
|
|
|
%%
|
|
|
|
override-attr GstBuffer.data
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_buffer__get_data(PyObject *self, void *closure)
|
|
|
|
{
|
|
|
|
GstBuffer *buf;
|
|
|
|
|
|
|
|
g_assert (self);
|
|
|
|
buf = pyg_boxed_get (self, GstBuffer);
|
|
|
|
g_assert (buf);
|
|
|
|
|
|
|
|
return PyString_FromStringAndSize((const gchar*) GST_BUFFER_DATA(buf),
|
|
|
|
(gint) GST_BUFFER_SIZE(buf));
|
|
|
|
}
|
|
|
|
|
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-attr GstBuffer.timestamp
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_buffer__get_timestamp(PyObject *self, void *closure)
|
|
|
|
{
|
|
|
|
guint64 ret;
|
|
|
|
|
|
|
|
ret = GST_BUFFER(pygstminiobject_get(self))->timestamp;
|
|
|
|
return PyLong_FromUnsignedLongLong(ret);
|
|
|
|
}
|
|
|
|
static int
|
|
|
|
_wrap_gst_buffer__set_timestamp(PyGstMiniObject *self, PyObject *value, void *closure)
|
|
|
|
{
|
|
|
|
guint64 val;
|
|
|
|
|
|
|
|
if (PyInt_CheckExact(value))
|
|
|
|
val = PyInt_AsUnsignedLongLongMask(value);
|
|
|
|
else
|
|
|
|
val = PyLong_AsUnsignedLongLong(value);
|
|
|
|
if (PyErr_Occurred())
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
GST_BUFFER(self->obj)->timestamp = val;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
%%
|
|
|
|
override-attr GstBuffer.duration
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_buffer__get_duration(PyObject *self, void *closure)
|
|
|
|
{
|
|
|
|
guint64 ret;
|
|
|
|
|
|
|
|
ret = GST_BUFFER(pygstminiobject_get(self))->duration;
|
|
|
|
return PyLong_FromUnsignedLongLong(ret);
|
|
|
|
}
|
|
|
|
static int
|
|
|
|
_wrap_gst_buffer__set_duration(PyGstMiniObject *self, PyObject *value, void *closure)
|
|
|
|
{
|
|
|
|
guint64 val;
|
|
|
|
|
|
|
|
if (PyInt_CheckExact(value))
|
|
|
|
val = PyInt_AsUnsignedLongLongMask(value);
|
|
|
|
else
|
|
|
|
val = PyLong_AsUnsignedLongLong(value);
|
|
|
|
if (PyErr_Occurred())
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
GST_BUFFER(self->obj)->duration = val;
|
|
|
|
return 0;
|
|
|
|
}
|
2005-09-01 14:41:28 +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-attr GstBuffer.offset
|
|
|
|
static PyObject *
|
2005-09-01 14:41:28 +00:00
|
|
|
_wrap_gst_buffer__get_offset (PyObject *self, void *closure)
|
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
|
|
|
{
|
|
|
|
guint64 ret;
|
2005-09-01 14:41:28 +00:00
|
|
|
GstMiniObject *miniobject;
|
|
|
|
g_assert (self);
|
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-09-01 14:41:28 +00:00
|
|
|
miniobject = pygstminiobject_get (self);
|
|
|
|
g_assert (miniobject);
|
|
|
|
|
|
|
|
ret = GST_BUFFER_OFFSET (GST_BUFFER (miniobject));
|
|
|
|
return PyLong_FromUnsignedLongLong (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
|
|
|
}
|
2005-09-01 14:41:28 +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
|
|
|
static int
|
2005-09-01 14:41:28 +00:00
|
|
|
_wrap_gst_buffer__set_offset (PyGstMiniObject *self, PyObject *value, void *closure)
|
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
|
|
|
{
|
|
|
|
guint64 val;
|
2005-09-01 14:41:28 +00:00
|
|
|
g_assert (self);
|
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-09-01 14:41:28 +00:00
|
|
|
if (PyInt_CheckExact (value))
|
|
|
|
val = PyInt_AsUnsignedLongLongMask (value);
|
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
|
|
|
else
|
2005-09-01 14:41:28 +00:00
|
|
|
val = PyLong_AsUnsignedLongLong (value);
|
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
|
|
|
if (PyErr_Occurred())
|
|
|
|
return -1;
|
|
|
|
|
2005-09-01 14:41:28 +00:00
|
|
|
GST_BUFFER_OFFSET (GST_BUFFER (self->obj)) = val;
|
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 0;
|
|
|
|
}
|
2005-09-01 14:41:28 +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-attr GstBuffer.offset_end
|
|
|
|
static PyObject *
|
2005-09-01 14:41:28 +00:00
|
|
|
_wrap_gst_buffer__get_offset_end (PyObject *self, void *closure)
|
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
|
|
|
{
|
|
|
|
guint64 ret;
|
2005-09-01 14:41:28 +00:00
|
|
|
GstMiniObject *miniobject;
|
|
|
|
g_assert (self);
|
|
|
|
|
|
|
|
miniobject = pygstminiobject_get (self);
|
|
|
|
g_assert (miniobject);
|
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-09-01 14:41:28 +00:00
|
|
|
ret = GST_BUFFER_OFFSET_END (GST_BUFFER (miniobject));
|
|
|
|
return PyLong_FromUnsignedLongLong (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
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-09-01 14:41:28 +00:00
|
|
|
_wrap_gst_buffer__set_offset_end (PyGstMiniObject *self, PyObject *value, void *closure)
|
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
|
|
|
{
|
|
|
|
guint64 val;
|
2005-09-01 14:41:28 +00:00
|
|
|
g_assert (self);
|
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-09-01 14:41:28 +00:00
|
|
|
if (PyInt_CheckExact (value))
|
|
|
|
val = PyInt_AsUnsignedLongLongMask (value);
|
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
|
|
|
else
|
2005-09-01 14:41:28 +00:00
|
|
|
val = PyLong_AsUnsignedLongLong (value);
|
|
|
|
if (PyErr_Occurred ())
|
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 -1;
|
|
|
|
|
2005-09-01 14:41:28 +00:00
|
|
|
GST_BUFFER_OFFSET_END (GST_BUFFER (self->obj)) = val;
|
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 0;
|
|
|
|
}
|
2005-09-01 14:41:28 +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_buffer_stamp kwargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_buffer_stamp (PyGstMiniObject *self, PyObject *args, PyObject *kwargs)
|
|
|
|
{
|
|
|
|
static char *kwlist[] = { "src", NULL };
|
|
|
|
PyGstMiniObject *srcobj;
|
|
|
|
GstBuffer *dest, *src;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTupleAndKeywords (args, kwargs,
|
|
|
|
"0:GstBuffer.stamp",
|
|
|
|
kwlist, &srcobj))
|
|
|
|
return NULL;
|
|
|
|
dest = GST_BUFFER(pygstminiobject_get(self));
|
|
|
|
src = GST_BUFFER(pygstminiobject_get(srcobj));
|
|
|
|
gst_buffer_stamp (dest, (const GstBuffer*) src);
|
|
|
|
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
|
|
|
}
|
2005-10-06 13:51:31 +00:00
|
|
|
%%
|
|
|
|
override-attr GstBuffer.caps
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_buffer__get_caps (PyObject *self, void *closure)
|
|
|
|
{
|
|
|
|
GstMiniObject *miniobject;
|
|
|
|
GstCaps *ret;
|
|
|
|
|
|
|
|
miniobject = pygstminiobject_get (self);
|
|
|
|
g_assert (miniobject);
|
|
|
|
|
|
|
|
pyg_begin_allow_threads;
|
|
|
|
ret = gst_buffer_get_caps(GST_BUFFER(miniobject));
|
|
|
|
pyg_end_allow_threads;
|
|
|
|
return pyg_boxed_new (GST_TYPE_CAPS, ret, FALSE, TRUE);
|
|
|
|
}
|
|
|
|
static int
|
|
|
|
_wrap_gst_buffer__set_caps (PyGstMiniObject *self, PyObject *value, void *closure)
|
|
|
|
{
|
|
|
|
GstCaps *caps;
|
|
|
|
g_assert (self);
|
|
|
|
|
|
|
|
caps = pygst_caps_from_pyobject (value, NULL);
|
|
|
|
if (PyErr_Occurred())
|
|
|
|
return -1;
|
|
|
|
pyg_begin_allow_threads;
|
|
|
|
gst_buffer_set_caps(GST_BUFFER(self->obj), caps);
|
2005-10-11 12:42:53 +00:00
|
|
|
gst_caps_unref (caps);
|
2005-10-06 13:51:31 +00:00
|
|
|
pyg_end_allow_threads;
|
|
|
|
return 0;
|
|
|
|
}
|
2005-10-11 12:42:53 +00:00
|
|
|
%%
|
|
|
|
override gst_buffer_set_caps kwargs
|
|
|
|
static PyObject *
|
|
|
|
_wrap_gst_buffer_set_caps(PyGstMiniObject *self, PyObject *args, PyObject *kwargs)
|
|
|
|
{
|
|
|
|
static char *kwlist[] = { "caps", NULL };
|
|
|
|
PyObject *py_caps;
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstBuffer.set_caps", kwlist, &py_caps))
|
|
|
|
return NULL;
|
|
|
|
caps = pygst_caps_from_pyobject (py_caps, NULL);
|
|
|
|
if (PyErr_Occurred())
|
|
|
|
return NULL;
|
|
|
|
pyg_begin_allow_threads;
|
|
|
|
gst_buffer_set_caps(GST_BUFFER(self->obj), caps);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
pyg_end_allow_threads;
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
|
|
|
}
|