codegen/argtypes.py: Proper handling of 'caller-owns-return' for miniobjects

Original commit message from CVS:
* codegen/argtypes.py:
Proper handling of 'caller-owns-return' for miniobjects
* gst/gst-types.defs:
Updating parenting of classes,
added/removed/updated flags&enums
* gst/gst.defs:
Updated to current core cvs,
Added 'caller-owns-return' properties for functions/methods that require
it
* gst/gst.override:
Don't make *_[un]ref() accessible
* gst/gstbuffer.override:
* gst/gstevent.override:
* gst/gstmessage.override:
* gst/gstquery.override:
Removed hack-ish wrappers since codegenerator handles
'caller-owns-return' methods/functions
* gst/gstmodule.c: (sink_gstobject), (init_gst):
Re-enabled sink function
* gst/libs.defs:
Updated to current core cvs
Removed Adapter
* gst/pygstminiobject.c:
* gst/pygstminiobject.h:
removed _new_noref() hack
This commit is contained in:
Edward Hervey 2005-09-28 10:58:50 +00:00
parent ee6e612754
commit 1bc63d73b9
13 changed files with 316 additions and 494 deletions

View file

@ -1,3 +1,35 @@
2005-09-28 Edward Hervey <edward@fluendo.com>
* codegen/argtypes.py:
Proper handling of 'caller-owns-return' for miniobjects
* gst/gst-types.defs:
Updating parenting of classes,
added/removed/updated flags&enums
* gst/gst.defs:
Updated to current core cvs,
Added 'caller-owns-return' properties for functions/methods that require
it
* gst/gst.override:
Don't make *_[un]ref() accessible
* gst/gstbuffer.override:
* gst/gstevent.override:
* gst/gstmessage.override:
* gst/gstquery.override:
Removed hack-ish wrappers since codegenerator handles
'caller-owns-return' methods/functions
* gst/gstmodule.c: (sink_gstobject), (init_gst):
Re-enabled sink function
* gst/libs.defs:
Updated to current core cvs
Removed Adapter
* gst/pygstminiobject.c:
* gst/pygstminiobject.h:
removed _new_noref() hack
2005-09-28 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gstpad.override:

View file

@ -538,7 +538,8 @@ class MiniObjectArg(ArgType):
if ownsreturn:
info.varlist.add('PyObject', '*py_ret')
info.codeafter.append(' py_ret = pygstminiobject_new((GstMiniObject *)ret);\n'
' gst_mini_object_unref(ret);\n'
' if (ret != NULL)\n'
' gst_mini_object_unref((GstMiniObject *)ret);\n'
' return py_ret;')
else:
info.codeafter.append(' /* pygobject_new handles NULL checking */\n' +

View file

@ -74,7 +74,7 @@
(define-object PluginFeature
(in-module "Gst")
(parent "GObject")
(parent "GstObject")
(c-name "GstPluginFeature")
(gtype-id "GST_TYPE_PLUGIN_FEATURE")
)
@ -102,7 +102,7 @@
(define-object Registry
(in-module "Gst")
(parent "GObject")
(parent "GstObject")
(c-name "GstRegistry")
(gtype-id "GST_TYPE_REGISTRY")
)
@ -640,7 +640,6 @@
(gtype-id "GST_TYPE_OBJECT_FLAGS")
(values
'("disposing" "GST_OBJECT_DISPOSING")
'("destroyed" "GST_OBJECT_DESTROYED")
'("floating" "GST_OBJECT_FLOATING")
'("flag-last" "GST_OBJECT_FLAG_LAST")
)
@ -769,6 +768,15 @@
)
)
(define-flags PluginFlags
(in-module "Gst")
(c-name "GstPluginFlags")
(gtype-id "GST_TYPE_PLUGIN_FLAGS")
(values
'("d" "GST_PLUGIN_FLAG_CACHED")
)
)
(define-enum QueryType
(in-module "Gst")
(c-name "GstQueryType")
@ -780,6 +788,7 @@
'("jitter" "GST_QUERY_JITTER")
'("rate" "GST_QUERY_RATE")
'("seeking" "GST_QUERY_SEEKING")
'("segment" "GST_QUERY_SEGMENT")
'("convert" "GST_QUERY_CONVERT")
'("formats" "GST_QUERY_FORMATS")
)

View file

@ -89,6 +89,7 @@
(of-object "GstBin")
(c-name "gst_bin_get_by_name")
(return-type "GstElement*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
)
@ -98,6 +99,7 @@
(of-object "GstBin")
(c-name "gst_bin_get_by_name_recurse_up")
(return-type "GstElement*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
)
@ -107,6 +109,7 @@
(of-object "GstBin")
(c-name "gst_bin_get_by_interface")
(return-type "GstElement*")
(caller-owns-return #t)
(parameters
'("GType" "interface")
)
@ -118,6 +121,12 @@
(return-type "GstIterator*")
)
(define-method iterate_sorted
(of-object "GstBin")
(c-name "gst_bin_iterate_sorted")
(return-type "GstIterator*")
)
(define-method iterate_recurse
(of-object "GstBin")
(c-name "gst_bin_iterate_recurse")
@ -171,6 +180,7 @@
(define-function buffer_new_and_alloc
(c-name "gst_buffer_new_and_alloc")
(return-type "GstBuffer*")
(caller-owns-return #t)
(parameters
'("guint" "size")
)
@ -180,6 +190,7 @@
(of-object "GstBuffer")
(c-name "gst_buffer_get_caps")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method set_caps
@ -195,6 +206,7 @@
(of-object "GstBuffer")
(c-name "gst_buffer_create_sub")
(return-type "GstBuffer*")
(caller-owns-return #t)
(parameters
'("guint" "offset")
'("guint" "size")
@ -214,6 +226,7 @@
(of-object "GstBuffer")
(c-name "gst_buffer_span")
(return-type "GstBuffer*")
(caller-owns-return #t)
(parameters
'("guint32" "offset")
'("GstBuffer*" "buf2")
@ -250,7 +263,7 @@
(c-name "gst_bus_have_pending")
(return-type "gboolean")
(parameters
'("GstMessageType" "type")
'("GstMessageType" "events")
)
)
@ -258,12 +271,14 @@
(of-object "GstBus")
(c-name "gst_bus_peek")
(return-type "GstMessage*")
(caller-owns-return #t)
)
(define-method pop
(of-object "GstBus")
(c-name "gst_bus_pop")
(return-type "GstMessage*")
(caller-owns-return #t)
)
(define-method set_flushing
@ -289,6 +304,9 @@
(of-object "GstBus")
(c-name "gst_bus_create_watch")
(return-type "GSource*")
(parameters
'("GstMessageType" "events")
)
)
(define-method add_watch_full
@ -297,7 +315,7 @@
(return-type "guint")
(parameters
'("gint" "priority")
'("GstMessageType" "type")
'("GstMessageType" "events")
'("GstBusFunc" "func")
'("gpointer" "user_data")
'("GDestroyNotify" "notify")
@ -309,7 +327,7 @@
(c-name "gst_bus_add_watch")
(return-type "guint")
(parameters
'("GstMessageType" "type")
'("GstMessageType" "events")
'("GstBusFunc" "func")
'("gpointer" "user_data")
)
@ -319,6 +337,7 @@
(of-object "GstBus")
(c-name "gst_bus_poll")
(return-type "GstMessage*")
(caller-owns-return #t)
(parameters
'("GstMessageType" "events")
'("GstClockTimeDiff" "timeout")
@ -343,11 +362,13 @@
(define-function caps_new_any
(c-name "gst_caps_new_any")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-function caps_new_simple
(c-name "gst_caps_new_simple")
(return-type "GstCaps*")
(caller-owns-return #t)
(parameters
'("const-char*" "media_type")
'("const-char*" "fieldname")
@ -358,6 +379,7 @@
(define-function caps_new_full
(c-name "gst_caps_new_full")
(return-type "GstCaps*")
(caller-owns-return #t)
(parameters
'("GstStructure*" "struct1")
)
@ -367,6 +389,7 @@
(define-function caps_new_full_valist
(c-name "gst_caps_new_full_valist")
(return-type "GstCaps*")
(caller-owns-return #t)
(parameters
'("GstStructure*" "structure")
'("va_list" "var_args")
@ -383,12 +406,14 @@
(of-object "GstCaps")
(c-name "gst_caps_copy")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method make_writable
(of-object "GstCaps")
(c-name "gst_caps_make_writable")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method unref
@ -440,6 +465,7 @@
(of-object "GstCaps")
(c-name "gst_caps_copy_nth")
(return-type "GstCaps*")
(caller-owns-return #t)
(parameters
'("gint" "nth")
)
@ -520,6 +546,7 @@
(of-object "GstCaps")
(c-name "gst_caps_intersect")
(return-type "GstCaps*")
(caller-owns-return #t)
(parameters
'("const-GstCaps*" "caps2")
)
@ -529,6 +556,7 @@
(of-object "GstCaps")
(c-name "gst_caps_subtract")
(return-type "GstCaps*")
(caller-owns-return #t)
(parameters
'("const-GstCaps*" "subtrahend")
)
@ -538,6 +566,7 @@
(of-object "GstCaps")
(c-name "gst_caps_union")
(return-type "GstCaps*")
(caller-owns-return #t)
(parameters
'("const-GstCaps*" "caps2")
)
@ -547,6 +576,7 @@
(of-object "GstCaps")
(c-name "gst_caps_normalize")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method do_simplify
@ -590,6 +620,7 @@
(define-function caps_from_string
(c-name "gst_caps_from_string")
(return-type "GstCaps*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "string")
)
@ -815,6 +846,7 @@
(of-object "GstElement")
(c-name "gst_element_get_clock")
(return-type "GstClock*")
(caller-owns-return #t)
)
(define-method set_clock
@ -860,6 +892,7 @@
(of-object "GstElement")
(c-name "gst_element_get_index")
(return-type "GstIndex*")
(caller-owns-return #t)
)
(define-method set_bus
@ -875,6 +908,7 @@
(of-object "GstElement")
(c-name "gst_element_get_bus")
(return-type "GstBus*")
(caller-owns-return #t)
)
(define-method add_pad
@ -905,6 +939,7 @@
(of-object "GstElement")
(c-name "gst_element_get_pad")
(return-type "GstPad*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
)
@ -914,6 +949,7 @@
(of-object "GstElement")
(c-name "gst_element_get_static_pad")
(return-type "GstPad*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
)
@ -923,6 +959,7 @@
(of-object "GstElement")
(c-name "gst_element_get_request_pad")
(return-type "GstPad*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
)
@ -1256,6 +1293,7 @@
(of-object "GstElementFactory")
(c-name "gst_element_factory_create")
(return-type "GstElement*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name" (null-ok) (default "NULL"))
)
@ -1264,6 +1302,7 @@
(define-function element_factory_make
(c-name "gst_element_factory_make")
(return-type "GstElement*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "factoryname")
'("const-gchar*" "name" (null-ok) (default "NULL"))
@ -1578,6 +1617,7 @@
(define-function event_new_custom
(c-name "gst_event_new_custom")
(return-type "GstEvent*")
(caller-owns-return #t)
(parameters
'("GstEventType" "type")
'("GstStructure*" "structure")
@ -1593,21 +1633,25 @@
(define-function event_new_flush_start
(c-name "gst_event_new_flush_start")
(return-type "GstEvent*")
(caller-owns-return #t)
)
(define-function event_new_flush_stop
(c-name "gst_event_new_flush_stop")
(return-type "GstEvent*")
(caller-owns-return #t)
)
(define-function event_new_eos
(c-name "gst_event_new_eos")
(return-type "GstEvent*")
(caller-owns-return #t)
)
(define-function event_new_newsegment
(c-name "gst_event_new_newsegment")
(return-type "GstEvent*")
(caller-owns-return #t)
(parameters
'("gdouble" "rate")
'("GstFormat" "format")
@ -1633,6 +1677,7 @@
(define-function event_new_tag
(c-name "gst_event_new_tag")
(return-type "GstEvent*")
(caller-owns-return #t)
(parameters
'("GstTagList*" "taglist")
)
@ -1650,11 +1695,13 @@
(define-function event_new_filler
(c-name "gst_event_new_filler")
(return-type "GstEvent*")
(caller-owns-return #t)
)
(define-function event_new_qos
(c-name "gst_event_new_qos")
(return-type "GstEvent*")
(caller-owns-return #t)
(parameters
'("gdouble" "proportion")
'("GstClockTimeDiff" "diff")
@ -1676,6 +1723,7 @@
(define-function event_new_seek
(c-name "gst_event_new_seek")
(return-type "GstEvent*")
(caller-owns-return #t)
(parameters
'("gdouble" "rate")
'("GstFormat" "format")
@ -1705,6 +1753,7 @@
(define-function event_new_navigation
(c-name "gst_event_new_navigation")
(return-type "GstEvent*")
(caller-owns-return #t)
(parameters
'("GstStructure*" "structure")
)
@ -1787,6 +1836,7 @@
(define-function ghost_pad_new_notarget
(c-name "gst_ghost_pad_new_notarget")
(return-type "GstPad*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
'("GstPadDirection" "dir")
@ -1796,6 +1846,7 @@
(define-method get_target
(of-object "GstGhostPad")
(c-name "gst_ghost_pad_get_target")
(caller-owns-return #t)
(return-type "GstPad*")
)
@ -2002,6 +2053,7 @@
(define-method copy
(of-object "GstIndexEntry")
(c-name "gst_index_entry_copy")
(caller-owns-return #t)
(return-type "GstIndexEntry*")
)
@ -2055,11 +2107,13 @@
(of-object "GstIndexFactory")
(c-name "gst_index_factory_create")
(return-type "GstIndex*")
(caller-owns-return #t)
)
(define-function index_factory_make
(c-name "gst_index_factory_make")
(return-type "GstIndex*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
)
@ -2512,6 +2566,7 @@
(define-function message_new_eos
(c-name "gst_message_new_eos")
(return-type "GstMessage*")
(caller-owns-return #t)
(parameters
'("GstObject*" "src")
)
@ -2520,6 +2575,7 @@
(define-function message_new_error
(c-name "gst_message_new_error")
(return-type "GstMessage*")
(caller-owns-return #t)
(parameters
'("GstObject*" "src")
'("GError*" "error")
@ -2530,6 +2586,7 @@
(define-function message_new_warning
(c-name "gst_message_new_warning")
(return-type "GstMessage*")
(caller-owns-return #t)
(parameters
'("GstObject*" "src")
'("GError*" "error")
@ -2540,6 +2597,7 @@
(define-function message_new_tag
(c-name "gst_message_new_tag")
(return-type "GstMessage*")
(caller-owns-return #t)
(parameters
'("GstObject*" "src")
'("GstTagList*" "tag_list")
@ -2549,6 +2607,7 @@
(define-function message_new_state_changed
(c-name "gst_message_new_state_changed")
(return-type "GstMessage*")
(caller-owns-return #t)
(parameters
'("GstObject*" "src")
'("GstState" "old_state")
@ -2559,6 +2618,7 @@
(define-function gst_message_new_segment_start
(c-name "gst_message_new_segment_start")
(return-type "GstMessage*")
(caller-owns-return #t)
(parameters
'("GstObject*" "src")
'("GstClockTime" "timestamp")
@ -2568,6 +2628,7 @@
(define-function gst_message_new_segment_done
(c-name "gst_message_new_segment_done")
(return-type "GstMessage*")
(caller-owns-return #t)
(parameters
'("GstObject*" "src")
'("GstClockTime" "timestamp")
@ -2577,6 +2638,7 @@
(define-function message_new_custom
(c-name "gst_message_new_custom")
(return-type "GstMessage*")
(caller-owns-return #t)
(parameters
'("GstMessageType" "type")
'("GstObject*" "src")
@ -2669,6 +2731,7 @@
(of-object "GstMiniObject")
(c-name "gst_mini_object_copy")
(return-type "GstMiniObject*")
(caller-owns-return #t)
)
(define-method is_writable
@ -2681,6 +2744,7 @@
(of-object "GstMiniObject")
(c-name "gst_mini_object_make_writable")
(return-type "GstMiniObject*")
(caller-owns-return #t)
)
(define-method ref
@ -2792,6 +2856,7 @@
(of-object "GstObject")
(c-name "gst_object_get_parent")
(return-type "GstObject*")
(caller-owns-return #t)
)
(define-method unparent
@ -2800,6 +2865,15 @@
(return-type "none")
)
(define-method has_ancestor
(of-object "GstObject")
(c-name "gst_object_has_ancestor")
(return-type "gboolean")
(parameters
'("GstObject*" "ancestor")
)
)
(define-function object_default_deep_notify
(c-name "gst_object_default_deep_notify")
(return-type "none")
@ -2982,6 +3056,7 @@
(define-function pad_new_from_template
(c-name "gst_pad_new_from_template")
(return-type "GstPad*")
(caller-owns-return #t)
(parameters
'("GstPadTemplate*" "templ")
'("const-gchar*" "name")
@ -3204,6 +3279,7 @@
(of-object "GstPad")
(c-name "gst_pad_get_peer")
(return-type "GstPad*")
(caller-owns-return #t)
)
(define-method set_getcaps_function
@ -3252,6 +3328,7 @@
(of-object "GstPad")
(c-name "gst_pad_get_caps")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method fixate_caps
@ -3285,6 +3362,7 @@
(of-object "GstPad")
(c-name "gst_pad_peer_get_caps")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method peer_accept_caps
@ -3300,12 +3378,14 @@
(of-object "GstPad")
(c-name "gst_pad_get_allowed_caps")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method get_negotiated_caps
(of-object "GstPad")
(c-name "gst_pad_get_negotiated_caps")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method push
@ -3569,20 +3649,31 @@
(of-object "GstStaticPadTemplate")
(c-name "gst_static_pad_template_get")
(return-type "GstPadTemplate*")
(caller-owns-return #t)
)
(define-method get_caps
(of-object "GstStaticPadTemplate")
(c-name "gst_static_pad_template_get_caps")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method get_caps
(of-object "GstPadTemplate")
(c-name "gst_pad_template_get_caps")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method pad_created
(of-object "GstPadTemplate")
(c-name "gst_pad_template_pad_created")
(return-type "none")
(parameters
'("GstPad*" "pad")
)
)
;; From ../gstreamer/gst/gstparse.h
@ -3632,6 +3723,7 @@
(of-object "GstPipeline")
(c-name "gst_pipeline_get_bus")
(return-type "GstBus*")
(caller-owns-return #t)
)
(define-method set_new_stream_time
@ -3671,6 +3763,7 @@
(of-object "GstPipeline")
(c-name "gst_pipeline_get_clock")
(return-type "GstClock*")
(caller-owns-return #t)
)
(define-method auto_clock
@ -3753,28 +3846,6 @@
(return-type "gboolean")
)
(define-method feature_filter
(of-object "GstPlugin")
(c-name "gst_plugin_feature_filter")
(return-type "GList*")
(parameters
'("GstPluginFeatureFilter" "filter")
'("gboolean" "first")
'("gpointer" "user_data")
)
)
(define-function plugin_list_feature_filter
(c-name "gst_plugin_list_feature_filter")
(return-type "GList*")
(parameters
'("GList*" "list")
'("GstPluginFeatureFilter" "filter")
'("gboolean" "first")
'("gpointer" "user_data")
)
)
(define-method name_filter
(of-object "GstPlugin")
(c-name "gst_plugin_name_filter")
@ -3809,6 +3880,22 @@
(return-type "GstPlugin*")
)
(define-function plugin_load_by_name
(c-name "gst_plugin_load_by_name")
(return-type "GstPlugin*")
(parameters
'("const-gchar*" "name")
)
)
(define-function plugin_list_free
(c-name "gst_plugin_list_free")
(return-type "none")
(parameters
'("GList*" "list")
)
)
;; From ../gstreamer/gst/gstpluginfeature.h
@ -3863,6 +3950,14 @@
(return-type "const-gchar*")
)
(define-function plugin_feature_list_free
(c-name "gst_plugin_feature_list_free")
(return-type "none")
(parameters
'("GList*" "list")
)
)
;; From ../gstreamer/gst/gstquery.h
(define-function gst_query_get_type
@ -3910,6 +4005,7 @@
(define-function query_new_position
(c-name "gst_query_new_position")
(return-type "GstQuery*")
(caller-owns-return #t)
(parameters
'("GstFormat" "format")
)
@ -3940,6 +4036,7 @@
(define-function query_new_convert
(c-name "gst_query_new_convert")
(return-type "GstQuery*")
(caller-owns-return #t)
(parameters
'("GstFormat" "src_fmt")
'("gint64" "value")
@ -3971,9 +4068,45 @@
)
)
(define-function query_new_segment
(c-name "gst_query_new_segment")
(return-type "GstQuery*")
(caller-owns-return #t)
(parameters
'("GstFormat" "format")
)
)
(define-method set_segment
(of-object "GstQuery")
(c-name "gst_query_set_segment")
(return-type "none")
(parameters
'("gdouble" "rate")
'("GstFormat" "format")
'("gint64" "start_value")
'("gint64" "stop_value")
'("gint64" "base")
)
)
(define-method parse_segment
(of-object "GstQuery")
(c-name "gst_query_parse_segment")
(return-type "none")
(parameters
'("gdouble*" "rate")
'("GstFormat*" "format")
'("gint64*" "start_value")
'("gint64*" "stop_value")
'("gint64*" "base")
)
)
(define-function query_new_application
(c-name "gst_query_new_application")
(return-type "GstQuery*")
(caller-owns-return #t)
(parameters
'("GstQueryType" "type")
'("GstStructure*" "structure")
@ -3987,7 +4120,6 @@
)
(define-method set_seeking
(of-object "GstQuery")
(c-name "gst_query_set_seeking")
@ -4087,6 +4219,7 @@
(of-object "GstRegistry")
(c-name "gst_registry_find_plugin")
(return-type "GstPlugin*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
)
@ -4117,13 +4250,13 @@
(c-name "gst_registry_get_feature_list_by_plugin")
(return-type "GList*")
(parameters
'("const gchar*" "name")
'("const-gchar*" "name")
)
)
(define-method add_feature
(of-object "GstRegistry")
(c-name "gst_registry_add_feature")
(return-type "none")
(return-type "gboolean")
(parameters
'("GstPluginFeature*" "feature")
)
@ -4143,6 +4276,7 @@
(of-object "GstRegistry")
(c-name "gst_registry_find_feature")
(return-type "GstPluginFeature*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
'("GType" "type")
@ -4153,6 +4287,7 @@
(of-object "GstRegistry")
(c-name "gst_registry_lookup_feature")
(return-type "GstPluginFeature*")
(caller-owns-return #t)
(parameters
'("const-char*" "name")
)
@ -4162,8 +4297,9 @@
(of-object "GstRegistry")
(c-name "gst_registry_lookup")
(return-type "GstPlugin*")
(caller-owns-return #t)
(parameters
'("const-char*" "location")
'("const-char*" "filename")
)
)
@ -4185,6 +4321,12 @@
)
)
(define-method scan_paths
(of-object "GstRegistry")
(c-name "gst_registry_scan_paths")
(return-type "none")
)
;; From ../gstreamer/gst/gststructure.h
(define-function gst_structure_get_type
@ -4224,6 +4366,7 @@
(define-function structure_new_valist
(c-name "gst_structure_new_valist")
(return-type "GstStructure*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "name")
'("const-gchar*" "firstfield")
@ -4235,6 +4378,7 @@
(of-object "GstStructure")
(c-name "gst_structure_copy")
(return-type "GstStructure*")
(caller-owns-return #t)
)
(define-method set_parent_refcount
@ -4486,6 +4630,26 @@
)
)
(define-method get_date
(of-object "GstStructure")
(c-name "gst_structure_get_date")
(return-type "gboolean")
(parameters
'("const-gchar*" "fieldname")
'("GDate**" "value")
)
)
(define-method get_clock_time
(of-object "GstStructure")
(c-name "gst_structure_get_clock_time")
(return-type "gboolean")
(parameters
'("const-gchar*" "fieldname")
'("GstClockTime*" "value")
)
)
(define-method get_string
(of-object "GstStructure")
(c-name "gst_structure_get_string")
@ -4504,6 +4668,7 @@
(define-function structure_from_string
(c-name "gst_structure_from_string")
(return-type "GstStructure*")
(caller-owns-return #t)
(parameters
'("const-gchar*" "string")
'("gchar**" "end")
@ -4542,6 +4707,7 @@
(define-function system_clock_obtain
(c-name "gst_system_clock_obtain")
(return-type "GstClock*")
(caller-owns-return #t)
)
@ -4650,6 +4816,7 @@
(of-object "GstTagList")
(c-name "gst_tag_list_copy")
(return-type "GstTagList*")
(caller-owns-return #t)
)
(define-method insert
@ -4666,6 +4833,7 @@
(of-object "GstTagList")
(c-name "gst_tag_list_merge")
(return-type "GstTagList*")
(caller-owns-return #t)
(parameters
'("const-GstTagList*" "list2")
'("GstTagMergeMode" "mode")
@ -5340,7 +5508,7 @@
(define-method get_caps
(of-object "GstTypeFindFactory")
(c-name "gst_type_find_factory_get_caps")
(return-type "const-GstCaps*")
(return-type "GstCaps*")
)
(define-method call_function
@ -5488,6 +5656,16 @@
)
)
(define-function gst_util_uint64_scale
(c-name "gst_util_uint64_scale")
(return-type "guint64")
(parameters
'("guint64" "val")
'("guint64" "num")
'("guint64" "denom")
)
)
(define-function print_pad_caps
(c-name "gst_print_pad_caps")
(return-type "none")
@ -5725,12 +5903,14 @@
(of-object "GstPad")
(c-name "gst_pad_get_fixed_caps_func")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method proxy_getcaps
(of-object "GstPad")
(c-name "gst_pad_proxy_getcaps")
(return-type "GstCaps*")
(caller-owns-return #t)
)
(define-method proxy_setcaps
@ -5746,6 +5926,7 @@
(of-object "GstPad")
(c-name "gst_pad_get_parent_element")
(return-type "GstElement*")
(caller-owns-return #t)
)
(define-function flow_get_name
@ -5809,6 +5990,7 @@
(of-object "GstBuffer")
(c-name "gst_buffer_merge")
(return-type "GstBuffer*")
(caller-owns-return #t)
(parameters
'("GstBuffer*" "buf2")
)
@ -5818,6 +6000,7 @@
(of-object "GstBuffer")
(c-name "gst_buffer_join")
(return-type "GstBuffer*")
(caller-owns-return #t)
(parameters
'("GstBuffer*" "buf2")
)
@ -6046,6 +6229,23 @@
)
)
(define-function value_get_date
(c-name "gst_value_get_date")
(return-type "const-GDate*")
(parameters
'("const-GValue*" "value")
)
)
(define-function value_set_date
(c-name "gst_value_set_date")
(return-type "none")
(parameters
'("GValue*" "value")
'("const-GDate*" "date")
)
)
(define-function value_compare
(c-name "gst_value_compare")
(return-type "int")

View file

@ -287,6 +287,8 @@ ignore-glob
*_private
*_thyself
*_valist
*_ref
*_unref
gst_class_*
gst_init*
gst_interface_*

View file

@ -76,21 +76,6 @@ _wrap_gst_buffer_new(PyGstMiniObject *self, PyObject *args, PyObject *kwargs)
return 0;
}
%%
override gst_buffer_new_and_alloc kwargs
static PyObject *
_wrap_gst_buffer_new_and_alloc(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "size", NULL };
GstBuffer *ret;
guint size;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "I:buffer_new_and_alloc", kwlist, &size))
return NULL;
ret = gst_buffer_new_and_alloc(size);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_buffer_get_data
static PyObject*
_wrap_gst_buffer_get_data(PyObject *self)

View file

@ -55,110 +55,6 @@ _wrap_gst_event_discont_get_value(PyGstMiniObject *self, PyObject *args, PyObjec
return ret;
}
%%
override gst_event_new_seek kwargs
static PyObject *
_wrap_gst_event_new_seek(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "rate", "format", "flags", "cur_type", "cur", "stop_type", "stop", NULL };
GstSeekType cur_type, stop_type;
PyObject *py_format = NULL, *py_flags = NULL, *py_cur_type = NULL, *py_stop_type = NULL;
double rate;
GstEvent *ret;
GstFormat format;
gint64 cur, stop;
GstSeekFlags flags;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dOOOLOL:GstEvent.new_seek", kwlist, &rate, &py_format, &py_flags, &py_cur_type, &cur, &py_stop_type, &stop))
return NULL;
if (pyg_enum_get_value(GST_TYPE_FORMAT, py_format, (gint *)&format))
return NULL;
if (pyg_flags_get_value(GST_TYPE_SEEK_FLAGS, py_flags, (gint *)&flags))
return NULL;
if (pyg_flags_get_value(GST_TYPE_SEEK_TYPE, py_cur_type, (gint *)&cur_type))
return NULL;
if (pyg_flags_get_value(GST_TYPE_SEEK_TYPE, py_stop_type, (gint *)&stop_type))
return NULL;
ret = gst_event_new_seek(rate, format, flags, cur_type, cur, stop_type, stop);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_event_new_segment_seek kwargs
static PyObject *
_wrap_gst_event_new_segment_seek(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "type", "start", "stop", NULL };
PyObject *py_type = NULL;
gint64 start, stop;
GstEvent *ret;
GstSeekType type;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OLL:event_new_segment_seek", kwlist, &py_type, &start, &stop))
return NULL;
if (pyg_flags_get_value(GST_TYPE_SEEK_TYPE, py_type, (gint *)&type))
return NULL;
ret = gst_event_new_segment_seek(type, start, stop);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_event_new_size kwargs
static PyObject *
_wrap_gst_event_new_size(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "format", "value", NULL };
PyObject *py_format = NULL;
GstFormat format;
GstEvent *ret;
gint64 value;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OL:event_new_size", kwlist, &py_format, &value))
return NULL;
if (pyg_enum_get_value(GST_TYPE_FORMAT, py_format, (gint *)&format))
return NULL;
ret = gst_event_new_size(format, value);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_event_new_flush kwargs
static PyObject *
_wrap_gst_event_new_flush(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "done", NULL };
int done;
GstEvent *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:event_new_flush", kwlist, &done))
return NULL;
ret = gst_event_new_flush(done);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_event_new_tag kwargs
static PyObject *
_wrap_gst_event_new_tag(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "list", NULL };
GstTagList *list = NULL;
PyObject *py_list;
GstEvent *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:event_new_tag", kwlist, &py_list))
return NULL;
if (pyg_boxed_check(py_list, GST_TYPE_TAG_LIST))
list = pyg_boxed_get(py_list, GstTagList);
else {
PyErr_SetString(PyExc_TypeError, "list should be a GstTagList");
return NULL;
}
ret = gst_event_new_tag(list);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_event_get_structure noargs
static PyObject *
_wrap_gst_event_get_structure(PyGstMiniObject *self)

View file

@ -148,133 +148,3 @@ _wrap_gst_message_parse_tag (PyGstMiniObject *self)
return ret;
}
%%
override gst_message_new_eos kwargs
static PyObject *
_wrap_gst_message_new_eos(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "src", NULL };
PyGObject *src;
GstMessage *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:message_new_eos", kwlist, &PyGstObject_Type, &src))
return NULL;
ret = gst_message_new_eos(GST_OBJECT(src->obj));
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_message_new_error kwargs
static PyObject *
_wrap_gst_message_new_error(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "src", "error", "debug", NULL };
PyGObject *src;
PyObject *py_error;
char *debug;
GError *error = NULL;
GstMessage *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!Os:message_new_error", kwlist, &PyGstObject_Type, &src, &py_error, &debug))
return NULL;
if (pyg_boxed_check(py_error, GST_TYPE_G_ERROR))
error = pyg_boxed_get(py_error, GError);
else {
PyErr_SetString(PyExc_TypeError, "error should be a GError");
return NULL;
}
ret = gst_message_new_error(GST_OBJECT(src->obj), error, debug);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_message_new_warning kwargs
static PyObject *
_wrap_gst_message_new_warning(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "src", "error", "debug", NULL };
PyGObject *src;
PyObject *py_error;
char *debug;
GError *error = NULL;
GstMessage *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!Os:message_new_warning", kwlist, &PyGstObject_Type, &src, &py_error, &debug))
return NULL;
if (pyg_boxed_check(py_error, GST_TYPE_G_ERROR))
error = pyg_boxed_get(py_error, GError);
else {
PyErr_SetString(PyExc_TypeError, "error should be a GError");
return NULL;
}
ret = gst_message_new_warning(GST_OBJECT(src->obj), error, debug);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_message_new_tag kwargs
static PyObject *
_wrap_gst_message_new_tag(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "src", "tag_list", NULL };
PyGObject *src;
GstTagList *tag_list = NULL;
PyObject *py_tag_list;
GstMessage *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!O:message_new_tag", kwlist, &PyGstObject_Type, &src, &py_tag_list))
return NULL;
if (pyg_boxed_check(py_tag_list, GST_TYPE_TAG_LIST))
tag_list = pyg_boxed_get(py_tag_list, GstTagList);
else {
PyErr_SetString(PyExc_TypeError, "tag_list should be a GstTagList");
return NULL;
}
ret = gst_message_new_tag(GST_OBJECT(src->obj), tag_list);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_message_new_state_changed kwargs
static PyObject *
_wrap_gst_message_new_state_changed(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "src", "old_state", "new_state", NULL };
PyGObject *src;
PyObject *py_old_state = NULL, *py_new_state = NULL;
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_enum_get_value(GST_TYPE_STATE, py_old_state, (gint *)&old_state))
return NULL;
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 */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_message_new_application kwargs
static PyObject *
_wrap_gst_message_new_application(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "src", "structure", NULL };
PyGObject *src;
PyObject *py_structure;
GstStructure *structure = NULL;
GstMessage *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!O:message_new_application", kwlist, &PyGstObject_Type, &src, &py_structure))
return NULL;
if (pyg_boxed_check(py_structure, GST_TYPE_STRUCTURE))
structure = pyg_boxed_get(py_structure, GstStructure);
else {
PyErr_SetString(PyExc_TypeError, "structure should be a GstStructure");
return NULL;
}
ret = gst_message_new_application(GST_OBJECT(src->obj), structure);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}

View file

@ -104,6 +104,15 @@ pygstminiobject_to_gvalue(GValue *value, PyObject *obj)
return 0;
}
static void
sink_gstobject(GObject *object)
{
if (GST_OBJECT_IS_FLOATING(object)) {
gst_object_ref(GST_OBJECT(object));
gst_object_sink(GST_OBJECT(object));
}
}
DL_EXPORT(void)
init_gst (void)
{
@ -147,7 +156,7 @@ init_gst (void)
}
/* _pygst_register_boxed_types (NULL); */
/* pygobject_register_sinkfunc(GST_TYPE_OBJECT, sink_gstobject); */
pygobject_register_sinkfunc(GST_TYPE_OBJECT, sink_gstobject);
m = Py_InitModule ("_gst", pygst_functions);
d = PyModule_GetDict (m);

View file

@ -69,68 +69,3 @@ _wrap_gst_query_parse_convert (PyGstMiniObject *self)
return ret;
}
%%
override gst_query_new_position kwargs
static PyObject *
_wrap_gst_query_new_position(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "format", NULL };
PyObject *py_format = NULL;
GstFormat format;
GstQuery *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:query_new_position", kwlist, &py_format))
return NULL;
if (pyg_enum_get_value(GST_TYPE_FORMAT, py_format, (gint *)&format))
return NULL;
ret = gst_query_new_position(format);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_query_new_convert kwargs
static PyObject *
_wrap_gst_query_new_convert(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "src_fmt", "value", "dest_fmt", NULL };
PyObject *py_src_fmt = NULL, *py_dest_fmt = NULL;
GstQuery *ret;
GstFormat src_fmt, dest_fmt;
gint64 value;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OLO:query_new_convert", kwlist, &py_src_fmt, &value, &py_dest_fmt))
return NULL;
if (pyg_enum_get_value(GST_TYPE_FORMAT, py_src_fmt, (gint *)&src_fmt))
return NULL;
if (pyg_enum_get_value(GST_TYPE_FORMAT, py_dest_fmt, (gint *)&dest_fmt))
return NULL;
ret = gst_query_new_convert(src_fmt, value, dest_fmt);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}
%%
override gst_query_new_application kwargs
static PyObject *
_wrap_gst_query_new_application(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "type", "structure", NULL };
PyObject *py_type = NULL, *py_structure;
GstQuery *ret;
GstStructure *structure = NULL;
GstQueryType type;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:query_new_application", kwlist, &py_type, &py_structure))
return NULL;
if (pyg_enum_get_value(GST_TYPE_QUERY_TYPE, py_type, (gint *)&type))
return NULL;
if (pyg_boxed_check(py_structure, GST_TYPE_STRUCTURE))
structure = pyg_boxed_get(py_structure, GstStructure);
else {
PyErr_SetString(PyExc_TypeError, "structure should be a GstStructure");
return NULL;
}
ret = gst_query_new_application(type, structure);
/* pygobject_new handles NULL checking */
return pygstminiobject_new_noref((GstMiniObject *)ret);
}

View file

@ -1,11 +1,5 @@
;; -*- scheme -*-
; object definitions ...
(define-object Adapter
(in-module "Gst")
(parent "GObject")
(c-name "GstAdapter")
(gtype-id "GST_TYPE_ADAPTER")
)
(define-object Controller
(in-module "Gst")
@ -51,62 +45,6 @@
)
)
;; From ../gstreamer/libs/gst/bytestream/adapter.h
(define-function gst_adapter_new
(c-name "gst_adapter_new")
(is-constructor-of "GstAdapter")
(return-type "GstAdapter*")
)
(define-method clear
(of-object "GstAdapter")
(c-name "gst_adapter_clear")
(return-type "none")
)
(define-method push
(of-object "GstAdapter")
(c-name "gst_adapter_push")
(return-type "none")
(parameters
'("GstBuffer*" "buf")
)
)
(define-method peek
(of-object "GstAdapter")
(c-name "gst_adapter_peek")
(return-type "const-guint8*")
(parameters
'("guint" "size")
)
)
(define-method flush
(of-object "GstAdapter")
(c-name "gst_adapter_flush")
(return-type "none")
(parameters
'("guint" "flush")
)
)
(define-method available
(of-object "GstAdapter")
(c-name "gst_adapter_available")
(return-type "guint")
)
(define-method available_fast
(of-object "GstAdapter")
(c-name "gst_adapter_available_fast")
(return-type "guint")
)
;; From ../gstreamer/libs/gst/controller/gst-controller.h
(define-function gst_controller_get_type
@ -240,63 +178,64 @@
)
)
(define-method control_properties
(of-object "GObject")
(c-name "g_object_control_properties")
(define-function object_control_properties
(c-name "gst_object_control_properties")
(return-type "GstController*")
(parameters
'("GObject*" "object"))
(varargs #t)
)
(define-function object_uncontrol_properties
(c-name "gst_object_uncontrol_properties")
(return-type "gboolean")
(parameters
'("GObject*" "object")
)
(varargs #t)
)
(define-method uncontrol_properties
(of-object "GObject")
(c-name "g_object_uncontrol_properties")
(return-type "gboolean")
(parameters
)
(varargs #t)
)
(define-method get_controller
(of-object "GObject")
(c-name "g_object_get_controller")
(define-function object_get_controller
(c-name "gst_object_get_controller")
(return-type "GstController*")
(parameters
'("GObject*" "object")
)
)
(define-method set_controller
(of-object "GObject")
(c-name "g_object_set_controller")
(define-function object_set_controller
(c-name "gst_object_set_controller")
(return-type "gboolean")
(parameters
'("GObject*" "object")
'("GstController*" "controller")
)
)
(define-method sync_values
(of-object "GObject")
(c-name "g_object_sync_values")
(define-function object_sync_values
(c-name "gst_object_sync_values")
(return-type "gboolean")
(parameters
'("GObject*" "object")
'("GstClockTime" "timestamp")
)
)
(define-method get_value_arrays
(of-object "GObject")
(c-name "g_object_get_value_arrays")
(define-function object_get_value_arrays
(c-name "gst_object_get_value_arrays")
(return-type "gboolean")
(parameters
'("GObject*" "object")
'("GstClockTime" "timestamp")
'("GSList*" "value_arrays")
)
)
(define-method get_value_array
(of-object "GObject")
(c-name "g_object_get_value_array")
(define-function object_get_value_array
(c-name "gst_object_get_value_array")
(return-type "gboolean")
(parameters
'("GObject*" "object")
'("GstClockTime" "timestamp")
'("GstValueArray*" "value_array")
)
@ -315,11 +254,6 @@
;; From ../gstreamer/libs/gst/dataprotocol/dataprotocol.h
(define-function gst_dp_init
(c-name "gst_dp_init")
(return-type "none")
)
(define-function gst_dp_header_payload_length
(c-name "gst_dp_header_payload_length")
(return-type "guint32")

View file

@ -214,55 +214,6 @@ pygstminiobject_new (GstMiniObject *obj)
return (PyObject *) self;
}
/**
* pygstminiobject_new_noref
* @obj: a GstMiniObject instance.
*
* This function will return the wrapper for the given MiniObject
* Only use this function to wrap miniobjects created in the bindings
*
* Returns: a reference to the wrapper for the GstMiniObject.
*/
PyObject *
pygstminiobject_new_noref (GstMiniObject *obj)
{
PyGILState_STATE state;
PyGstMiniObject *self;
if (obj == NULL) {
Py_INCREF (Py_None);
return Py_None;
}
/* create wrapper */
PyTypeObject *tp = pygstminiobject_lookup_class (G_OBJECT_TYPE (obj));
if (!tp)
g_warning ("Couldn't get class for type object : %p", obj);
/* need to bump type refcount if created with
pygstminiobject_new_with_interfaces(). fixes bug #141042 */
if (tp->tp_flags & Py_TPFLAGS_HEAPTYPE)
Py_INCREF (tp);
self = PyObject_GC_New (PyGstMiniObject, tp);
if (self == NULL)
return NULL;
/* DO NOT REF !! */
self->obj = obj;
/*self->obj = gst_mini_object_ref(obj);*/
self->inst_dict = NULL;
self->weakreflist = NULL;
/* save wrapper pointer so we can access it later */
Py_INCREF (self);
GST_DEBUG ("inserting self %p in the table for object %p", self, obj);
state = pyg_gil_state_ensure();
g_hash_table_insert (_miniobjs, (gpointer) obj, (gpointer) self);
pyg_gil_state_release(state);
PyObject_GC_Track ((PyObject *)self);
return (PyObject *) self;
}
static void
pygstminiobject_dealloc(PyGstMiniObject *self)
{

View file

@ -28,8 +28,6 @@ typedef struct {
PyObject *
pygstminiobject_new(GstMiniObject *obj);
PyObject *
pygstminiobject_new_noref(GstMiniObject *obj);
#define pygstminiobject_get(v) (((PyGstMiniObject *)(v))->obj)
#define pygstminiobject_check(v,base) (PyObject_TypeCheck(v,base))