gst/: API updates

Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
API updates
* gst/pygstvalue.c: (pygst_value_as_pyobject),
(pygst_value_from_pyobject):
Fixes for gst_value_array and GST_FOURCC_FORMAT
This commit is contained in:
Edward Hervey 2005-11-21 15:38:03 +00:00
parent 19bed1cfaf
commit dfa96f5a01
4 changed files with 63 additions and 17 deletions

View file

@ -1,3 +1,12 @@
2005-11-21 Edward Hervey <edward@fluendo.com>
* gst/gst-types.defs:
* gst/gst.defs:
API updates
* gst/pygstvalue.c: (pygst_value_as_pyobject),
(pygst_value_from_pyobject):
Fixes for gst_value_array and GST_FOURCC_FORMAT
2005-11-21 Jan Schmidt <thaytan@mad.scientist.com>
* gst/gst.defs:

View file

@ -449,6 +449,17 @@
)
)
(define-flags EventTypeFlags
(in-module "Gst")
(c-name "GstEventTypeFlags")
(gtype-id "GST_TYPE_EVENT_TYPE_FLAGS")
(values
'("upstream" "GST_EVENT_TYPE_UPSTREAM")
'("downstream" "GST_EVENT_TYPE_DOWNSTREAM")
'("serialized" "GST_EVENT_TYPE_SERIALIZED")
)
)
(define-enum EventType
(in-module "Gst")
(c-name "GstEventType")
@ -465,9 +476,9 @@
'("qos" "GST_EVENT_QOS")
'("seek" "GST_EVENT_SEEK")
'("navigation" "GST_EVENT_NAVIGATION")
'("custom-up" "GST_EVENT_CUSTOM_UP")
'("custom-ds" "GST_EVENT_CUSTOM_DS")
'("custom-ds-oob" "GST_EVENT_CUSTOM_DS_OOB")
'("custom-upstream" "GST_EVENT_CUSTOM_UPSTREAM")
'("custom-downstream" "GST_EVENT_CUSTOM_DOWNSTREAM")
'("custom-downstream-oob" "GST_EVENT_CUSTOM_DOWNSTREAM_OOB")
'("custom-both" "GST_EVENT_CUSTOM_BOTH")
'("custom-both-oob" "GST_EVENT_CUSTOM_BOTH_OOB")
)

View file

@ -1446,6 +1446,11 @@
(return-type "GType")
)
(define-function gst_event_type_flags_get_type
(c-name "gst_event_type_flags_get_type")
(return-type "GType")
)
(define-function event_type_get_type
(c-name "gst_event_type_get_type")
(return-type "GType")
@ -1680,6 +1685,12 @@
(return-type "GQuark")
)
(define-method get_flags
(of-object "GstEventType")
(c-name "gst_event_type_get_flags")
(return-type "GstEventTypeFlags")
)
(define-function event_get_type
(c-name "gst_event_get_type")
(return-type "GType")
@ -1765,12 +1776,6 @@
)
)
(define-function event_new_filler
(c-name "gst_event_new_filler")
(return-type "GstEvent*")
(caller-owns-return #t)
)
(define-function event_new_buffersize
(c-name "gst_event_new_buffersize")
(return-type "GstEvent*")
@ -4540,6 +4545,16 @@
)
)
(define-method set_last_stop
(of-object "GstSegment")
(c-name "gst_segment_set_last_stop")
(return-type "none")
(parameters
'("GstFormat" "format")
'("gint64" "position")
)
)
(define-method set_seek
(of-object "GstSegment")
(c-name "gst_segment_set_seek")
@ -4963,26 +4978,37 @@
)
)
(define-function caps_structure_fixate_field_nearest_int
(define-method fixate_field_nearest_int
(of-object "GstStructure")
(c-name "gst_structure_fixate_field_nearest_int")
(return-type "gboolean")
(parameters
'("GstStructure*" "structure")
'("const-char*" "field_name")
'("int" "target")
)
)
(define-function caps_structure_fixate_field_nearest_double
(define-method fixate_field_nearest_double
(of-object "GstStructure")
(c-name "gst_structure_fixate_field_nearest_double")
(return-type "gboolean")
(parameters
'("GstStructure*" "structure")
'("const-char*" "field_name")
'("double" "target")
)
)
(define-method fixate_field_boolean
(of-object "GstStructure")
(c-name "gst_structure_fixate_field_boolean")
(return-type "gboolean")
(parameters
'("const-char*" "field_name")
'("gboolean" "target")
)
)
;; From ../gstreamer/gst/gstsystemclock.h

View file

@ -51,7 +51,7 @@ pygst_value_as_pyobject(const GValue *value, gboolean copy_boxed)
PyErr_Clear();
if (GST_VALUE_HOLDS_FOURCC (value)) {
gchar str[5];
g_snprintf (str, 5, GST_FOURCC_FORMAT,
g_snprintf (str, 5, "%"GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (gst_value_get_fourcc (value)));
ret = PyObject_Call (gstfourcc_class, Py_BuildValue ("(s)", str), NULL);
} else if (GST_VALUE_HOLDS_INT_RANGE (value)) {
@ -79,12 +79,12 @@ pygst_value_as_pyobject(const GValue *value, gboolean copy_boxed)
}
} else if (GST_VALUE_HOLDS_ARRAY (value)) {
int i, len;
len = gst_value_list_get_size (value);
len = gst_value_array_get_size (value);
ret = PyTuple_New (len);
for (i=0; i<len; i++) {
PyTuple_SetItem (ret, i,
pygst_value_as_pyobject
(gst_value_list_get_value (value, i), copy_boxed));
(gst_value_array_get_value (value, i), copy_boxed));
}
} else if (GST_VALUE_HOLDS_FRACTION (value)) {
ret = PyObject_Call
@ -242,7 +242,7 @@ pygst_value_from_pyobject (GValue *value, PyObject *obj)
g_value_unset (&new);
return -1;
}
gst_value_list_append_value (value, &new);
gst_value_array_append_value (value, &new);
g_value_unset (&new);
}
return 0;