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> 2005-11-21 Jan Schmidt <thaytan@mad.scientist.com>
* gst/gst.defs: * 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 (define-enum EventType
(in-module "Gst") (in-module "Gst")
(c-name "GstEventType") (c-name "GstEventType")
@ -465,9 +476,9 @@
'("qos" "GST_EVENT_QOS") '("qos" "GST_EVENT_QOS")
'("seek" "GST_EVENT_SEEK") '("seek" "GST_EVENT_SEEK")
'("navigation" "GST_EVENT_NAVIGATION") '("navigation" "GST_EVENT_NAVIGATION")
'("custom-up" "GST_EVENT_CUSTOM_UP") '("custom-upstream" "GST_EVENT_CUSTOM_UPSTREAM")
'("custom-ds" "GST_EVENT_CUSTOM_DS") '("custom-downstream" "GST_EVENT_CUSTOM_DOWNSTREAM")
'("custom-ds-oob" "GST_EVENT_CUSTOM_DS_OOB") '("custom-downstream-oob" "GST_EVENT_CUSTOM_DOWNSTREAM_OOB")
'("custom-both" "GST_EVENT_CUSTOM_BOTH") '("custom-both" "GST_EVENT_CUSTOM_BOTH")
'("custom-both-oob" "GST_EVENT_CUSTOM_BOTH_OOB") '("custom-both-oob" "GST_EVENT_CUSTOM_BOTH_OOB")
) )

View file

@ -1446,6 +1446,11 @@
(return-type "GType") (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 (define-function event_type_get_type
(c-name "gst_event_type_get_type") (c-name "gst_event_type_get_type")
(return-type "GType") (return-type "GType")
@ -1680,6 +1685,12 @@
(return-type "GQuark") (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 (define-function event_get_type
(c-name "gst_event_get_type") (c-name "gst_event_get_type")
(return-type "GType") (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 (define-function event_new_buffersize
(c-name "gst_event_new_buffersize") (c-name "gst_event_new_buffersize")
(return-type "GstEvent*") (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 (define-method set_seek
(of-object "GstSegment") (of-object "GstSegment")
(c-name "gst_segment_set_seek") (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") (c-name "gst_structure_fixate_field_nearest_int")
(return-type "gboolean") (return-type "gboolean")
(parameters (parameters
'("GstStructure*" "structure")
'("const-char*" "field_name") '("const-char*" "field_name")
'("int" "target") '("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") (c-name "gst_structure_fixate_field_nearest_double")
(return-type "gboolean") (return-type "gboolean")
(parameters (parameters
'("GstStructure*" "structure")
'("const-char*" "field_name") '("const-char*" "field_name")
'("double" "target") '("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 ;; From ../gstreamer/gst/gstsystemclock.h

View file

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