codegen/codegen.py: Always unblock threads when going to C.

Original commit message from CVS:
* codegen/codegen.py:
Always unblock threads when going to C.
* gst/gst.defs:
Revert unblock-threads noise.
This commit is contained in:
Edward Hervey 2006-06-15 09:58:08 +00:00
parent a48e8b6e6b
commit cee7d60ee4
3 changed files with 11 additions and 65 deletions

View file

@ -1,3 +1,10 @@
2006-06-15 Edward Hervey <edward@fluendo.com>
* codegen/codegen.py:
Always unblock threads when going to C.
* gst/gst.defs:
Revert unblock-threads noise.
2006-06-14 Edward Hervey <edward@fluendo.com> 2006-06-14 Edward Hervey <edward@fluendo.com>
* gst/gst-types.defs: * gst/gst-types.defs:

View file

@ -249,12 +249,8 @@ class Wrapper:
'errorreturn': '-1' } 'errorreturn': '-1' }
def get_initial_method_substdict(self, method): def get_initial_method_substdict(self, method):
substdict = { 'name': '%s.%s' % (self.objinfo.c_name, method.name) } substdict = { 'name': '%s.%s' % (self.objinfo.c_name, method.name) }
if method.unblock_threads: substdict['begin_allow_threads'] = 'pyg_begin_allow_threads;'
substdict['begin_allow_threads'] = 'pyg_begin_allow_threads;' substdict['end_allow_threads'] = 'pyg_end_allow_threads;'
substdict['end_allow_threads'] = 'pyg_end_allow_threads;'
else:
substdict['begin_allow_threads'] = ''
substdict['end_allow_threads'] = ''
return substdict return substdict
def write_class(self): def write_class(self):
@ -343,12 +339,8 @@ class Wrapper:
# if name isn't set, set it to function_obj.name # if name isn't set, set it to function_obj.name
substdict.setdefault('name', function_obj.name) substdict.setdefault('name', function_obj.name)
if function_obj.unblock_threads: substdict['begin_allow_threads'] = 'pyg_begin_allow_threads;'
substdict['begin_allow_threads'] = 'pyg_begin_allow_threads;' substdict['end_allow_threads'] = 'pyg_end_allow_threads;'
substdict['end_allow_threads'] = 'pyg_end_allow_threads;'
else:
substdict['begin_allow_threads'] = ''
substdict['end_allow_threads'] = ''
if self.objinfo: if self.objinfo:
substdict['typename'] = self.objinfo.c_name substdict['typename'] = self.objinfo.c_name

View file

@ -87,7 +87,6 @@
'("GstElement*" "element_1") '("GstElement*" "element_1")
) )
(varargs #t) (varargs #t)
(unblock-threads #t)
) )
(define-method add_many (define-method add_many
@ -98,7 +97,6 @@
'("GstElement*" "element_1") '("GstElement*" "element_1")
) )
(varargs #t) (varargs #t)
(unblock-threads #t)
) )
(define-method remove (define-method remove
@ -109,7 +107,6 @@
'("GstElement*" "element_1") '("GstElement*" "element_1")
) )
(varargs #t) (varargs #t)
(unblock-threads #t)
) )
(define-method remove_many (define-method remove_many
@ -120,7 +117,6 @@
'("GstElement*" "element_1") '("GstElement*" "element_1")
) )
(varargs #t) (varargs #t)
(unblock-threads #t)
) )
(define-method get_by_name (define-method get_by_name
@ -320,7 +316,6 @@
(parameters (parameters
'("GstMessage*" "message" (keep-refcount)) '("GstMessage*" "message" (keep-refcount))
) )
(unblock-threads #t)
) )
(define-method have_pending (define-method have_pending
@ -399,7 +394,6 @@
'("GstMessageType" "events") '("GstMessageType" "events")
'("GstClockTimeDiff" "timeout") '("GstClockTimeDiff" "timeout")
) )
(unblock-threads #t)
) )
(define-method async_signal_func (define-method async_signal_func
@ -1006,7 +1000,6 @@
(c-name "gst_element_provide_clock") (c-name "gst_element_provide_clock")
(return-type "GstClock*") (return-type "GstClock*")
(caller-owns-return #t) (caller-owns-return #t)
(unblock-threads #t)
) )
(define-method set_clock (define-method set_clock
@ -1016,7 +1009,6 @@
(parameters (parameters
'("GstClock*" "clock") '("GstClock*" "clock")
) )
(unblock-threads #t)
) )
(define-method set_base_time (define-method set_base_time
@ -1026,7 +1018,6 @@
(parameters (parameters
'("GstClockTime" "time") '("GstClockTime" "time")
) )
(unblock-threads #t)
) )
(define-method get_base_time (define-method get_base_time
@ -1048,7 +1039,6 @@
(parameters (parameters
'("GstIndex*" "index") '("GstIndex*" "index")
) )
(unblock-threads #t)
) )
(define-method get_index (define-method get_index
@ -1065,7 +1055,6 @@
(parameters (parameters
'("GstBus*" "bus") '("GstBus*" "bus")
) )
(unblock-threads #t)
) )
(define-method get_bus (define-method get_bus
@ -1073,7 +1062,6 @@
(c-name "gst_element_get_bus") (c-name "gst_element_get_bus")
(return-type "GstBus*") (return-type "GstBus*")
(caller-owns-return #t) (caller-owns-return #t)
(unblock-threads #t)
) )
(define-method get_clock (define-method get_clock
@ -1081,7 +1069,6 @@
(c-name "gst_element_get_clock") (c-name "gst_element_get_clock")
(return-type "GstClock*") (return-type "GstClock*")
(caller-owns-return #t) (caller-owns-return #t)
(unblock-threads #t)
) )
(define-method add_pad (define-method add_pad
@ -1091,7 +1078,6 @@
(parameters (parameters
'("GstPad*" "pad") '("GstPad*" "pad")
) )
(unblock-threads #t)
) )
(define-method remove_pad (define-method remove_pad
@ -1101,14 +1087,12 @@
(parameters (parameters
'("GstPad*" "pad") '("GstPad*" "pad")
) )
(unblock-threads #t)
) )
(define-method no_more_pads (define-method no_more_pads
(of-object "GstElement") (of-object "GstElement")
(c-name "gst_element_no_more_pads") (c-name "gst_element_no_more_pads")
(return-type "none") (return-type "none")
(unblock-threads #t)
) )
(define-method get_pad (define-method get_pad
@ -1119,7 +1103,6 @@
(parameters (parameters
'("const-gchar*" "name") '("const-gchar*" "name")
) )
(unblock-threads #t)
) )
(define-method get_static_pad (define-method get_static_pad
@ -1130,7 +1113,6 @@
(parameters (parameters
'("const-gchar*" "name") '("const-gchar*" "name")
) )
(unblock-threads #t)
) )
(define-method get_request_pad (define-method get_request_pad
@ -1141,7 +1123,6 @@
(parameters (parameters
'("const-gchar*" "name") '("const-gchar*" "name")
) )
(unblock-threads #t)
) )
(define-method release_request_pad (define-method release_request_pad
@ -1151,7 +1132,6 @@
(parameters (parameters
'("GstPad*" "pad") '("GstPad*" "pad")
) )
(unblock-threads #t)
) )
(define-method pads (define-method pads
@ -1179,7 +1159,6 @@
(parameters (parameters
'("GstEvent*" "event" (keep-refcount)) '("GstEvent*" "event" (keep-refcount))
) )
(unblock-threads #t)
) )
(define-method seek (define-method seek
@ -1195,7 +1174,6 @@
'("GstSeekType" "stop_type") '("GstSeekType" "stop_type")
'("gint64" "stop") '("gint64" "stop")
) )
(unblock-threads #t)
) )
(define-method get_query_types (define-method get_query_types
@ -1211,7 +1189,6 @@
(parameters (parameters
'("GstQuery*" "query") '("GstQuery*" "query")
) )
(unblock-threads #t)
) )
(define-method post_message (define-method post_message
@ -1221,7 +1198,6 @@
(parameters (parameters
'("GstMessage*" "message" (keep-refcount)) '("GstMessage*" "message" (keep-refcount))
) )
(unblock-threads #t)
) )
(define-method message_full (define-method message_full
@ -1238,14 +1214,12 @@
'("const-gchar*" "function") '("const-gchar*" "function")
'("gint" "line") '("gint" "line")
) )
(unblock-threads #t)
) )
(define-method is_locked_state (define-method is_locked_state
(of-object "GstElement") (of-object "GstElement")
(c-name "gst_element_is_locked_state") (c-name "gst_element_is_locked_state")
(return-type "gboolean") (return-type "gboolean")
(unblock-threads #t)
) )
(define-method set_locked_state (define-method set_locked_state
@ -1255,14 +1229,12 @@
(parameters (parameters
'("gboolean" "locked_state") '("gboolean" "locked_state")
) )
(unblock-threads #t)
) )
(define-method sync_state_with_parent (define-method sync_state_with_parent
(of-object "GstElement") (of-object "GstElement")
(c-name "gst_element_sync_state_with_parent") (c-name "gst_element_sync_state_with_parent")
(return-type "gboolean") (return-type "gboolean")
(unblock-threads #t)
) )
(define-method get_state (define-method get_state
@ -1274,7 +1246,6 @@
'("GstState*" "pending") '("GstState*" "pending")
'("GstClockTime" "timeout") '("GstClockTime" "timeout")
) )
(unblock-threads #t)
) )
(define-method set_state (define-method set_state
@ -1284,14 +1255,12 @@
(parameters (parameters
'("GstState" "state") '("GstState" "state")
) )
(unblock-threads #t)
) )
(define-method abort_state (define-method abort_state
(of-object "GstElement") (of-object "GstElement")
(c-name "gst_element_abort_state") (c-name "gst_element_abort_state")
(return-type "none") (return-type "none")
(unblock-threads #t)
) )
(define-method continue_state (define-method continue_state
@ -1301,14 +1270,12 @@
(parameters (parameters
'("GstStateChangeReturn" "retstate") '("GstStateChangeReturn" "retstate")
) )
(unblock-threads #t)
) )
(define-method lost_state (define-method lost_state
(of-object "GstElement") (of-object "GstElement")
(c-name "gst_element_lost_state") (c-name "gst_element_lost_state")
(return-type "none") (return-type "none")
(unblock-threads #t)
) )
(define-method get_factory (define-method get_factory
@ -2153,7 +2120,6 @@
(parameters (parameters
'("gint" "id") '("gint" "id")
) )
(unblock-threads #t)
) )
(define-method get_group (define-method get_group
@ -2175,7 +2141,6 @@
(parameters (parameters
'("gint" "groupnum") '("gint" "groupnum")
) )
(unblock-threads #t)
) )
(define-method set_certainty (define-method set_certainty
@ -3198,7 +3163,6 @@
(parameters (parameters
'("GstObject*" "parent") '("GstObject*" "parent")
) )
(unblock-threads #t)
) )
(define-method get_parent (define-method get_parent
@ -3212,7 +3176,6 @@
(of-object "GstObject") (of-object "GstObject")
(c-name "gst_object_unparent") (c-name "gst_object_unparent")
(return-type "none") (return-type "none")
(unblock-threads #t)
) )
(define-method has_ancestor (define-method has_ancestor
@ -3964,7 +3927,6 @@
'("GstPad*" "pad") '("GstPad*" "pad")
'("GstTagList*" "list") '("GstTagList*" "list")
) )
(unblock-threads #t)
) )
(define-method found_tags (define-method found_tags
@ -3974,7 +3936,6 @@
(parameters (parameters
'("GstTagList*" "list") '("GstTagList*" "list")
) )
(unblock-threads #t)
) )
(define-function gst_parse_bin_from_description (define-function gst_parse_bin_from_description
@ -6428,14 +6389,12 @@
'("GError*" "error") '("GError*" "error")
'("gchar*" "debug") '("gchar*" "debug")
) )
(unblock-threads #t)
) )
(define-method create_all_pads (define-method create_all_pads
(of-object "GstElement") (of-object "GstElement")
(c-name "gst_element_create_all_pads") (c-name "gst_element_create_all_pads")
(return-type "none") (return-type "none")
(unblock-threads #t)
) )
(define-method get_compatible_pad (define-method get_compatible_pad
@ -6446,7 +6405,6 @@
'("GstPad*" "pad") '("GstPad*" "pad")
'("const-GstCaps*" "caps" (null-ok) (default "NULL")) '("const-GstCaps*" "caps" (null-ok) (default "NULL"))
) )
(unblock-threads #t)
) )
(define-method get_compatible_pad_template (define-method get_compatible_pad_template
@ -6456,7 +6414,6 @@
(parameters (parameters
'("GstPadTemplate*" "compattempl") '("GstPadTemplate*" "compattempl")
) )
(unblock-threads #t)
) )
(define-method get_name (define-method get_name
@ -6499,7 +6456,6 @@
(parameters (parameters
'("GstElement*" "dest") '("GstElement*" "dest")
) )
(unblock-threads #t)
) )
(define-method link_filtered (define-method link_filtered
@ -6510,7 +6466,6 @@
'("GstElement*" "dest") '("GstElement*" "dest")
'("GstCaps*" "filter") '("GstCaps*" "filter")
) )
(unblock-threads #t)
) )
(define-function element_unlink_many (define-function element_unlink_many
@ -6521,7 +6476,6 @@
'("GstElement*" "element_2") '("GstElement*" "element_2")
) )
(varargs #t) (varargs #t)
(unblock-threads #t)
) )
(define-method link_pads (define-method link_pads
@ -6533,7 +6487,6 @@
'("GstElement*" "dest") '("GstElement*" "dest")
'("const-gchar*" "destpadname") '("const-gchar*" "destpadname")
) )
(unblock-threads #t)
) )
(define-method unlink_pads (define-method unlink_pads
@ -6545,7 +6498,6 @@
'("GstElement*" "dest") '("GstElement*" "dest")
'("const-gchar*" "destpadname") '("const-gchar*" "destpadname")
) )
(unblock-threads #t)
) )
(define-method link_pads_filtered (define-method link_pads_filtered
@ -6558,7 +6510,6 @@
'("const-gchar*" "destpadname") '("const-gchar*" "destpadname")
'("GstCaps*" "filter") '("GstCaps*" "filter")
) )
(unblock-threads #t)
) )
(define-method seek_simple (define-method seek_simple
@ -6570,7 +6521,6 @@
'("GstSeekFlags" "seek_flags") '("GstSeekFlags" "seek_flags")
'("gint64" "seek_pos") '("gint64" "seek_pos")
) )
(unblock-threads #t)
) )
(define-method can_src_caps (define-method can_src_caps
@ -6600,7 +6550,6 @@
'("GstFormat*" "format") '("GstFormat*" "format")
'("gint64*" "cur") '("gint64*" "cur")
) )
(unblock-threads #t)
) )
(define-method query_duration (define-method query_duration
@ -6611,7 +6560,6 @@
'("GstFormat*" "format") '("GstFormat*" "format")
'("gint64*" "duration") '("gint64*" "duration")
) )
(unblock-threads #t)
) )
(define-method query_convert (define-method query_convert
@ -6624,7 +6572,6 @@
'("GstFormat*" "dest_fmt") '("GstFormat*" "dest_fmt")
'("gint64*" "dest_val") '("gint64*" "dest_val")
) )
(unblock-threads #t)
) )
(define-method install_std_props (define-method install_std_props