gst/: Update for core changes.

Original commit message from CVS:
2005-09-02  Andy Wingo  <wingo@pobox.com>

* gst/gstelement.override:
* gst/gstmessage.override:
* gst/gst-types.defs (State, StateChangeReturn, StateChange):
* gst/gst.defs (change_state): Update for core changes.
This commit is contained in:
Andy Wingo 2005-09-02 16:21:45 +00:00
parent f0607ec5f1
commit 52d5e11fa7
6 changed files with 62 additions and 37 deletions

View file

@ -1,3 +1,9 @@
2005-09-02 Andy Wingo <wingo@pobox.com>
* gst/gstmessage.override:
* gst/gst-types.defs (State, StateChangeReturn, StateChange):
* gst/gst.defs (change_state): Update for core changes.
2005-09-01 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gst.defs:

2
env
View file

@ -8,6 +8,8 @@ else
export PYTHONPATH=$thisdir
fi
export PKG_CONFIG_PATH=$thisdir/pkgconfig:$PKG_CONFIG_PATH
export PACKAGES="pygst $PACKAGES"
exec "$@"

View file

@ -874,10 +874,10 @@
)
)
(define-flags ElementState
(define-enum State
(in-module "Gst")
(c-name "GstElementState")
(gtype-id "GST_TYPE_ELEMENT_STATE")
(c-name "GstState")
(gtype-id "GST_TYPE_STATE")
(values
'("void-pending" "GST_STATE_VOID_PENDING")
'("null" "GST_STATE_NULL")
@ -887,15 +887,29 @@
)
)
(define-enum ElementStateReturn
(define-enum StateChangeReturn
(in-module "Gst")
(c-name "GstElementStateReturn")
(gtype-id "GST_TYPE_ELEMENT_STATE_RETURN")
(c-name "GstStateChangeReturn")
(gtype-id "GST_TYPE_STATE_CHANGE_RETURN")
(values
'("failure" "GST_STATE_FAILURE")
'("success" "GST_STATE_SUCCESS")
'("async" "GST_STATE_ASYNC")
'("no-preroll" "GST_STATE_NO_PREROLL")
'("failure" "GST_STATE_CHANGE_FAILURE")
'("success" "GST_STATE_CHANGE_SUCCESS")
'("async" "GST_STATE_CHANGE_ASYNC")
'("no-preroll" "GST_STATE_CHANGE_NO_PREROLL")
)
)
(define-enum StateChange
(in-module "Gst")
(c-name "GstStateChange")
(gtype-id "GST_TYPE_STATE_CHANGE")
(values
'("null-to-ready" "GST_STATE_CHANGE_NULL_TO_READY")
'("ready-to-paused" "GST_STATE_CHANGE_READY_TO_PAUSED")
'("paused-to-playing" "GST_STATE_CHANGE_PAUSED_TO_PLAYING")
'("playing-to-paused" "GST_STATE_CHANGE_PLAYING_TO_PAUSED")
'("paused-to-ready" "GST_STATE_CHANGE_PAUSED_TO_READY")
'("ready-to-null" "GST_STATE_CHANGE_READY_TO_NULL")
)
)

View file

@ -1038,10 +1038,10 @@
(define-method get_state
(of-object "GstElement")
(c-name "gst_element_get_state")
(return-type "GstElementStateReturn")
(return-type "GstStateChangeReturn")
(parameters
'("GstElementState*" "state")
'("GstElementState*" "pending")
'("GstState*" "state")
'("GstState*" "pending")
'("GTimeVal*" "timeout")
)
)
@ -1049,9 +1049,9 @@
(define-method set_state
(of-object "GstElement")
(c-name "gst_element_set_state")
(return-type "GstElementStateReturn")
(return-type "GstStateChangeReturn")
(parameters
'("GstElementState" "state")
'("GstState" "state")
)
)
@ -1102,17 +1102,20 @@
(define-virtual get_state
(of-object "GstElement")
(return-type "GstElementStateReturn")
(return-type "GstStateChangeReturn")
(parameters
'("GstElementState*" "state")
'("GstElementState*" "pending")
'("GstState*" "state")
'("GstState*" "pending")
'("GTimeVal*" "timeout")
)
)
(define-virtual change_state
(of-object "GstElement")
(return-type "GstElementStateReturn")
(return-type "GstStateChangeReturn")
(parameters
'("GstStateChange" "transition")
)
)
(define-virtual request_new_pad
@ -2544,8 +2547,8 @@
(return-type "GstMessage*")
(parameters
'("GstObject*" "src")
'("GstElementState" "old_state")
'("GstElementState" "new_state")
'("GstState" "old_state")
'("GstState" "new_state")
)
)
@ -2611,8 +2614,8 @@
(c-name "gst_message_parse_state_changed")
(return-type "none")
(parameters
'("GstElementState*" "old_state")
'("GstElementState*" "new_state")
'("GstState*" "old_state")
'("GstState*" "new_state")
)
)
@ -5635,7 +5638,7 @@
)
(define-method get_name
(of-object "GstElementState")
(of-object "GstState")
(c-name "gst_element_state_get_name")
(return-type "const-gchar*")
)
@ -5643,7 +5646,7 @@
(define-function element_state_get_name
(c-name "gst_element_state_get_name")
(parameters
'("GstElementState" "state")
'("GstState" "state")
)
(return-type "const-gchar*")
)

View file

@ -92,12 +92,12 @@ _wrap_gst_element_set_state(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "state", NULL };
PyObject *py_state = NULL;
GstElementState state;
GstState state;
gint ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GstElement.set_state", kwlist, &py_state))
return NULL;
if (pyg_flags_get_value(GST_TYPE_ELEMENT_STATE, py_state, (gint *)&state))
if (pyg_enum_get_value(GST_TYPE_STATE, py_state, (gint *)&state))
return NULL;
pyg_begin_allow_threads;
@ -113,8 +113,8 @@ override gst_element_get_state kwargs
static PyObject *
_wrap_gst_element_get_state(PyGObject *self, PyObject *args, PyObject *kwargs)
{
GstElementState state;
GstElementStateReturn ret;
GstState state;
GstStateChangeReturn ret;
/* Only returns the state for the time being */
ret = gst_element_get_state(GST_ELEMENT (self->obj), &state, NULL, NULL);
@ -122,7 +122,7 @@ _wrap_gst_element_get_state(PyGObject *self, PyObject *args, PyObject *kwargs)
PyErr_SetString(PyExc_RuntimeError, "Element is in an error state");
return NULL;
}
return pyg_flags_from_gtype(GST_TYPE_ELEMENT_STATE, state);
return pyg_enum_from_gtype(GST_TYPE_STATE, state);
}
%%
/* override gst_element_query kwargs */

View file

@ -25,8 +25,8 @@ override gst_message_parse_state_changed noargs
static PyObject *
_wrap_gst_message_parse_state_changed (PyGstMiniObject *self)
{
GstElementState old;
GstElementState new;
GstState old;
GstState new;
PyObject *ret;
/* Should raise an exception if it's not a state-changed message */
@ -37,8 +37,8 @@ _wrap_gst_message_parse_state_changed (PyGstMiniObject *self)
gst_message_parse_state_changed (GST_MESSAGE(self->obj), &old, &new);
/* Return this as a tuple */
ret = PyList_New(2);
PyList_SET_ITEM(ret, 0, pyg_flags_from_gtype(GST_TYPE_ELEMENT_STATE, old));
PyList_SET_ITEM(ret, 1, pyg_flags_from_gtype(GST_TYPE_ELEMENT_STATE, new));
PyList_SET_ITEM(ret, 0, pyg_enum_from_gtype(GST_TYPE_STATE, old));
PyList_SET_ITEM(ret, 1, pyg_enum_from_gtype(GST_TYPE_STATE, new));
return ret;
}
%%
@ -242,14 +242,14 @@ _wrap_gst_message_new_state_changed(PyObject *self, PyObject *args, PyObject *kw
static char *kwlist[] = { "src", "old_state", "new_state", NULL };
PyGObject *src;
PyObject *py_old_state = NULL, *py_new_state = NULL;
GstElementState old_state, new_state;
GstState old_state, new_state;
GstMessage *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!OO:message_new_state_changed", kwlist, &PyGstObject_Type, &src, &py_old_state, &py_new_state))
return NULL;
if (pyg_flags_get_value(GST_TYPE_ELEMENT_STATE, py_old_state, (gint *)&old_state))
if (pyg_enum_get_value(GST_TYPE_STATE, py_old_state, (gint *)&old_state))
return NULL;
if (pyg_flags_get_value(GST_TYPE_ELEMENT_STATE, py_new_state, (gint *)&new_state))
if (pyg_enum_get_value(GST_TYPE_STATE, py_new_state, (gint *)&new_state))
return NULL;
ret = gst_message_new_state_changed(GST_OBJECT(src->obj), old_state, new_state);
/* pygobject_new handles NULL checking */